Repository navigation
feat(notes): open notes like the Explorer and add Open Preview - #101
Merged
Merged
Conversation
Notes always opened with showTextDocument, which forces the text editor: it ignored workbench.editorAssociations, so Markdown associated with the preview or another editor still opened as text (#10, #53), and an image failed to open at all (#70). - notes open with vscode.open, like the Explorer, from the tree and List Notes; a new note still opens as text, ready to type in - Open Preview in the right-click menu of a Markdown note, as the Explorer has; a tree item gets no language context, so Markdown notes have their own context value and the note menu entries match both - the languages VS Code knows move to their own module, read once and again when extensions change, and are shared by new notes and the tree
This was referenced Oct 7, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes always opened with
showTextDocument, which forces the text editor. It ignored VS Code'sworkbench.editorAssociations, so Markdown associated with the preview or another Markdown editor still opened as text (#10, #53), and an image in Notes failed to open at all (#70).Changes
vscode.open), from the tree and from List Notes, with the editor VS Code associates with their file type. A newly created note still opens as text, ready to type in.resourceLangIdcontext the Explorer uses, so Markdown notes have their own context value,markdownNote, and every note menu entry now matches bothnoteandmarkdownNote.src/languages.ts, read once and again when extensions change, and are shared by new notes (feat(notes): keep an extension typed with a new note's name #96) and the tree.What I checked first
A probe extension in VS Code 1.140 opened the same files each way and read the editor kind from the tab API:
showTextDocument(before)vscode.open(now)"*.md": "vscode.markdown.preview.editor"A path-limited association (
"**/my-notes/**/*.md") opened notes in the preview and left a projectREADME.mdas text.Testing
npm test: 30 passing.End to end in VS Code 1.140 on macOS:
.txtnoteRename, Delete, Move To and Reveal from the right-click menu, Move To into a subfolder, an open note following a move, dragging a note to the editor, New Note/New Folder with a note selected, and List Notes were re-run with the same results.
Refs #10, #53, #70. Not closing them here: #10 asks for clicking a note to open its preview, which now works through
workbench.editorAssociationsbut has no Notes setting yet, and #70 also covers PDFs, which need a PDF viewer extension.