Repository navigation
feat(notes): keep an extension typed with a new note's name - #96
Merged
Merged
Conversation
A new note always got the default extension, so `query.sql` became `query.sql.md` (#81). A typed extension is now kept when it is one a note can have: in notes.notesExtensions, or with `*` one VS Code has a language for. The `.07` of `Meeting 2026.10.07` isn't, so that name stays whole. Languages come from every installed extension, plus plain text, which VS Code registers itself. Only Markdown notes start with their name as a heading; a heading would make a new .json or .sql file invalid. Rename uses the same rule, which fixes two bugs with the default `*`: renaming `a.md` to `a.txt` failed with "already exists", since `*` was compared as an extension, and a name with dots lost its last part (`Meeting 2026.10.md`). A note without an extension no longer gets its whole name appended as one.
This was referenced Oct 7, 2026
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.
A new note always got the default extension, so
query.sqlbecamequery.sql.md, starting with a# query.sqlheading (#81).Changes
notes.notesExtensions, or, with the default*, one VS Code has a language for. That list comes from every installed extension's language contributions, plus plain text (.txt), which VS Code's core registers itself rather than an extension. The.07ofMeeting 2026.10.07isn't a language, so that name stays whole and gets the default extension.# planforplan.md). A heading would make a new.jsonor.sqlfile invalid. People whose default extension istxtnow get an empty file instead of a# Titleline.*:a.mdtoa.txtfailed with "'a.md' already exists", because*was compared as if it were an extension and the typed one was swapped backMeeting 2026.10.07becameMeeting 2026.10.mdREADME) had its whole name treated as its extension; it now renames as typedTesting
npm test: 29 passing, 3 new tests for splitting a typed name.End to end in VS Code 1.140 on macOS:
query.sqlquery.sql.mdwith# query.sqlquery.sql, emptydata.jsondata.json.mdwith# data.jsondata.json, emptylist.txtlist.txt.mdlist.txt, emptyplan.mdplan.md.mdplan.mdwith# planMeeting 2026.10.07Meeting 2026.10.07.mda.mdtoa.txta.txtMeeting 2026.10.08Meeting 2026.10.mdMeeting 2026.10.08.mdREADMEtoREADME2README2notesExtensions: md,txt, New Notequery.sqlquery.sql.md, so it shows in the treetxt, New Notetodotodo.txt, emptyThe master column for
query.sql,data.json,a.txtand the dotted rename comes from the same scenarios run against master;list.txtandplan.mdfollow from the same code path.New Note in both sections, the "where should it go" question, and New Note/New Folder with a note selected were re-run with the same results.
Closes #81.