make drive comparison case-insensitive.
This commit is contained in:
parent
6cbd8a4a4b
commit
1d9b585c62
1 changed files with 10 additions and 1 deletions
|
@ -10,10 +10,19 @@ export interface PublishDecorationsParams {
|
|||
|
||||
export function handle(params: PublishDecorationsParams) {
|
||||
const targetEditor = vscode.window.visibleTextEditors.find(
|
||||
editor => editor.document.uri.toString() === params.uri,
|
||||
editor => {
|
||||
const unescapedUri = unescape(editor.document.uri.toString());
|
||||
// Unescaped URI should be something like:
|
||||
// file:///c:/Workspace/ra-test/src/main.rs
|
||||
// RA server might send it with the drive letter uppercased, so we force only the drive letter to lowercase.
|
||||
const uriWithLowercasedDrive = params.uri.substr(0, 8) + params.uri[8].toLowerCase() + params.uri.substr(9);
|
||||
return unescapedUri === uriWithLowercasedDrive
|
||||
}
|
||||
);
|
||||
|
||||
if (!Server.config.highlightingOn || !targetEditor) {
|
||||
return;
|
||||
}
|
||||
|
||||
Server.highlighter.setHighlights(targetEditor, params.decorations);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue