fix: do not purge the code action cache in language server before the action is resolved by the client [IDE-134] #5062
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Submission
Please check the boxes once done.
The pull request must:
feat:
orfix:
, others might be used in rare occasions as well, if there is no need to document the changes in the release notes. The changes or fixes should be described in detail in the commit message for the changelog & release notes.What does this PR do?
Risk: low
This PR updates Snyk Language Server to the latest version. This version provides a fix for code action handling in language server. Resolvable Code Actions are working in a two-step modus in language server: First, the action is created with a callback function stored in language server. The second step is the code action resolution. When a client calls language server with the codeaction/resolve request, the stored callback function is looked up in the cache and executed.
Previously, this cache was purged on each code action request call. This is not working well, if code action information is retained by the IDE. Therefore, the cache entry for the callback function is now only purged when the action is resolved.
Where should the reviewer start?
snyk/snyk-ls#447
How should this be manually tested?
Launch VSCode, scan with Snyk Code and autofix enabled a project that contains issues that are auto-fixable. Execute the code action to fix it.
Any background context you want to provide?
We are integrating language server Snyk Code into IntelliJ right now. When implementing the Snyk Code ExternalAnnotator (SnykCodeAnnotatorLS), the error with too early purged code actions occurred.
What are the relevant tickets?
IDE-134
Screenshots
Additional questions