From 1d9b585c62dc92889380c9ae130d15ce7f9b08d4 Mon Sep 17 00:00:00 2001 From: Omer Ben-Amram Date: Sun, 15 Dec 2019 15:07:33 +0200 Subject: make drive comparison case-insensitive. --- editors/code/src/notifications/publish_decorations.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/code/src/notifications/publish_decorations.ts b/editors/code/src/notifications/publish_decorations.ts index 00ffb7776..120eabbc6 100644 --- a/editors/code/src/notifications/publish_decorations.ts +++ b/editors/code/src/notifications/publish_decorations.ts @@ -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); } -- cgit v1.2.3