-
Notifications
You must be signed in to change notification settings - Fork 97
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
fix(vscode-plugin): ignore non-existent ".git" files, support untitled/unsaved files on VS Code #927
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing this issue! LGTM, just a few nitpicks.
Just to note, if this is merged, we may also want to close #382 as not planned or won't fix since this would stop the VS Code extension from sending untitled files to |
Done! Thank you. |
@mcecode Decided to add the |
@kiding, does that mean unsaved documents (i.e. blank buffers that aren't on-disk) will now work for text editors other than VS Code? |
Only if they support the same URI scheme that VS Code uses which is "untitled". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @kiding!
Issues
Fixes #487. Fixes #382.
Description
This PR restricts
clientOptions.documentSelector
to thefile
anduntitled
scheme, and changesload_file_dictionary
to always succeed on theuntitled
scheme. This will prevent the non-existent.git
files from showing up in Problems since they usegitfs
scheme1, and make Harper work on untitled/unsaved files.HarperAddToFileDict
should fail as expected.VS Code's documentation2 suggests there may be other schemes like
untitled
,http
,ftp
, etc. Harper never worked withuntitled
with an error sayingERROR harper_ls::backend: Unable to generate the file dictionary.
Harper'sfile_dict_name
assumesurl
is a file path, so this shouldn't break any preexisting feature.Demo
N/A
How Has This Been Tested?
To test for
untitled
: open a new document, typeErrorz
, check Output, seeno error.one error sayingDid you mean to spell “Errorz” this way?
.To test for
.git
:Check Problems, see no error for
test.txt.git
.Checklist
Footnotes
https://github.com/microsoft/vscode/pull/86674 ↩
https://code.visualstudio.com/api/references/document-selector ↩