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

CodeActionLiteralSupport and versioning error #249

Closed
kathrynkodama opened this issue Mar 3, 2021 · 2 comments · Fixed by #250
Closed

CodeActionLiteralSupport and versioning error #249

kathrynkodama opened this issue Mar 3, 2021 · 2 comments · Fixed by #250

Comments

@kathrynkodama
Copy link
Contributor

Description:
Add CodeActionLiteralSupport for quick-fixes in the LanguageServerWrapper:

textDocumentClientCapabilities.getCodeAction().setCodeActionLiteralSupport(new CodeActionLiteralSupportCapabilities(Arrays.asList(new String[] {CodeActionKind.QuickFix}));

I also notice an error in the versioning where I continue to see this error when selecting a code action:
Edit version %d is older than current version %d from the EditorEventManager. I believe this is due to the versions being updated out of sync in the documentChanged method of DocumentEventManager. The VersionedTextDocument is always one version behind the version in DocumentEventManager. Altering the code to the below fixes this error:

changesParams.getTextDocument().setVersion(++version);

Suggested Labels:
bug, enhancement

Suggested Assignees:

Affected Product Version:
Using the latest version from the master branch

OS, DB, other environment details and versions:
Mac, IntelliJ IDEA Community Edition 2020.3

Steps to reproduce:

  1. Enable quick-fix code action literal support in lsp4intellij
  2. Attempt a quick-fix
  3. Notice that the code action is not applied because and see the versioning error

Related Issues:

@Trias
Copy link
Contributor

Trias commented Mar 3, 2021

I agree it should be a precrement. It's interesting that apparently has never caused any problems before.

Would you mind sending a Pull Request? :)

@kathrynkodama
Copy link
Contributor Author

Thank you @Trias, see the linked PR

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 a pull request may close this issue.

2 participants