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

Investigate expected behaviour for the MicroProfileGenerateOpenAPIOperation code action. #649

Open
mrglavas opened this issue Feb 13, 2024 · 4 comments
Labels
language client language server integration should-fix

Comments

@mrglavas
Copy link
Contributor

mrglavas commented Feb 13, 2024

While investigating #644, I noticed that "Generate OpenAPI Annotations" is only offered as a code action when there's a diagnostic. This code action isn't categorized as a quick fix and seems to have nothing to do with resolving the diagnostic (see screenshot).

image

In plugin.xml, the code action's kind is specified as source:
<javaCodeActionParticipant kind="source" group="mp" implementationClass="io.openliberty.tools.intellij.lsp4mp4ij.psi.internal.openapi.java.MicroProfileGenerateOpenAPIOperation"/>

It seems like this code action should be offered to the user even when there's no diagnostic. We should confirm what behaviour is expected. This issue: redhat-developer/lsp4ij#99 opened against LSP4iJ may be related and might be the root cause, assuming that the code action should be available without a diagnostic.

@mrglavas mrglavas added language client language server integration lsp4ij labels Feb 13, 2024
@mrglavas mrglavas changed the title Investigate expected behaviour for MicroProfileGenerateOpenAPIOperation code action. Investigate expected behaviour for the MicroProfileGenerateOpenAPIOperation code action. Feb 13, 2024
@mrglavas
Copy link
Contributor Author

I wanted to see how Liberty Tools for VS Code handles the "Generate OpenAPI Annotations" code action, but noticed that it's not made available, even with the diagnostic.

Liberty Tools for VS Code:
image

@scottkurz
Copy link
Member

scottkurz commented Feb 22, 2024

Noting this issue we found in Liberty Tools Eclipse that had some overlap. It turned out to be a limitation with lsp4e not distinguishing between different CodeActionKind(s), which was not yet up to par with what VSCode offered in this area. This might be helpful: eclipse-lsp4e/lsp4e#867.

(Though the full history of the original problem and how we noticed then worked around it might not be all that relevant).

@mrglavas
Copy link
Contributor Author

I and others have also observed that when you try to apply the "Generate OpenAPI Annotations" code action it doesn't seem to do anything.

@TrevCraw TrevCraw removed the lsp4ij label Mar 21, 2024
@angelozerr
Copy link

Your problem is exactly the same issue than redhat-developer/lsp4ij#99 like you have said and this morning I have implemented the issue.

The generated open api code action marked with source should appear as ij intention and not as ij quickfix so it will appear without diagnostics

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language client language server integration should-fix
Projects
Development

No branches or pull requests

4 participants