aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-11-20 05:38:25 +0000
committerGitHub <[email protected]>2019-11-20 05:38:25 +0000
commiteec68e6f451ee7675ce2cb29b696df091e6aed13 (patch)
treef83c828be31f5ac3950bf41c027a30365cfc7bd6 /editors/code/src/commands
parent0e61ba3750df7e3e19eda21b6486bf70d6dffc72 (diff)
parentbf5ac4fe3952ee0db9fe18a185e39a209c58e79b (diff)
Merge pull request #2297 from kiljacken/master
Add fancy truncation of type hints.
Diffstat (limited to 'editors/code/src/commands')
-rw-r--r--editors/code/src/commands/inlay_hints.ts14
1 files changed, 1 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 }