aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-02-17 20:24:13 +0000
committerGitHub <[email protected]>2020-02-17 20:24:13 +0000
commit326556b09078a398e641dd221ab870ee0fe47f68 (patch)
treec57aa6800df7d6ba702c3256921b714a222a37d1 /editors/code/src
parent9053003e3b298b38f6029b860efc5baed1996385 (diff)
parent73799640481c269a5aad408c99a22592d914fb1b (diff)
Merge #3203
3203: vscode: press ; to respect semicolons r=matklad a=Veetaha Co-authored-by: Veetaha <[email protected]>
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/commands/index.ts2
-rw-r--r--editors/code/src/commands/ssr.ts4
-rw-r--r--editors/code/src/highlighting.ts2
-rw-r--r--editors/code/src/inlay_hints.ts8
-rw-r--r--editors/code/src/installation/download_artifact.ts4
-rw-r--r--editors/code/src/main.ts12
-rw-r--r--editors/code/src/status_display.ts2
7 files changed, 17 insertions, 17 deletions
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts
index d05f40d67..bebd99ca9 100644
--- a/editors/code/src/commands/index.ts
+++ b/editors/code/src/commands/index.ts
@@ -16,7 +16,7 @@ export * from './ssr';
16 16
17export function collectGarbage(ctx: Ctx): Cmd { 17export function collectGarbage(ctx: Ctx): Cmd {
18 return async () => { 18 return async () => {
19 ctx.client?.sendRequest<null>('rust-analyzer/collectGarbage', null); 19 await ctx.client?.sendRequest<null>('rust-analyzer/collectGarbage', null);
20 }; 20 };
21} 21}
22 22
diff --git a/editors/code/src/commands/ssr.ts b/editors/code/src/commands/ssr.ts
index 6287bf47b..9b814612a 100644
--- a/editors/code/src/commands/ssr.ts
+++ b/editors/code/src/commands/ssr.ts
@@ -14,9 +14,9 @@ export function ssr(ctx: Ctx): Cmd {
14 if (x.includes('==>>')) { 14 if (x.includes('==>>')) {
15 return null; 15 return null;
16 } 16 }
17 return "Enter request: pattern ==>> template" 17 return "Enter request: pattern ==>> template";
18 } 18 }
19 } 19 };
20 const request = await vscode.window.showInputBox(options); 20 const request = await vscode.window.showInputBox(options);
21 21
22 if (!request) return; 22 if (!request) return;
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index a2db04de8..c4d286aef 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -29,7 +29,7 @@ export function activateHighlighting(ctx: Ctx) {
29 highlighter.setHighlights(targetEditor, params.decorations); 29 highlighter.setHighlights(targetEditor, params.decorations);
30 }, 30 },
31 ); 31 );
32 }; 32 }
33 33
34 vscode.workspace.onDidChangeConfiguration( 34 vscode.workspace.onDidChangeConfiguration(
35 _ => highlighter.removeHighlights(), 35 _ => highlighter.removeHighlights(),
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts
index f82df66ae..26705067a 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -29,13 +29,13 @@ export function activateInlayHints(ctx: Ctx) {
29 29
30 ctx.pushCleanup({ 30 ctx.pushCleanup({
31 dispose() { 31 dispose() {
32 hintsUpdater.clear() 32 hintsUpdater.clear();
33 } 33 }
34 }) 34 });
35 35
36 // XXX: we don't await this, thus Promise rejections won't be handled, but 36 // XXX: we don't await this, thus Promise rejections won't be handled, but
37 // this should never throw in fact... 37 // this should never throw in fact...
38 hintsUpdater.setEnabled(ctx.config.displayInlayHints) 38 void hintsUpdater.setEnabled(ctx.config.displayInlayHints);
39} 39}
40 40
41interface InlayHintsParams { 41interface InlayHintsParams {
@@ -57,7 +57,7 @@ const typeHintDecorationType = vscode.window.createTextEditorDecorationType({
57const parameterHintDecorationType = vscode.window.createTextEditorDecorationType({ 57const parameterHintDecorationType = vscode.window.createTextEditorDecorationType({
58 before: { 58 before: {
59 color: new vscode.ThemeColor('rust_analyzer.inlayHint'), 59 color: new vscode.ThemeColor('rust_analyzer.inlayHint'),
60 } 60 },
61}); 61});
62 62
63class HintsUpdater { 63class HintsUpdater {
diff --git a/editors/code/src/installation/download_artifact.ts b/editors/code/src/installation/download_artifact.ts
index de655f8f4..9996c556f 100644
--- a/editors/code/src/installation/download_artifact.ts
+++ b/editors/code/src/installation/download_artifact.ts
@@ -15,7 +15,7 @@ import { throttle } from "throttle-debounce";
15 * of the artifact as `displayName`. 15 * of the artifact as `displayName`.
16 */ 16 */
17export async function downloadArtifact( 17export async function downloadArtifact(
18 {downloadUrl, releaseName}: ArtifactReleaseInfo, 18 { downloadUrl, releaseName }: ArtifactReleaseInfo,
19 artifactFileName: string, 19 artifactFileName: string,
20 installationDir: string, 20 installationDir: string,
21 displayName: string, 21 displayName: string,
@@ -23,7 +23,7 @@ export async function downloadArtifact(
23 await fs.mkdir(installationDir).catch(err => assert.strictEqual( 23 await fs.mkdir(installationDir).catch(err => assert.strictEqual(
24 err?.code, 24 err?.code,
25 "EEXIST", 25 "EEXIST",
26 `Couldn't create directory "${installationDir}" to download `+ 26 `Couldn't create directory "${installationDir}" to download ` +
27 `${artifactFileName} artifact: ${err.message}` 27 `${artifactFileName} artifact: ${err.message}`
28 )); 28 ));
29 29
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index 0ad7ef1bb..a22e0bc66 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -11,7 +11,7 @@ import { Config } from './config';
11let ctx: Ctx | undefined; 11let ctx: Ctx | undefined;
12 12
13export async function activate(context: vscode.ExtensionContext) { 13export async function activate(context: vscode.ExtensionContext) {
14 const config = new Config(context) 14 const config = new Config(context);
15 15
16 const serverPath = await ensureServerBinary(config.serverSource); 16 const serverPath = await ensureServerBinary(config.serverSource);
17 if (serverPath == null) { 17 if (serverPath == null) {
@@ -33,7 +33,7 @@ export async function activate(context: vscode.ExtensionContext) {
33 vscode.window.showInformationMessage('Reloading rust-analyzer...'); 33 vscode.window.showInformationMessage('Reloading rust-analyzer...');
34 // @DanTup maneuver 34 // @DanTup maneuver
35 // https://github.com/microsoft/vscode/issues/45774#issuecomment-373423895 35 // https://github.com/microsoft/vscode/issues/45774#issuecomment-373423895
36 await deactivate() 36 await deactivate();
37 for (const sub of ctx.subscriptions) { 37 for (const sub of ctx.subscriptions) {
38 try { 38 try {
39 sub.dispose(); 39 sub.dispose();
@@ -41,9 +41,9 @@ export async function activate(context: vscode.ExtensionContext) {
41 console.error(e); 41 console.error(e);
42 } 42 }
43 } 43 }
44 await activate(context) 44 await activate(context);
45 } 45 };
46 }) 46 });
47 47
48 ctx.registerCommand('analyzerStatus', commands.analyzerStatus); 48 ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
49 ctx.registerCommand('collectGarbage', commands.collectGarbage); 49 ctx.registerCommand('collectGarbage', commands.collectGarbage);
@@ -54,7 +54,7 @@ export async function activate(context: vscode.ExtensionContext) {
54 ctx.registerCommand('expandMacro', commands.expandMacro); 54 ctx.registerCommand('expandMacro', commands.expandMacro);
55 ctx.registerCommand('run', commands.run); 55 ctx.registerCommand('run', commands.run);
56 ctx.registerCommand('onEnter', commands.onEnter); 56 ctx.registerCommand('onEnter', commands.onEnter);
57 ctx.registerCommand('ssr', commands.ssr) 57 ctx.registerCommand('ssr', commands.ssr);
58 58
59 // Internal commands which are invoked by the server. 59 // Internal commands which are invoked by the server.
60 ctx.registerCommand('runSingle', commands.runSingle); 60 ctx.registerCommand('runSingle', commands.runSingle);
diff --git a/editors/code/src/status_display.ts b/editors/code/src/status_display.ts
index ed0d82166..0f5f6ef99 100644
--- a/editors/code/src/status_display.ts
+++ b/editors/code/src/status_display.ts
@@ -15,7 +15,7 @@ export function activateStatusDisplay(ctx: Ctx) {
15 WorkDoneProgress.type, 15 WorkDoneProgress.type,
16 'rustAnalyzer/cargoWatcher', 16 'rustAnalyzer/cargoWatcher',
17 params => statusDisplay.handleProgressNotification(params) 17 params => statusDisplay.handleProgressNotification(params)
18 )) 18 ));
19 } 19 }
20} 20}
21 21