OpenLiberty / liberty-tools-vscode

Visual Studio Code extension for Liberty Tools
https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext
Eclipse Public License 2.0
17 stars 34 forks source link

Jakarta quick-fix fails due to getData() is null #336

Open turkeylurkey opened 4 months ago

turkeylurkey commented 4 months ago

Certain quick fixes related to Jakarta do not appear with the diagnostic in the editor because of an exception.

You can see the exception in the Output tab when you select "Language Support for Java."

[Error - 12:57:13 PM] Request textDocument/codeAction failed.
  Message: Request jakarta/java/codeaction failed with message: java.lang.NullPointerException: Cannot invoke "Object.toString()" because the return value of "org.eclipse.lsp4j.Diagnostic.getData()" is null
  Code: -32603

An example is the quick fix reading "The @AssertTrue annotation can only be used on boolean and Boolean type fields."

More details are available in the lsp4jakarta repository.

aparnamichael commented 1 day ago

Raised a PR with fix in lsp4Jakarta repo - https://github.com/eclipse/lsp4jakarta/pull/536