mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Merge commit 'ddf105b646
' into sync-from-ra
This commit is contained in:
parent
0816d49d83
commit
e41ab350d6
378 changed files with 14720 additions and 3111 deletions
|
@ -803,6 +803,11 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"rust-analyzer.check.workspace": {
|
||||
"markdownDescription": "Whether `--workspace` should be passed to `cargo check`.\nIf false, `-p <package>` will be passed instead.",
|
||||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.completion.autoimport.enable": {
|
||||
"markdownDescription": "Toggles the additional completions that automatically add imports when completed.\nNote that your client must specify the `additionalTextEdits` LSP client capability to truly have this feature enabled.",
|
||||
"default": true,
|
||||
|
@ -1468,6 +1473,11 @@
|
|||
"default": true,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.notifications.unindexedProject": {
|
||||
"markdownDescription": "Whether to send an UnindexedProject notification to the client.",
|
||||
"default": false,
|
||||
"type": "boolean"
|
||||
},
|
||||
"rust-analyzer.numThreads": {
|
||||
"markdownDescription": "How many worker threads in the main loop. The default `null` means to pick automatically.",
|
||||
"default": null,
|
||||
|
|
|
@ -234,6 +234,23 @@ export class Ctx implements RustAnalyzerExtensionApi {
|
|||
this.outputChannel!.show();
|
||||
}),
|
||||
);
|
||||
this.pushClientCleanup(
|
||||
this._client.onNotification(ra.unindexedProject, async (params) => {
|
||||
if (this.config.discoverProjectRunner) {
|
||||
const command = `${this.config.discoverProjectRunner}.discoverWorkspaceCommand`;
|
||||
log.info(`running command: ${command}`);
|
||||
const uris = params.textDocuments.map((doc) =>
|
||||
vscode.Uri.parse(doc.uri, true),
|
||||
);
|
||||
const projects: JsonProject[] = await vscode.commands.executeCommand(
|
||||
command,
|
||||
uris,
|
||||
);
|
||||
this.setWorkspaces(projects);
|
||||
await this.notifyRustAnalyzer();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
return this._client;
|
||||
}
|
||||
|
|
|
@ -220,3 +220,9 @@ export type RecursiveMemoryLayoutNode = {
|
|||
export type RecursiveMemoryLayout = {
|
||||
nodes: RecursiveMemoryLayoutNode[];
|
||||
};
|
||||
|
||||
export const unindexedProject = new lc.NotificationType<UnindexedProjectParams>(
|
||||
"rust-analyzer/unindexedProject",
|
||||
);
|
||||
|
||||
export type UnindexedProjectParams = { textDocuments: lc.TextDocumentIdentifier[] };
|
||||
|
|
|
@ -207,7 +207,7 @@ function checkConflictingExtensions() {
|
|||
if (vscode.extensions.getExtension("panicbit.cargo")) {
|
||||
vscode.window
|
||||
.showWarningMessage(
|
||||
`You have both the rust-analyzer (rust-lang.rust-analyzer) and Cargo (panicbit.cargo) plugins enabled` +
|
||||
`You have both the rust-analyzer (rust-lang.rust-analyzer) and Cargo (panicbit.cargo) plugins enabled, ` +
|
||||
'you can disable it or set {"cargo.automaticCheck": false} in settings.json to avoid invoking cargo twice',
|
||||
"Got it",
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue