It assumes that the lwc language server is adding information for just the "LWC" portion of a javascript file. (the stuff included in the default export). If it does not find an LWC, it simply returns an "empty" Internal Metadata definition to the vscode language server (since no LWC implies that no metadata information should be added to the language server).
Hi @codythomaszeitler! I'm so sorry for the delay, I didn't notice this PR before but until now that we have just merged a fix for the same issue 🤡 Thank you so much anyways for your contribution!
What does this PR do?
It ensures that the LWC language server does not crash if an LWC file does not have a default export.
What issues does this PR fix or reference?
https://github.com/forcedotcom/salesforcedx-vscode/issues/4994
So, this change works in the following way.
It assumes that the lwc language server is adding information for just the "LWC" portion of a javascript file. (the stuff included in the default export). If it does not find an LWC, it simply returns an "empty" Internal Metadata definition to the vscode language server (since no LWC implies that no metadata information should be added to the language server).