vscode-java icon indicating copy to clipboard operation
vscode-java copied to clipboard

Lombok generated code by annotation not showing in outline

Open Mortinke opened this issue 6 months ago • 5 comments

When I add Lombok annotations to a Java entity class, I expect to see the generated code (constructors, getters, setters, etc.) appear in the outline view — just like it does in NetBeans, Eclipse, Intellij. See also https://github.com/microsoft/vscode/issues/239634

Mortinke avatar Jun 23 '25 12:06 Mortinke

This seems pretty reasonable. The only reason for us not having done this that I can think of is conceptual. We use the language server integration in VS Code to generate the outline view. It's connected to textDocument/documentSymbol. The spec makes reference to the idea that these should represent symbols present in the document. The generated content by Lombok for a given source file doesn't quite match that.

However, we ran into an even more annoying case. Most IDEs have a way to show inherited symbols in the same outline view. In that case we did it in the quick-open as that seemed more useful (See https://github.com/redhat-developer/vscode-java/pull/2590 ).

rgrunber avatar Jun 24 '25 18:06 rgrunber

This is weird, the generated builder is shown in the outline, but not the other generated code. @snjeza any idea why?

Image

fbricon avatar Oct 20 '25 12:10 fbricon

. @snjeza any idea why?

@fbricon You may want to take a look at

  • https://github.com/eclipse-jdtls/eclipse.jdt.ls/issues/2446
  • https://github.com/eclipse-jdtls/eclipse.jdt.ls/pull/2452

snjeza avatar Oct 20 '25 12:10 snjeza

@snjeza ok so we might want to expose a setting to show generated symbols in the outline. So that we can keep it fast by default and users who really want it can toggle them on

fbricon avatar Oct 20 '25 13:10 fbricon

and that also means #2452 did not cover the case of generated classes, only methods.

fbricon avatar Oct 20 '25 13:10 fbricon