From a0c07d98cf65aed7cb59e4eebaa5f80f7a983774 Mon Sep 17 00:00:00 2001 From: Nate Sesti Date: Mon, 8 Jan 2024 12:56:48 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=84=20more=20prominent=20tooltip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/settings.json | 1 - extensions/vscode/src/activation/inlineTips.ts | 11 +++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 35a3af25f..37b52608c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,7 +3,6 @@ "rust-analyzer.linkedProjects": ["./server/Cargo.toml"], "python.analysis.extraPaths": [], "python.autoComplete.extraPaths": [], - "continue.showInlineTip": false, "python.testing.pytestArgs": ["server"], "python.testing.unittestEnabled": false, "python.testing.pytestEnabled": true diff --git a/extensions/vscode/src/activation/inlineTips.ts b/extensions/vscode/src/activation/inlineTips.ts index 4137a55d7..e22045f52 100644 --- a/extensions/vscode/src/activation/inlineTips.ts +++ b/extensions/vscode/src/activation/inlineTips.ts @@ -4,8 +4,9 @@ import { getMetaKeyLabel } from "../util/util"; const inlineTipDecoration = vscode.window.createTextEditorDecorationType({ after: { contentText: `${getMetaKeyLabel()} M to select code, ${getMetaKeyLabel()} ⇧ L to edit`, - color: "#c0c0c060", + color: "#888", margin: "0 0 0 6em", + fontWeight: "bold", }, }); @@ -22,9 +23,7 @@ function handleSelectionChange(e: vscode.TextEditorSelectionChangeEvent) { return; } - const startLine = selection.start.line; - - let lineToShow = startLine > 0 ? startLine - 1 : startLine + 1; + const anchorLine = selection.anchor.line; const hoverMarkdown = new vscode.MarkdownString( `Use ${getMetaKeyLabel()} M to select code, or ${getMetaKeyLabel()} ⇧ L to edit highlighted code. Click [here](command:continue.hideInlineTip) if you don't want to see these inline suggestions.` @@ -34,8 +33,8 @@ function handleSelectionChange(e: vscode.TextEditorSelectionChangeEvent) { editor.setDecorations(inlineTipDecoration, [ { range: new vscode.Range( - new vscode.Position(lineToShow, Number.MAX_VALUE), - new vscode.Position(lineToShow, Number.MAX_VALUE) + new vscode.Position(anchorLine, Number.MAX_VALUE), + new vscode.Position(anchorLine, Number.MAX_VALUE) ), hoverMessage: [hoverMarkdown], },