Skip to content

feat: add setting to show generated code in document symbols#4335

Merged
datho7561 merged 1 commit into
redhat-developer:mainfrom
fbricon:show-generated-code-in-outline
Feb 24, 2026
Merged

feat: add setting to show generated code in document symbols#4335
datho7561 merged 1 commit into
redhat-developer:mainfrom
fbricon:show-generated-code-in-outline

Conversation

@fbricon
Copy link
Copy Markdown
Collaborator

@fbricon fbricon commented Feb 12, 2026

New java.symbols.includeGeneratedCode boolean setting to enable returning generated code in document symbols.

Requires eclipse-jdtls/eclipse.jdt.ls#3706
Fixes #4084

Screenshot 2026-02-12 at 13 01 45

Because there's no way to programmatically trigger an outline view refresh (see microsoft/vscode#108722), after changing the setting you need to close/reopen the java files, or make a dummy change to see the updates in the outline view.

@fbricon fbricon requested a review from datho7561 February 12, 2026 12:24
@fbricon fbricon force-pushed the show-generated-code-in-outline branch from 4d875ee to 4c56aac Compare February 16, 2026 09:55
Signed-off-by: Fred Bricon <fbricon@gmail.com>
@fbricon fbricon force-pushed the show-generated-code-in-outline branch from 4c56aac to 5c42f13 Compare February 24, 2026 17:42
Copy link
Copy Markdown
Contributor

@datho7561 datho7561 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks, Fred!

@datho7561 datho7561 merged commit 7a454dd into redhat-developer:main Feb 24, 2026
2 checks passed
a-simeshin added a commit to a-simeshin/serena that referenced this pull request May 5, 2026
JDTLS' DocumentSymbolHandler filtered out every SourceMethod where
JDTUtils.isGenerated() was true, so Lombok-synthesised methods (getX/setX,
builder(), equals/hashCode/toString, withX, fluent accessors, ...) never
reached the LSP client. As a result Serena's symbol-aware tools — find_symbol,
get_symbols_overview, replace_symbol_body, insert_before_symbol,
insert_after_symbol — could not see, address or edit any Lombok-generated
member; only search_for_pattern / replace_content (text-based) worked.

Upstream introduced an opt-in preference java.symbols.includeGeneratedCode
in eclipse-jdtls/eclipse.jdt.ls#3706 (merged 2026-02-24) and surfaced it
through redhat-developer/vscode-java#4335. First vscode-java release with
the new JDTLS build is v1.53.0 (2026-02-26). Serena was pinned to v1.42.0-561,
well before the fix existed.

Changes:
- New ls_specific_settings.java.lombok_show_generated setting (default true);
  forwarded to JDTLS as java.symbols.includeGeneratedCode in initialize
  params. Older servers ignore the unknown preference key silently.
- Bump bundled vscode-java DEFAULT 1.42.0-561 -> 1.54.0-923 (brings JRE
  21.0.10, Lombok 1.18.39 and Equinox launcher 1.7.100). INITIAL stays at
  1.42.0-561, so per the per-version install-dir convention from oraios#1438 the
  new build lands in vscode-java-1.54.0-923/ while legacy vscode-java/
  caches and any explicit vscode_java_version: '1.42.0-561' override keep
  working.
- New VsixResourcePaths dataclass + INITIAL/DEFAULT_VSCODE_JAVA_PATHS pin
  the JRE / Lombok / launcher filenames *inside* the VSIX. Without this,
  bumping the archive would break users on legacy 1.42.0-561 because
  resource paths inside the archive change between releases. Resolution
  mirrors SHA pinning: known versions get their pinned paths; any other
  version raises SolidLSPException with a pointer to upstream-jdtls mode
  (which derives paths dynamically and needs no pinning).
- Drop dead 'static/vscode-java/...' placeholder in initialize params; the
  real runtimes[] is overwritten below from runtime_dependency_paths
  .jre_home_path, which is correct in both default-VSIX and upstream-jdtls
  modes.
- Test fixtures: Lombok provided dep in test_repo/pom.xml plus
  LombokModel / FluentLombokModel / DefaultGreeter covering @DaTa, @builder
  (toBuilder=true), @with, @DeleGate, @AllArgsConstructor, @NoArgsConstructor
  and @accessors(fluent=true). Regression test in test_java_basic.py
  asserts every generated-method shape lands in document symbols.

Closes oraios#1432
MischaPanch pushed a commit to oraios/serena that referenced this pull request May 5, 2026
…mp jdtls version (#1434)

* feat(jdtls): surface Lombok-generated methods in document symbols

JDTLS' DocumentSymbolHandler filtered out every SourceMethod where
JDTUtils.isGenerated() was true, so Lombok-synthesised methods (getX/setX,
builder(), equals/hashCode/toString, withX, fluent accessors, ...) never
reached the LSP client. As a result Serena's symbol-aware tools — find_symbol,
get_symbols_overview, replace_symbol_body, insert_before_symbol,
insert_after_symbol — could not see, address or edit any Lombok-generated
member; only search_for_pattern / replace_content (text-based) worked.

Upstream introduced an opt-in preference java.symbols.includeGeneratedCode
in eclipse-jdtls/eclipse.jdt.ls#3706 (merged 2026-02-24) and surfaced it
through redhat-developer/vscode-java#4335. First vscode-java release with
the new JDTLS build is v1.53.0 (2026-02-26). Serena was pinned to v1.42.0-561,
well before the fix existed.

Changes:
- New ls_specific_settings.java.lombok_show_generated setting (default true);
  forwarded to JDTLS as java.symbols.includeGeneratedCode in initialize
  params. Older servers ignore the unknown preference key silently.
- Bump bundled vscode-java DEFAULT 1.42.0-561 -> 1.54.0-923 (brings JRE
  21.0.10, Lombok 1.18.39 and Equinox launcher 1.7.100). INITIAL stays at
  1.42.0-561, so per the per-version install-dir convention from #1438 the
  new build lands in vscode-java-1.54.0-923/ while legacy vscode-java/
  caches and any explicit vscode_java_version: '1.42.0-561' override keep
  working.
- New VsixResourcePaths dataclass + INITIAL/DEFAULT_VSCODE_JAVA_PATHS pin
  the JRE / Lombok / launcher filenames *inside* the VSIX. Without this,
  bumping the archive would break users on legacy 1.42.0-561 because
  resource paths inside the archive change between releases. Resolution
  mirrors SHA pinning: known versions get their pinned paths; any other
  version raises SolidLSPException with a pointer to upstream-jdtls mode
  (which derives paths dynamically and needs no pinning).
- Drop dead 'static/vscode-java/...' placeholder in initialize params; the
  real runtimes[] is overwritten below from runtime_dependency_paths
  .jre_home_path, which is correct in both default-VSIX and upstream-jdtls
  modes.
- Test fixtures: Lombok provided dep in test_repo/pom.xml plus
  LombokModel / FluentLombokModel / DefaultGreeter covering @DaTa, @builder
  (toBuilder=true), @with, @DeleGate, @AllArgsConstructor, @NoArgsConstructor
  and @accessors(fluent=true). Regression test in test_java_basic.py
  asserts every generated-method shape lands in document symbols.

Closes #1432
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 this pull request may close these issues.

Lombok generated code by annotation not showing in outline

2 participants