-
Notifications
You must be signed in to change notification settings - Fork 44
Hide diagnostics from virtual documents #832
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
Conversation
apps/vscode/package.json
Outdated
| "quarto.vdoc.hideDiagnostics": { | ||
| "order": 26, | ||
| "scope": "window", | ||
| "type": "boolean", | ||
| "default": true, | ||
| "markdownDescription": "Hide diagnostics (problems) reported for internal virtual document files. These are temporary files used to provide language features in code blocks." | ||
| }, |
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.
I don't think I see any reason to have this option
In the long term I'd actually like if Quarto didn't generate virtual docs at all, which would render this option kind of useless anyways!
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.
That's a great point! If we're trying to deal with problems in this area, then we're just using a dev build anyway.
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.
Apologies for reviving a closed PR conversation, but @DavisVaughan do you have something in mind for replacing virtual docs?
apps/vscode/src/vdoc/vdoc.ts
Outdated
| export function isVirtualDoc(uri: Uri): boolean { | ||
| // Check for tempfile virtual docs | ||
| if (uri.scheme === "file") { | ||
| const filename = path.basename(uri.fsPath); | ||
| // Virtual docs have a specific filename pattern .vdoc.[uuid].[extension] | ||
| return filename.startsWith(".vdoc.") && filename.split(".").length > 3; | ||
| } | ||
|
|
||
| return false; | ||
| } |
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.
Would you mind placing this alongside generateVirtualDocFilepath()? That is where we actually generate the file path, so that would help us keep these in sync
Addresses #819, which has been quite a bear in real work! Many, many diagnostics from our
vdocfiles, every time you save a file with a syntax error in it. 😱It turns out the
Middlewarefrom "vscode-languageclient" already has a way to doHandleDiagnosticsSignature, so this was fairly straightforward.I will get started on using Claude to write an extension test for this.