Skip to content

Commit 170b8f7

Browse files
committed
refactor(typescript-plugin): remove outdated getQuickInfoAtPosition proxy for emit jsdoc
1 parent bc9a303 commit 170b8f7

File tree

1 file changed

+0
-50
lines changed

1 file changed

+0
-50
lines changed

packages/typescript-plugin/lib/common.ts

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export function createVueLanguageServiceProxy<T>(
3131
return getCodeFixesAtPosition(target[p]);
3232
case 'getDefinitionAndBoundSpan':
3333
return getDefinitionAndBoundSpan(ts, language, languageService, vueOptions, asScriptId, target[p]);
34-
case 'getQuickInfoAtPosition':
35-
return getQuickInfoAtPosition(ts, target, target[p]);
3634
// TS plugin only
3735
case 'getEncodedSemanticClassifications':
3836
return getEncodedSemanticClassifications(ts, language, target, asScriptId, target[p]);
@@ -317,54 +315,6 @@ function getDefinitionAndBoundSpan<T>(
317315
};
318316
}
319317

320-
function getQuickInfoAtPosition(
321-
ts: typeof import('typescript'),
322-
languageService: ts.LanguageService,
323-
getQuickInfoAtPosition: ts.LanguageService['getQuickInfoAtPosition'],
324-
): ts.LanguageService['getQuickInfoAtPosition'] {
325-
return (...args) => {
326-
const result = getQuickInfoAtPosition(...args);
327-
if (result && result.documentation?.length === 1 && result.documentation[0].text.startsWith('__VLS_emit,')) {
328-
const [_, emitVarName, eventName] = result.documentation[0].text.split(',');
329-
const program = languageService.getProgram()!;
330-
const typeChecker = program.getTypeChecker();
331-
const sourceFile = program.getSourceFile(args[0]);
332-
333-
result.documentation = undefined;
334-
335-
let symbolNode: ts.Identifier | undefined;
336-
337-
sourceFile?.forEachChild(function visit(node) {
338-
if (ts.isIdentifier(node) && node.text === emitVarName) {
339-
symbolNode = node;
340-
}
341-
if (symbolNode) {
342-
return;
343-
}
344-
ts.forEachChild(node, visit);
345-
});
346-
347-
if (symbolNode) {
348-
const emitSymbol = typeChecker.getSymbolAtLocation(symbolNode);
349-
if (emitSymbol) {
350-
const type = typeChecker.getTypeOfSymbolAtLocation(emitSymbol, symbolNode);
351-
const calls = type.getCallSignatures();
352-
for (const call of calls) {
353-
const callEventName =
354-
(typeChecker.getTypeOfSymbolAtLocation(call.parameters[0], symbolNode) as ts.StringLiteralType).value;
355-
call.getJsDocTags();
356-
if (callEventName === eventName) {
357-
result.documentation = call.getDocumentationComment(typeChecker);
358-
result.tags = call.getJsDocTags();
359-
}
360-
}
361-
}
362-
}
363-
}
364-
return result;
365-
};
366-
}
367-
368318
function getEncodedSemanticClassifications<T>(
369319
ts: typeof import('typescript'),
370320
language: Language<T>,

0 commit comments

Comments
 (0)