Auto merge of #13686 - MariaSolOs:test-lenses, r=Veykril

Don't show runnable code lenses in libraries outside of the workspace

Addresses #13664. For now I'm just disabling runnable code lenses since the ones that display the number of references and implementations do work correctly with external code.

Also made a tiny TypeScript change to use the typed `sendNotification` overload.
This commit is contained in:
bors 2022-11-29 07:42:35 +00:00
commit 3769cc35fa
2 changed files with 5 additions and 2 deletions

View file

@ -1164,7 +1164,10 @@ pub(crate) fn code_lens(
let r = runnable(snap, run)?;
let lens_config = snap.config.lens();
if lens_config.run && client_commands_config.run_single {
if lens_config.run
&& client_commands_config.run_single
&& r.args.workspace_root.is_some()
{
let command = command::run_single(&r, &title);
acc.push(lsp_types::CodeLens {
range: annotation_range,

View file

@ -79,7 +79,7 @@ async function activateServer(ctx: Ctx): Promise<RustAnalyzerExtensionApi> {
);
vscode.workspace.onDidChangeConfiguration(
async (_) => {
await ctx.client?.sendNotification("workspace/didChangeConfiguration", {
await ctx.client?.sendNotification(lc.DidChangeConfigurationNotification.type, {
settings: "",
});
},