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-service): fix caching of semantic diagnostics #141

Merged
merged 1 commit into from Feb 26, 2024

Conversation

remcohaszing
Copy link
Member

This fixes a caching issue regarding semanric diagnostics. I don’t fully understand why. Returning an empty array from https://github.com/mdx-js/mdx-analyzer/blob/f6a43853d5ae0509b93001fdf6f58e1466106605/packages/language-service/lib/service-plugin.js#L163 fixed the issue, so I figured this was an upstream problem in Volar.

Refs mdx-js/mdx-analyzer#400

@johnsoncodehk
Copy link
Member

LGTM, thanks!

The reason is that when the service returns undefined result, the following lines cannot replace the response cache.

if (result) {
cache.errors = result;
cache.snapshot = sourceFile?.snapshot;
}

@johnsoncodehk johnsoncodehk merged commit 2de64b2 into master Feb 26, 2024
6 checks passed
@johnsoncodehk johnsoncodehk deleted the fix-semantic-errors-caching branch February 26, 2024 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants