diff options
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/commands/cargo_watch.ts | 6 | ||||
-rw-r--r-- | editors/code/src/config.ts | 13 | ||||
-rw-r--r-- | editors/code/src/highlighting.ts | 7 | ||||
-rw-r--r-- | editors/code/src/notifications/publish_decorations.ts | 11 |
4 files changed, 30 insertions, 7 deletions
diff --git a/editors/code/src/commands/cargo_watch.ts b/editors/code/src/commands/cargo_watch.ts index 512362eb1..748be535c 100644 --- a/editors/code/src/commands/cargo_watch.ts +++ b/editors/code/src/commands/cargo_watch.ts | |||
@@ -82,8 +82,10 @@ export class CargoWatchProvider implements vscode.Disposable { | |||
82 | } | 82 | } |
83 | 83 | ||
84 | let args = | 84 | let args = |
85 | Server.config.cargoWatchOptions.command + | 85 | Server.config.cargoWatchOptions.command + ' --message-format json'; |
86 | ' --all-targets --message-format json'; | 86 | if (Server.config.cargoWatchOptions.allTargets) { |
87 | args += ' --all-targets'; | ||
88 | } | ||
87 | if (Server.config.cargoWatchOptions.command.length > 0) { | 89 | if (Server.config.cargoWatchOptions.command.length > 0) { |
88 | // Excape the double quote string: | 90 | // Excape the double quote string: |
89 | args += ' ' + Server.config.cargoWatchOptions.arguments; | 91 | args += ' ' + Server.config.cargoWatchOptions.arguments; |
diff --git a/editors/code/src/config.ts b/editors/code/src/config.ts index defdfeb9c..e131f09df 100644 --- a/editors/code/src/config.ts +++ b/editors/code/src/config.ts | |||
@@ -13,6 +13,7 @@ export interface CargoWatchOptions { | |||
13 | command: string; | 13 | command: string; |
14 | trace: CargoWatchTraceOptions; | 14 | trace: CargoWatchTraceOptions; |
15 | ignore: string[]; | 15 | ignore: string[]; |
16 | allTargets: boolean; | ||
16 | } | 17 | } |
17 | 18 | ||
18 | export interface CargoFeatures { | 19 | export interface CargoFeatures { |
@@ -30,7 +31,7 @@ export class Config { | |||
30 | public displayInlayHints = true; | 31 | public displayInlayHints = true; |
31 | public maxInlayHintLength: null | number = null; | 32 | public maxInlayHintLength: null | number = null; |
32 | public excludeGlobs = []; | 33 | public excludeGlobs = []; |
33 | public useClientWatching = false; | 34 | public useClientWatching = true; |
34 | public featureFlags = {}; | 35 | public featureFlags = {}; |
35 | // for internal use | 36 | // for internal use |
36 | public withSysroot: null | boolean = null; | 37 | public withSysroot: null | boolean = null; |
@@ -40,6 +41,7 @@ export class Config { | |||
40 | arguments: '', | 41 | arguments: '', |
41 | command: '', | 42 | command: '', |
42 | ignore: [], | 43 | ignore: [], |
44 | allTargets: true, | ||
43 | }; | 45 | }; |
44 | public cargoFeatures: CargoFeatures = { | 46 | public cargoFeatures: CargoFeatures = { |
45 | noDefaultFeatures: false, | 47 | noDefaultFeatures: false, |
@@ -132,6 +134,13 @@ export class Config { | |||
132 | ); | 134 | ); |
133 | } | 135 | } |
134 | 136 | ||
137 | if (config.has('cargo-watch.allTargets')) { | ||
138 | this.cargoWatchOptions.allTargets = config.get<boolean>( | ||
139 | 'cargo-watch.allTargets', | ||
140 | true, | ||
141 | ); | ||
142 | } | ||
143 | |||
135 | if (config.has('lruCapacity')) { | 144 | if (config.has('lruCapacity')) { |
136 | this.lruCapacity = config.get('lruCapacity') as number; | 145 | this.lruCapacity = config.get('lruCapacity') as number; |
137 | } | 146 | } |
@@ -148,7 +157,7 @@ export class Config { | |||
148 | this.excludeGlobs = config.get('excludeGlobs') || []; | 157 | this.excludeGlobs = config.get('excludeGlobs') || []; |
149 | } | 158 | } |
150 | if (config.has('useClientWatching')) { | 159 | if (config.has('useClientWatching')) { |
151 | this.useClientWatching = config.get('useClientWatching') || false; | 160 | this.useClientWatching = config.get('useClientWatching') || true; |
152 | } | 161 | } |
153 | if (config.has('featureFlags')) { | 162 | if (config.has('featureFlags')) { |
154 | this.featureFlags = config.get('featureFlags') || {}; | 163 | this.featureFlags = config.get('featureFlags') || {}; |
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts index 6d50a2f2d..d7c0ae131 100644 --- a/editors/code/src/highlighting.ts +++ b/editors/code/src/highlighting.ts | |||
@@ -53,10 +53,17 @@ export class Highlighter { | |||
53 | decoration('parameter'), | 53 | decoration('parameter'), |
54 | decoration('constant'), | 54 | decoration('constant'), |
55 | decoration('type'), | 55 | decoration('type'), |
56 | decoration('type.self'), | ||
57 | decoration('type.generic'), | ||
58 | decoration('type.param'), | ||
59 | decoration('type.lifetime'), | ||
56 | decoration('builtin'), | 60 | decoration('builtin'), |
57 | decoration('text'), | 61 | decoration('text'), |
58 | decoration('attribute'), | 62 | decoration('attribute'), |
59 | decoration('literal'), | 63 | decoration('literal'), |
64 | decoration('literal.numeric'), | ||
65 | decoration('literal.char'), | ||
66 | decoration('literal.byte'), | ||
60 | decoration('macro'), | 67 | decoration('macro'), |
61 | decoration('variable'), | 68 | decoration('variable'), |
62 | decoration('variable.mut', 'underline'), | 69 | decoration('variable.mut', 'underline'), |
diff --git a/editors/code/src/notifications/publish_decorations.ts b/editors/code/src/notifications/publish_decorations.ts index 00ffb7776..f23e286ad 100644 --- a/editors/code/src/notifications/publish_decorations.ts +++ b/editors/code/src/notifications/publish_decorations.ts | |||
@@ -9,11 +9,16 @@ export interface PublishDecorationsParams { | |||
9 | } | 9 | } |
10 | 10 | ||
11 | export function handle(params: PublishDecorationsParams) { | 11 | export function handle(params: PublishDecorationsParams) { |
12 | const targetEditor = vscode.window.visibleTextEditors.find( | 12 | const targetEditor = vscode.window.visibleTextEditors.find(editor => { |
13 | editor => editor.document.uri.toString() === params.uri, | 13 | const unescapedUri = unescape(editor.document.uri.toString()); |
14 | ); | 14 | // Unescaped URI looks like: |
15 | // file:///c:/Workspace/ra-test/src/main.rs | ||
16 | return unescapedUri === params.uri; | ||
17 | }); | ||
18 | |||
15 | if (!Server.config.highlightingOn || !targetEditor) { | 19 | if (!Server.config.highlightingOn || !targetEditor) { |
16 | return; | 20 | return; |
17 | } | 21 | } |
22 | |||
18 | Server.highlighter.setHighlights(targetEditor, params.decorations); | 23 | Server.highlighter.setHighlights(targetEditor, params.decorations); |
19 | } | 24 | } |