@vue/typescript-plugin
Advanced tools
Comparing version
@@ -21,4 +21,2 @@ "use strict"; | ||
return getDefinitionAndBoundSpan(ts, language, languageService, vueOptions, asScriptId, target[p]); | ||
case 'getQuickInfoAtPosition': | ||
return getQuickInfoAtPosition(ts, target, target[p]); | ||
// TS plugin only | ||
@@ -243,40 +241,2 @@ case 'getEncodedSemanticClassifications': | ||
} | ||
function getQuickInfoAtPosition(ts, languageService, getQuickInfoAtPosition) { | ||
return (...args) => { | ||
const result = getQuickInfoAtPosition(...args); | ||
if (result && result.documentation?.length === 1 && result.documentation[0].text.startsWith('__VLS_emit,')) { | ||
const [_, emitVarName, eventName] = result.documentation[0].text.split(','); | ||
const program = languageService.getProgram(); | ||
const typeChecker = program.getTypeChecker(); | ||
const sourceFile = program.getSourceFile(args[0]); | ||
result.documentation = undefined; | ||
let symbolNode; | ||
sourceFile?.forEachChild(function visit(node) { | ||
if (ts.isIdentifier(node) && node.text === emitVarName) { | ||
symbolNode = node; | ||
} | ||
if (symbolNode) { | ||
return; | ||
} | ||
ts.forEachChild(node, visit); | ||
}); | ||
if (symbolNode) { | ||
const emitSymbol = typeChecker.getSymbolAtLocation(symbolNode); | ||
if (emitSymbol) { | ||
const type = typeChecker.getTypeOfSymbolAtLocation(emitSymbol, symbolNode); | ||
const calls = type.getCallSignatures(); | ||
for (const call of calls) { | ||
const callEventName = typeChecker.getTypeOfSymbolAtLocation(call.parameters[0], symbolNode).value; | ||
call.getJsDocTags(); | ||
if (callEventName === eventName) { | ||
result.documentation = call.getDocumentationComment(typeChecker); | ||
result.tags = call.getJsDocTags(); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
return result; | ||
}; | ||
} | ||
function getEncodedSemanticClassifications(ts, language, languageService, asScriptId, getEncodedSemanticClassifications) { | ||
@@ -283,0 +243,0 @@ return (filePath, span, format) => { |
{ | ||
"name": "@vue/typescript-plugin", | ||
"version": "3.0.0-beta.5", | ||
"version": "3.0.0", | ||
"license": "MIT", | ||
@@ -16,4 +16,4 @@ "files": [ | ||
"dependencies": { | ||
"@volar/typescript": "2.4.15", | ||
"@vue/language-core": "3.0.0-beta.5", | ||
"@volar/typescript": "2.4.16", | ||
"@vue/language-core": "3.0.0", | ||
"@vue/shared": "^3.5.0", | ||
@@ -26,3 +26,3 @@ "path-browserify": "^1.0.1" | ||
}, | ||
"gitHead": "3a4648914c60c90444d939cf762a016a4318ca09" | ||
"gitHead": "620f050fd494cccd215781907c950e17dae4fd58" | ||
} |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
37
19.35%1
-50%48670
-1.55%1009
-1.66%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated
Updated