mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +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
|
@ -7,6 +7,16 @@ import { createClient } from './client';
|
|||
import { isRustEditor, RustEditor } from './util';
|
||||
import { ServerStatusParams } from './lsp_ext';
|
||||
|
||||
export type Workspace =
|
||||
{
|
||||
kind: 'Workspace Folder',
|
||||
folder: vscode.Uri,
|
||||
}
|
||||
| {
|
||||
kind: 'Detached files',
|
||||
files: vscode.TextDocument[],
|
||||
};
|
||||
|
||||
export class Ctx {
|
||||
private constructor(
|
||||
readonly config: Config,
|
||||
|
@ -22,9 +32,9 @@ export class Ctx {
|
|||
config: Config,
|
||||
extCtx: vscode.ExtensionContext,
|
||||
serverPath: string,
|
||||
cwd?: string,
|
||||
workspace: Workspace,
|
||||
): Promise<Ctx> {
|
||||
const client = createClient(serverPath, cwd, config.serverExtraEnv);
|
||||
const client = createClient(serverPath, workspace, config.serverExtraEnv);
|
||||
|
||||
const statusBar = vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left);
|
||||
extCtx.subscriptions.push(statusBar);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue