Skip to content
Permalink
Browse files

fix(language-service): Remove 'any' in getQuickInfoAtPosition (#31014)

PR Close #31014
  • Loading branch information...
kyliau authored and AndrewKushnir committed Jun 11, 2019
1 parent a3d55a9 commit 7f214499e8f512fdad027572cfcbd11e11a2ffd0
@@ -5,8 +5,8 @@
"request_seq": 2,
"success": true,
"body": {
"kind": "angular",
"kindModifiers": "what does this do?",
"kind": "",
"kindModifiers": "",
"start": {
"line": 5,
"offset": 26
@@ -19,4 +19,4 @@
"documentation": "",
"tags": []
}
}
}
@@ -113,30 +113,30 @@ export function create(info: tss.server.PluginCreateInfo): ts.LanguageService {

proxy.getQuickInfoAtPosition = function(fileName: string, position: number): ts.QuickInfo |
undefined {
let base = oldLS.getQuickInfoAtPosition(fileName, position);
// TODO(vicb): the tags property has been removed in TS 2.2
tryOperation('get quick info', () => {
const ours = ls.getHoverAt(fileName, position);
if (ours) {
const displayParts: ts.SymbolDisplayPart[] = [];
for (const part of ours.text) {
displayParts.push({kind: part.language || 'angular', text: part.text});
}
const tags = base && (<any>base).tags;
base = <any>{
displayParts,
documentation: [],
kind: 'angular',
kindModifiers: 'what does this do?',
textSpan: {start: ours.span.start, length: ours.span.end - ours.span.start},
const base = oldLS.getQuickInfoAtPosition(fileName, position);
const ours = ls.getHoverAt(fileName, position);
if (!ours) {
return base;
}
const result: ts.QuickInfo = {
kind: ts.ScriptElementKind.unknown,
kindModifiers: ts.ScriptElementKindModifier.none,
textSpan: {
start: ours.span.start,
length: ours.span.end - ours.span.start,
},
displayParts: ours.text.map(part => {
return {
text: part.text,
kind: part.language || 'angular',
};
if (tags) {
(<any>base).tags = tags;
}
}
});

return base;
}),
documentation: [],
};
if (base && base.tags) {
result.tags = base.tags;
}
return result;
};

proxy.getSemanticDiagnostics = function(fileName: string) {

0 comments on commit 7f21449

Please sign in to comment.
You can’t perform that action at this time.