Repository navigation
feat(notes): search notes with VS Code's search - #97
Merged
Merged
Conversation
There was no way to search inside notes (#17), and Find in Files only covers the workspace, while notes usually live outside it. - Notes: Search Notes opens VS Code's Search view limited to Workspace Notes and Notes - a search button in each section's title bar searches that section - Search in Folder in a folder's right-click menu searches that folder The folders are passed as files to include. VS Code searches folders named this way even outside the workspace, with no folder open, or when they are listed in .gitignore, so ignore files don't need turning off.
Closed
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.
There was no way to search inside notes (#17). VS Code's Find in Files only covers the workspace, and notes usually live outside it.
Changes
The folders go into "files to include", so everything Search offers works on notes: regex, match case, replace across notes, and results grouped per folder.
What I checked before building it
A probe extension ran
workbench.action.findInFilesin VS Code 1.140 with the notes folder asfilesToInclude. VS Code searched it when it was outside the workspace, when no folder was open, and when it was a.notesfolder listed in the project's.gitignore, so ignore files don't need turning off (doing that adds an "exclude settings and ignore files are disabled" notice). Two folders separated by a comma were searched together.Testing
npm test: 29 passing (no new unit tests; the change is command wiring around VS Code's search).End to end in VS Code 1.140 on macOS, searching for a word that is in three notes and in a project file:
.notes,my-notesproject.md,animals.md,more.mdmy-notesanimals.md,more.md.notesproject.mdsubmy-notes/submore.mdmy-notesanimals.md,more.mdThe project file with the same word was never in the results.
Not handled: a notes path that contains a comma, braces or brackets would be read as part of a pattern by VS Code's include field. Not tested on Windows or Linux.
Closes #17.