Closed bpasero closed 4 years ago
@bpasero With markers you mean TextEditor.setDecorations()
in the extension API?
Edit: More likely vscode.languages.createDiagnosticCollection()
.
Yeah, the API is using the diagnostic collection. Something like this is what I have
const diag = vscode.languages.createDiagnosticCollection('muhaha');
for (let path of [
'/Users/jrieken/Code/_samples/devfest/foo/TEST.less',
'/Users/jrieken/Code/_samples/devfest/foo/TEST.ts'
]) {
const uri = vscode.Uri.file(path);
const d = new vscode.Diagnostic(new vscode.Range(0, 0, 1, 0), 'casing matters', vscode.DiagnosticSeverity.Information);
diag.set(uri, [d])
}
Thanks. Also found a nice sample: https://github.com/microsoft/vscode-extension-samples/tree/master/diagnostic-related-information-sample
https://github.com/microsoft/vscode/issues/93368
Complexity: 4 Authors: @jrieken @bpasero
Create Issue
Canonical URIs respect the file system providers case-sensitivity capability. Given a file system that is case-insensitive (e.g. macOS, Windows in most cases), the first creator of a canonical URI defines its casing and subsequent URIs of different casing will have the same canonical form.
The following is an example where canonical URIs help a lot:
path/someFile.c
from the explorerpath/somefile.c
path/somefile.c
even though the user already had the file opened with different casingWith canonical URIs, the user defined the canonical URI to be
path/someFile.c
when opening it. Even though the output is usingpath/somefile.c
form, the markers are being created with thepath/someFile.c
path and thus match. You will only end up with a single editor opening, not two.Canonical URIs have been adopted in the following places:
vscode.workspace.openTextDocument
)Test
vscode.workspace.openTextDocument
API and ensure that only on Linux you get different models for different casing