aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-10-15 11:50:26 +0100
committerGitHub <[email protected]>2020-10-15 11:50:26 +0100
commit7dd09a7b34d7c9cc2739a1106b3e383b7d9044ff (patch)
treeb6dc85cec3ffb066ef61f4fbe26f8a5353a29835
parentba6679dc6ce7065d349ac4d93ab86826b13e15a5 (diff)
parent010d123f23e0b3766b0501a5ad9dbdb47fee7ada (diff)
Merge #6236
6236: Code: Insert a ZWNJ before `after` type hints r=matklad a=lnicola to prevent the editor from displaying a ligature there. Fixes #6235 Co-authored-by: LaurenČ›iu Nicola <[email protected]>
-rw-r--r--editors/code/src/inlay_hints.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/editors/code/src/inlay_hints.ts b/editors/code/src/inlay_hints.ts
index 30ade9b98..ed0db2924 100644
--- a/editors/code/src/inlay_hints.ts
+++ b/editors/code/src/inlay_hints.ts
@@ -44,10 +44,12 @@ const paramHints = createHintStyle("parameter");
44const chainingHints = createHintStyle("chaining"); 44const chainingHints = createHintStyle("chaining");
45 45
46function createHintStyle(hintKind: "type" | "parameter" | "chaining") { 46function createHintStyle(hintKind: "type" | "parameter" | "chaining") {
47 // U+200C is a zero-width non-joiner to prevent the editor from forming a ligature
48 // between code and type hints
47 const [pos, render] = ({ 49 const [pos, render] = ({
48 type: ["after", (label: string) => `: ${label}`], 50 type: ["after", (label: string) => `\u{200c}: ${label}`],
49 parameter: ["before", (label: string) => `${label}: `], 51 parameter: ["before", (label: string) => `${label}: `],
50 chaining: ["after", (label: string) => `: ${label}`], 52 chaining: ["after", (label: string) => `\u{200c}: ${label}`],
51 } as const)[hintKind]; 53 } as const)[hintKind];
52 54
53 const fg = new vscode.ThemeColor(`rust_analyzer.inlayHints.foreground.${hintKind}Hints`); 55 const fg = new vscode.ThemeColor(`rust_analyzer.inlayHints.foreground.${hintKind}Hints`);