diff options
author | Seivan Heidari <[email protected]> | 2019-11-21 00:11:41 +0000 |
---|---|---|
committer | Seivan Heidari <[email protected]> | 2019-11-21 00:11:41 +0000 |
commit | 358a1bcd708c622836723e5201b6de77cc9ff327 (patch) | |
tree | aeff9c96a6059fa2b02e7c87ec88753bc7993d8d /editors/code/src | |
parent | 1e2d090ab8a9bda18f148b894b7948eb05b976e6 (diff) | |
parent | 612a72fc4ea4376920f2a7da7b3c334227c1716c (diff) |
Merge branch 'master' of https://github.com/rust-analyzer/rust-analyzer into feature/themes
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/commands/inlay_hints.ts | 14 | ||||
-rw-r--r-- | editors/code/src/server.ts | 1 |
2 files changed, 2 insertions, 13 deletions
diff --git a/editors/code/src/commands/inlay_hints.ts b/editors/code/src/commands/inlay_hints.ts index ffaaaebcb..0dbdd94fb 100644 --- a/editors/code/src/commands/inlay_hints.ts +++ b/editors/code/src/commands/inlay_hints.ts | |||
@@ -87,7 +87,7 @@ export class HintsUpdater { | |||
87 | range: hint.range, | 87 | range: hint.range, |
88 | renderOptions: { | 88 | renderOptions: { |
89 | after: { | 89 | after: { |
90 | contentText: `: ${this.truncateHint(hint.label)}` | 90 | contentText: `: ${hint.label}` |
91 | } | 91 | } |
92 | } | 92 | } |
93 | })); | 93 | })); |
@@ -98,18 +98,6 @@ export class HintsUpdater { | |||
98 | } | 98 | } |
99 | } | 99 | } |
100 | 100 | ||
101 | private truncateHint(label: string): string { | ||
102 | if (!Server.config.maxInlayHintLength) { | ||
103 | return label; | ||
104 | } | ||
105 | |||
106 | let newLabel = label.substring(0, Server.config.maxInlayHintLength); | ||
107 | if (label.length > Server.config.maxInlayHintLength) { | ||
108 | newLabel += '…'; | ||
109 | } | ||
110 | return newLabel; | ||
111 | } | ||
112 | |||
113 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { | 101 | private async queryHints(documentUri: string): Promise<InlayHint[] | null> { |
114 | const request: InlayHintsParams = { | 102 | const request: InlayHintsParams = { |
115 | textDocument: { uri: documentUri } | 103 | textDocument: { uri: documentUri } |
diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index a3ef21a16..7907b70bc 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts | |||
@@ -43,6 +43,7 @@ export class Server { | |||
43 | initializationOptions: { | 43 | initializationOptions: { |
44 | publishDecorations: true, | 44 | publishDecorations: true, |
45 | lruCapacity: Server.config.lruCapacity, | 45 | lruCapacity: Server.config.lruCapacity, |
46 | maxInlayHintLength: Server.config.maxInlayHintLength, | ||
46 | excludeGlobs: Server.config.excludeGlobs, | 47 | excludeGlobs: Server.config.excludeGlobs, |
47 | useClientWatching: Server.config.useClientWatching, | 48 | useClientWatching: Server.config.useClientWatching, |
48 | featureFlags: Server.config.featureFlags | 49 | featureFlags: Server.config.featureFlags |