custom-elements-manifest
custom-elements-manifest copied to clipboard
Analyzing override jsdoc tag
Checklist
- [x] Did you run the analyzer with the
--devflag to get more information? - [x] Did you create a minimal reproduction in the playground?
node:internal/process/promises:288
triggerUncaughtException(err, true /* fromPromise */);
^
Error:
[my-plugin]: Looks like you've hit an error in third party plugin: my-plugin. Please try to create a minimal reproduction and inform the author of the my-plugin plugin.
TypeError: Cannot read properties of undefined (reading 'text')
at TokenOrIdentifierObject.getText (/Users/I351230/work/ui5-webcomponents/node_modules/@custom-elements-manifest/analyzer/node_modules/typescript/lib/typescript.js:152835:31)
For some reason I'm not able to save the playground link but this is the code:
- Code to analyze:
class TestClass {
/**
* @override
*/
test() {
}
}
TestClass.define();
- Plugin code:
function myPlugin() {
// Write a custom plugin
return {
// Make sure to always give your plugins a name, this helps when debugging
name: 'my-plugin',
// Runs for all modules in a project, before continuing to the analyzePhase
collectPhase({ts, node, context}){},
// Runs for each module
analyzePhase({ts, node, moduleDoc, context}){
if (node?.kind === ts?.SyntaxKind?.ClassDeclaration) {
console.log(node?.members?.[0]?.jsDoc?.[0]?.tags?.[0]?.tagName?.getText?.()) // Expecting here to be override
}
},
// Runs for each module, after analyzing, all information about your module should now be available
moduleLinkPhase({moduleDoc, context}){},
// Runs after modules have been parsed and after post-processing
packageLinkPhase({customElementsManifest, context}){},
}
}
Expected behavior Analyzing the Override jsdoc tag to not throw error
Hi @thepassle,
I'm not sure if I have to tag you but I will try.
Do you have any progress with this issue? Is the project is still ongoing?
Unable to reproduce this in the playground, closing. Please feel free to reopen if you're still running into this issue with the latest version of the analyzer