mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
fix errors
This commit is contained in:
parent
3a0234d60f
commit
2f82a84d2a
4 changed files with 11 additions and 6 deletions
|
@ -87,12 +87,14 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise<v
|
|||
if (ctx.config.debug.openDebugPane) {
|
||||
debugOutput.show(true);
|
||||
}
|
||||
|
||||
const isMultiFolderWorkspace = vscode.workspace.workspaceFolders.length > 1;
|
||||
const firstWorkspace = vscode.workspace.workspaceFolders[0]; // folder exists or RA is not active.
|
||||
// folder exists or RA is not active.
|
||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||
const workspaceFolders = vscode.workspace.workspaceFolders!;
|
||||
const isMultiFolderWorkspace = workspaceFolders.length > 1;
|
||||
const firstWorkspace = workspaceFolders[0];
|
||||
const workspace = !isMultiFolderWorkspace || !runnable.args.workspaceRoot ?
|
||||
firstWorkspace :
|
||||
vscode.workspace.workspaceFolders.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace;
|
||||
workspaceFolders.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace;
|
||||
|
||||
const wsFolder = path.normalize(workspace.uri.fsPath);
|
||||
const workspaceQualifier = isMultiFolderWorkspace ? `:${workspace.name}` : '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue