From b32528659a64f74da4b652c44b9fb47844899809 Mon Sep 17 00:00:00 2001 From: Urban Dove Date: Sat, 25 Jul 2020 22:16:35 -0400 Subject: try select correct workspace in vscode multi workspace --- editors/code/src/debug.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'editors') diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts index bd92c5b6d..1427ecf9a 100644 --- a/editors/code/src/debug.ts +++ b/editors/code/src/debug.ts @@ -87,9 +87,18 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise 1; + const firstWorkspace = vscode.workspace.workspaceFolders![0]; // folder exists or RA is not active. + const workspace = !isMultiFolderWorkspace || !runnable.args.workspaceRoot ? + firstWorkspace : + vscode.workspace.workspaceFolders!.find(w => runnable.args.workspaceRoot?.includes(w.uri.fsPath)) || firstWorkspace; + + const wsFolder = path.normalize(workspace.uri.fsPath); + const workspaceQualifier = isMultiFolderWorkspace ? `:${workspace.name}` : ''; function simplifyPath(p: string): string { - return path.normalize(p).replace(wsFolder, '${workspaceRoot}'); + // see https://github.com/rust-analyzer/rust-analyzer/pull/5513#issuecomment-663458818 for why this is needed + return path.normalize(p).replace(wsFolder, '${workspaceFolder' + workspaceQualifier + '}'); } const executable = await getDebugExecutable(runnable); -- cgit v1.2.3 From a85e64770d13598103c9122c6514ec3d5a3b0d53 Mon Sep 17 00:00:00 2001 From: Urban Dove Date: Sun, 26 Jul 2020 13:42:17 -0400 Subject: delete empty line --- editors/code/src/debug.ts | 1 - 1 file changed, 1 deletion(-) (limited to 'editors') diff --git a/editors/code/src/debug.ts b/editors/code/src/debug.ts index 1427ecf9a..925126a16 100644 --- a/editors/code/src/debug.ts +++ b/editors/code/src/debug.ts @@ -87,7 +87,6 @@ async function getDebugConfiguration(ctx: Ctx, runnable: ra.Runnable): Promise 1; const firstWorkspace = vscode.workspace.workspaceFolders![0]; // folder exists or RA is not active. const workspace = !isMultiFolderWorkspace || !runnable.args.workspaceRoot ? -- cgit v1.2.3 From cf55806257776baf7db6b02d260bdaa9e851c7d4 Mon Sep 17 00:00:00 2001 From: David Lattimore Date: Wed, 29 Jul 2020 11:44:01 +1000 Subject: SSR: Restrict to current selection if any The selection is also used to avoid unnecessary work, but only to the file level. Further restricting unnecessary work is left for later. --- editors/code/src/commands.ts | 5 +++-- editors/code/src/lsp_ext.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'editors') diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index c21e5597c..d0faf4745 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -190,6 +190,7 @@ export function ssr(ctx: Ctx): Cmd { if (!editor || !client) return; const position = editor.selection.active; + const selections = editor.selections; const textDocument = { uri: editor.document.uri.toString() }; const options: vscode.InputBoxOptions = { @@ -198,7 +199,7 @@ export function ssr(ctx: Ctx): Cmd { validateInput: async (x: string) => { try { await client.sendRequest(ra.ssr, { - query: x, parseOnly: true, textDocument, position, + query: x, parseOnly: true, textDocument, position, selections, }); } catch (e) { return e.toString(); @@ -215,7 +216,7 @@ export function ssr(ctx: Ctx): Cmd { cancellable: false, }, async (_progress, _token) => { const edit = await client.sendRequest(ra.ssr, { - query: request, parseOnly: false, textDocument, position + query: request, parseOnly: false, textDocument, position, selections, }); await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit)); diff --git a/editors/code/src/lsp_ext.ts b/editors/code/src/lsp_ext.ts index 149f9a0d6..494d51c83 100644 --- a/editors/code/src/lsp_ext.ts +++ b/editors/code/src/lsp_ext.ts @@ -95,6 +95,7 @@ export interface SsrParams { parseOnly: boolean; textDocument: lc.TextDocumentIdentifier; position: lc.Position; + selections: lc.Range[]; } export const ssr = new lc.RequestType('experimental/ssr'); -- cgit v1.2.3 From 8d9f8ac2739e7d02bcbc69e933682c2ef305f987 Mon Sep 17 00:00:00 2001 From: Clemens Wasser Date: Thu, 30 Jul 2020 16:04:01 +0200 Subject: flycheck: Added checkOnSave.noDefaultFeatures This commit adds the option `rust-analyzer.checkOnSave.noDefaultFeatures` and fixes #5550. --- editors/code/package.json | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 658c913fd..1adf055d0 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -323,6 +323,14 @@ "default": true, "markdownDescription": "Check all targets and tests (will be passed as `--all-targets`)" }, + "rust-analyzer.checkOnSave.noDefaultFeatures": { + "type": [ + "null", + "boolean" + ], + "default": null, + "markdownDescription": "Do not activate the `default` feature" + }, "rust-analyzer.checkOnSave.allFeatures": { "type": [ "null", -- cgit v1.2.3 From c04b2e39dacfea5c6ba158d842fb3b7f3e0db12b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Herrmann?= Date: Sat, 8 Aug 2020 11:57:54 +0200 Subject: Fix typo in settings description Remove a duplicate word from the description of the `warningsAsHint` setting. --- editors/code/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'editors') diff --git a/editors/code/package.json b/editors/code/package.json index 1adf055d0..ee5f96bf3 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -607,7 +607,7 @@ "items": { "type": "string" }, - "description": "List of warnings warnings that should be displayed with hint severity.\nThe warnings will be indicated by faded text or three dots in code and will not show up in the problems panel.", + "description": "List of warnings that should be displayed with hint severity.\nThe warnings will be indicated by faded text or three dots in code and will not show up in the problems panel.", "default": [] } } -- cgit v1.2.3