open-wc / custom-elements-manifest

Custom Elements Manifest is a file format that describes custom elements in your project.
https://custom-elements-manifest.open-wc.org/
234 stars 43 forks source link

Analyzing override jsdoc tag #218

Closed nnaydenow closed 4 months ago

nnaydenow commented 1 year ago

Checklist

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 { /**

TestClass.define();

- Plugin code:
```js

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

nnaydenow commented 1 year ago

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?

thepassle commented 4 months ago

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