3203: vscode: press ; to respect semicolons r=matklad a=Veetaha



Co-authored-by: Veetaha <gerzoh1@gmail.com>
This commit is contained in:
bors[bot] 2020-02-17 20:24:13 +00:00 committed by GitHub
commit 326556b090
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 17 additions and 17 deletions

View file

@ -16,7 +16,7 @@ export * from './ssr';
export function collectGarbage(ctx: Ctx): Cmd {
return async () => {
ctx.client?.sendRequest<null>('rust-analyzer/collectGarbage', null);
await ctx.client?.sendRequest<null>('rust-analyzer/collectGarbage', null);
};
}

View file

@ -14,9 +14,9 @@ export function ssr(ctx: Ctx): Cmd {
if (x.includes('==>>')) {
return null;
}
return "Enter request: pattern ==>> template"
return "Enter request: pattern ==>> template";
}
}
};
const request = await vscode.window.showInputBox(options);
if (!request) return;

View file

@ -29,7 +29,7 @@ export function activateHighlighting(ctx: Ctx) {
highlighter.setHighlights(targetEditor, params.decorations);
},
);
};
}
vscode.workspace.onDidChangeConfiguration(
_ => highlighter.removeHighlights(),

View file

@ -29,13 +29,13 @@ export function activateInlayHints(ctx: Ctx) {
ctx.pushCleanup({
dispose() {
hintsUpdater.clear()
hintsUpdater.clear();
}
})
});
// XXX: we don't await this, thus Promise rejections won't be handled, but
// this should never throw in fact...
hintsUpdater.setEnabled(ctx.config.displayInlayHints)
void hintsUpdater.setEnabled(ctx.config.displayInlayHints);
}
interface InlayHintsParams {
@ -57,7 +57,7 @@ const typeHintDecorationType = vscode.window.createTextEditorDecorationType({
const parameterHintDecorationType = vscode.window.createTextEditorDecorationType({
before: {
color: new vscode.ThemeColor('rust_analyzer.inlayHint'),
}
},
});
class HintsUpdater {

View file

@ -15,7 +15,7 @@ import { throttle } from "throttle-debounce";
* of the artifact as `displayName`.
*/
export async function downloadArtifact(
{downloadUrl, releaseName}: ArtifactReleaseInfo,
{ downloadUrl, releaseName }: ArtifactReleaseInfo,
artifactFileName: string,
installationDir: string,
displayName: string,
@ -23,7 +23,7 @@ export async function downloadArtifact(
await fs.mkdir(installationDir).catch(err => assert.strictEqual(
err?.code,
"EEXIST",
`Couldn't create directory "${installationDir}" to download `+
`Couldn't create directory "${installationDir}" to download ` +
`${artifactFileName} artifact: ${err.message}`
));

View file

@ -11,7 +11,7 @@ import { Config } from './config';
let ctx: Ctx | undefined;
export async function activate(context: vscode.ExtensionContext) {
const config = new Config(context)
const config = new Config(context);
const serverPath = await ensureServerBinary(config.serverSource);
if (serverPath == null) {
@ -33,7 +33,7 @@ export async function activate(context: vscode.ExtensionContext) {
vscode.window.showInformationMessage('Reloading rust-analyzer...');
// @DanTup maneuver
// https://github.com/microsoft/vscode/issues/45774#issuecomment-373423895
await deactivate()
await deactivate();
for (const sub of ctx.subscriptions) {
try {
sub.dispose();
@ -41,9 +41,9 @@ export async function activate(context: vscode.ExtensionContext) {
console.error(e);
}
}
await activate(context)
}
})
await activate(context);
};
});
ctx.registerCommand('analyzerStatus', commands.analyzerStatus);
ctx.registerCommand('collectGarbage', commands.collectGarbage);
@ -54,7 +54,7 @@ export async function activate(context: vscode.ExtensionContext) {
ctx.registerCommand('expandMacro', commands.expandMacro);
ctx.registerCommand('run', commands.run);
ctx.registerCommand('onEnter', commands.onEnter);
ctx.registerCommand('ssr', commands.ssr)
ctx.registerCommand('ssr', commands.ssr);
// Internal commands which are invoked by the server.
ctx.registerCommand('runSingle', commands.runSingle);

View file

@ -15,7 +15,7 @@ export function activateStatusDisplay(ctx: Ctx) {
WorkDoneProgress.type,
'rustAnalyzer/cargoWatcher',
params => statusDisplay.handleProgressNotification(params)
))
));
}
}