rust/editors/code
bors[bot] 4e24b25c66
Merge #2565
2565: Fixed syntax highlighting not refreshing on windows. r=matklad a=omerbenamram

I was encoutering the same probelm described in #1690.

It seems that events initiated by the frontend with `rust-analyzer/decorationsRequest` would go through.
So whenever a user switches tabs, highlighting will update.

However, when decorations are initiated by a notification with `rust-analyzer/publishDecorations`, it would fail on this check here 6cbd8a4a4b/editors/code/src/notifications/publish_decorations.ts (L15) (`targetEditor` will always be `undefined`).

This is because it's trying to match the uri `rust-analyzer` sends (which uses an uppercase drive letter) to the uri provided at `editor.document.uri.toString()`, which is both escaped (uses `%3a` for `:`), and uses a lowercase letter drive.

Aparrently this was an issue for some other extensions aswell - https://github.com/Microsoft/vscode/issues/68325.

But this is the defined behavior - c110d84460/src/vs/vscode.d.ts (L1304)

This fix is only relevant for windows.
I've opted for a server-side fix, since rust will always return uppercase letters for drives, there seems to be no other easy solution than manipulating the Url string before sending it to the frontend.


Closes #1690.

Co-authored-by: Omer Ben-Amram <omerbenamram@gmail.com>
2019-12-15 16:35:23 +00:00
..
.vscode Initial Visual Studio Code unit tests 2019-06-26 20:31:36 +10:00
src npm run fix 2019-12-15 17:10:39 +02:00
.gitignore add rollup bundler for vscode extension 2019-09-23 23:25:16 +02:00
.prettierignore Run VS Code tests on CI 2019-06-30 07:12:42 +10:00
.vscodeignore add rollup bundler for vscode extension 2019-09-23 23:25:16 +02:00
package-lock.json Add rollup sourcemap and fix launch.json 2019-12-09 03:58:43 +08:00
package.json Properly format json 2019-12-15 17:19:41 +01:00
rollup.config.js Add rollup sourcemap and fix launch.json 2019-12-09 03:58:43 +08:00
tsconfig.json Enable noFallthroughCasesInSwitch option for vscode extension 2019-12-12 01:11:53 +09:00
tslint.json Enable noUnusedParameters option for vscode extension 2019-12-12 00:56:29 +09:00