fix(language-service): Remove 'any' in getQuickInfoAtPosition (#31014)
PR Close #31014
This commit is contained in:
parent
e84b51d2b6
commit
a4601eca68
@ -5,8 +5,8 @@
|
|||||||
"request_seq": 2,
|
"request_seq": 2,
|
||||||
"success": true,
|
"success": true,
|
||||||
"body": {
|
"body": {
|
||||||
"kind": "angular",
|
"kind": "",
|
||||||
"kindModifiers": "what does this do?",
|
"kindModifiers": "",
|
||||||
"start": {
|
"start": {
|
||||||
"line": 5,
|
"line": 5,
|
||||||
"offset": 26
|
"offset": 26
|
||||||
@ -19,4 +19,4 @@
|
|||||||
"documentation": "",
|
"documentation": "",
|
||||||
"tags": []
|
"tags": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -113,30 +113,30 @@ export function create(info: tss.server.PluginCreateInfo): ts.LanguageService {
|
|||||||
|
|
||||||
proxy.getQuickInfoAtPosition = function(fileName: string, position: number): ts.QuickInfo |
|
proxy.getQuickInfoAtPosition = function(fileName: string, position: number): ts.QuickInfo |
|
||||||
undefined {
|
undefined {
|
||||||
let base = oldLS.getQuickInfoAtPosition(fileName, position);
|
const base = oldLS.getQuickInfoAtPosition(fileName, position);
|
||||||
// TODO(vicb): the tags property has been removed in TS 2.2
|
const ours = ls.getHoverAt(fileName, position);
|
||||||
tryOperation('get quick info', () => {
|
if (!ours) {
|
||||||
const ours = ls.getHoverAt(fileName, position);
|
return base;
|
||||||
if (ours) {
|
}
|
||||||
const displayParts: ts.SymbolDisplayPart[] = [];
|
const result: ts.QuickInfo = {
|
||||||
for (const part of ours.text) {
|
kind: ts.ScriptElementKind.unknown,
|
||||||
displayParts.push({kind: part.language || 'angular', text: part.text});
|
kindModifiers: ts.ScriptElementKindModifier.none,
|
||||||
}
|
textSpan: {
|
||||||
const tags = base && (<any>base).tags;
|
start: ours.span.start,
|
||||||
base = <any>{
|
length: ours.span.end - ours.span.start,
|
||||||
displayParts,
|
},
|
||||||
documentation: [],
|
displayParts: ours.text.map(part => {
|
||||||
kind: 'angular',
|
return {
|
||||||
kindModifiers: 'what does this do?',
|
text: part.text,
|
||||||
textSpan: {start: ours.span.start, length: ours.span.end - ours.span.start},
|
kind: part.language || 'angular',
|
||||||
};
|
};
|
||||||
if (tags) {
|
}),
|
||||||
(<any>base).tags = tags;
|
documentation: [],
|
||||||
}
|
};
|
||||||
}
|
if (base && base.tags) {
|
||||||
});
|
result.tags = base.tags;
|
||||||
|
}
|
||||||
return base;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
proxy.getSemanticDiagnostics = function(fileName: string) {
|
proxy.getSemanticDiagnostics = function(fileName: string) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user