Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rust-lang/rust-analyzer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: e289a24f56f0b271998a76590faa2ad4b31c60c8
Choose a base ref
..
head repository: rust-lang/rust-analyzer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0421756b4256b8edf739b5889e754d7bc733ed38
Choose a head ref
Showing with 4 additions and 6 deletions.
  1. +4 −6 editors/code/src/client.ts
10 changes: 4 additions & 6 deletions editors/code/src/client.ts
Original file line number Diff line number Diff line change
@@ -61,14 +61,13 @@ function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownStri
result.isTrusted = true;
return result;
}
let x = 0;

export async function createClient(
traceOutputChannel: vscode.OutputChannel,
outputChannel: vscode.OutputChannel,
initializationOptions: vscode.WorkspaceConfiguration,
serverOptions: lc.ServerOptions
): Promise<lc.LanguageClient> {
const X = x++;
const clientOptions: lc.LanguageClientOptions = {
documentSelector: [{ scheme: "file", language: "rust" }],
initializationOptions,
@@ -77,12 +76,11 @@ export async function createClient(
outputChannel,
middleware: {
workspace: {
// HACK: This is a workaround, when the client has been disposed, VSCode
// continues to emit events to the client and the default one for this event
// attempt to restart the client for no reason
async didChangeWatchedFile(event, next) {
console.log(X);
console.log(client);
if (client.isRunning()) {
// HACK: This is a workaround, when the client has been disposed, VSCode
// continues to emit this event to the client...
await next(event);
}
},