Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: language server would crash if main class could not be identified #578

Merged
merged 2 commits into from
Sep 27, 2023

Conversation

divmain
Copy link
Contributor

@divmain divmain commented Sep 20, 2023

What does this PR do?

In cases where the main class of a JavaScript file could not be identified, an error was thrown during analysis of the associated metadata. This would cause the language server to crash in VSCode. 👎

This PR fixes the issue, providing metadata is there is an exported class or if only a single class is defined in the .js file. If multiple classes are defined and none of them are default exports, the language server will now return no data. No code hints will be provided, but the language server will not crash.

What issues does this PR fix or reference?

Fixes forcedotcom/salesforcedx-vscode#4994.

@CristiCanizales
Copy link
Contributor

This looks good to me, thank you for taking care of this!! :) We just need to get the tests passing and then we can :shipit:

Copy link
Contributor

@CristiCanizales CristiCanizales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@CristiCanizales CristiCanizales merged commit d96478d into forcedotcom:main Sep 27, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The LWC Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted.
2 participants