Skip to content

Commit cf35580

Browse files
committed
Fix hover span
1 parent aa456c4 commit cf35580

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

lib/ts-util/language-service-proxy-builder.js

+7-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts-util/language-service-proxy-builder.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/ts-util/language-service-proxy-builder.ts

+9-4
Original file line numberDiff line numberDiff line change
@@ -105,20 +105,25 @@ export class LanguageServiceProxyBuilder {
105105
if (templateStringService.getQuickInfoAtPosition) {
106106
const call = templateStringService.getQuickInfoAtPosition;
107107
this.wrap('getQuickInfoAtPosition', delegate =>
108-
(fileName: string, position: number) => {
108+
(fileName: string, position: number): ts.QuickInfo => {
109109
const node = this.getTemplateNode(fileName, position);
110110
if (!node) {
111111
return delegate(fileName, position);
112112
}
113113
const contents = node.getText().slice(1, -1);
114-
const quickInfo = call.call(templateStringService,
114+
const quickInfo: ts.QuickInfo | undefined = call.call(templateStringService,
115115
contents,
116116
this.relativeLC(fileName, node, position),
117117
new StandardTemplateContext(fileName, node, this.helper));
118118
if (quickInfo) {
119-
return Object.assign({}, quickInfo, { start: quickInfo.start + node.getStart() });
119+
return Object.assign({}, quickInfo, {
120+
textSpan: {
121+
start: quickInfo.textSpan.start + node.getStart() + 1,
122+
length: quickInfo.textSpan.length
123+
}
124+
});
120125
}
121-
return undefined;
126+
return delegate(fileName, position);
122127
});
123128
}
124129

0 commit comments

Comments
 (0)