Skip to content

Support Untitled files and automatic *.Notebook.ps1 files #2919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

TylerLeonhardt
Copy link
Member

PR Summary

Fixes #2866
Fixes #2901
Fixes #2865

This enables the following features:

  • Untitled file support - now you can open untitled PowerShell files in Notebook mode, when you save the untitled notebook the experience is what you expect (saves to ps1 and opens that ps1 in notebook mode)
  • Automatic Notebooks - if you create a file with *.Notebook.ps1, it will automatically open in Notebook mode. In order to do this, I needed to register 2 different viewTypes with the same underlying implementation. It's a little clunky from the dev experience (I'll probably open an issue) but the UX feels nice. You can still go back to text editor mode from a *.Notebook.ps1 if you want

PR Checklist

Note: Tick the boxes below that apply to this pull request by putting an x between the square brackets.
Please mark anything not applicable to this PR NA.

  • PR has a meaningful title
  • Summarized changes
  • PR has tests
  • This PR is ready to merge and is not work in progress
    • If the PR is work in progress, please add the prefix WIP: to the beginning of the title and remove the prefix when the PR is ready

@ghost ghost added Area-Notebooks Issue-Bug A bug to squash. Issue-Enhancement A feature request (enhancement). labels Aug 27, 2020
"onNotebook:PowerShellNotebookModeDefault",
"onNotebookEditor:PowerShellNotebookModeDefault",
"onNotebook:PowerShellNotebookModeOption",
"onNotebookEditor:PowerShellNotebookModeOption"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in a few insider builds we can remove the onNotebookEditor ones as that will be deprecated.

@TylerLeonhardt TylerLeonhardt merged commit 95e23e3 into PowerShell:master Sep 8, 2020
@TylerLeonhardt TylerLeonhardt deleted the improve-notebook-mode branch September 8, 2020 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug A bug to squash. Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Notebook Mode Preview) Executing code doesnt open IC Notebook Mode enabled for specific files Support Untitled files with Notebook Mode
2 participants