mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
Send detached files info to server via init params
This commit is contained in:
parent
d9a5490646
commit
b3383b0661
3 changed files with 27 additions and 6 deletions
|
@ -49,7 +49,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
|
|||
if (workspaceFolder === undefined) {
|
||||
let rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document));
|
||||
if (rustDocuments.length > 0) {
|
||||
ctx = await Ctx.create(config, context, serverPath);
|
||||
ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached files', files: rustDocuments });
|
||||
} else {
|
||||
throw new Error("no rust files are opened");
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ async function tryActivate(context: vscode.ExtensionContext) {
|
|||
// registers its `onDidChangeDocument` handler before us.
|
||||
//
|
||||
// This a horribly, horribly wrong way to deal with this problem.
|
||||
ctx = await Ctx.create(config, context, serverPath, workspaceFolder.uri.fsPath);
|
||||
ctx = await Ctx.create(config, context, serverPath, { kind: "Workspace Folder", folder: workspaceFolder.uri });
|
||||
ctx.pushCleanup(activateTaskProvider(workspaceFolder, ctx.config));
|
||||
}
|
||||
await initCommonContext(context, ctx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue