diff options
| author | Aleksey Kladov <aleksey.kladov@gmail.com> | 2019-11-20 08:38:25 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-20 08:38:25 +0300 |
| commit | eec68e6f451ee7675ce2cb29b696df091e6aed13 (patch) | |
| tree | f83c828be31f5ac3950bf41c027a30365cfc7bd6 /editors/code | |
| parent | 0e61ba3750df7e3e19eda21b6486bf70d6dffc72 (diff) | |
| parent | bf5ac4fe3952ee0db9fe18a185e39a209c58e79b (diff) | |
| download | rust-eec68e6f451ee7675ce2cb29b696df091e6aed13.tar.gz rust-eec68e6f451ee7675ce2cb29b696df091e6aed13.zip | |
Merge pull request #2297 from kiljacken/master
Add fancy truncation of type hints.
Diffstat (limited to 'editors/code')
| -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 ffaaaebcb05..0dbdd94fbac 100644 --- a/editors/code/src/commands/inlay_hints.ts +++ b/editors/code/src/commands/inlay_hints.ts @@ -87,7 +87,7 @@ export class HintsUpdater { range: hint.range, renderOptions: { after: { - contentText: `: ${this.truncateHint(hint.label)}` + contentText: `: ${hint.label}` } } })); @@ -98,18 +98,6 @@ export class HintsUpdater { } } - private truncateHint(label: string): string { - if (!Server.config.maxInlayHintLength) { - return label; - } - - let newLabel = label.substring(0, Server.config.maxInlayHintLength); - if (label.length > Server.config.maxInlayHintLength) { - newLabel += '…'; - } - return newLabel; - } - private async queryHints(documentUri: string): Promise<InlayHint[] | null> { const request: InlayHintsParams = { textDocument: { uri: documentUri } diff --git a/editors/code/src/server.ts b/editors/code/src/server.ts index a3ef21a1671..7907b70bc51 100644 --- a/editors/code/src/server.ts +++ b/editors/code/src/server.ts @@ -43,6 +43,7 @@ export class Server { initializationOptions: { publishDecorations: true, lruCapacity: Server.config.lruCapacity, + maxInlayHintLength: Server.config.maxInlayHintLength, excludeGlobs: Server.config.excludeGlobs, useClientWatching: Server.config.useClientWatching, featureFlags: Server.config.featureFlags |
