Skip to content

Conversation

shivam71
Copy link
Contributor

@shivam71 shivam71 commented Sep 23, 2025

Issue : End position not found for implicit class scaffolding compact source file (JEP 512)

Context

  • Compact source file allow top level methods and fields.
  • Internally the fields and methods are treated as part of a implicit final class.
  • As the class in not explicitly declared in code the IDE when trying to find end position for the corresponding java element fails.
  • This change defaults to using the end position of the compilation unit tree (which is computed correctly) when for a class element source position is found but no end position is found.
  • Visible effect of this issue was missing outline view for the compact source file in the Java VSCode Extension.

Debugging output for reference

Screenshot 2025-09-22 at 5 46 25 PM

^Add meaningful description above

Click to collapse/expand PR instructions

By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -

  • are all your own work, and you have the right to contribute them.
  • are contributed solely under the terms and conditions of the Apache License 2.0 (see section 5 of the license for more information).

Please make sure (eg. git log) that all commits have a valid name and email address for you in the Author field.

If you're a first time contributor, see the Contributing guidelines for more information.

If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.

PR approval and merge checklist:

  1. Was this PR correctly labeled, did the right tests run? When did they run?
  2. Is this PR squashed?
  3. Are author name / email address correct? Are co-authors correctly listed? Do the commit messages need updates?
  4. Does the PR title and description still fit after the Nth iteration? Is the description sufficient to appear in the release notes?

If this PR targets the delivery branch: don't merge. (full wiki article)

…mpact source file compilation unit to end position of compilation unit tree.
@mbien mbien added debugger Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) labels Sep 23, 2025
@mbien mbien added this to the NB28 milestone Sep 23, 2025
@apache apache locked and limited conversation to collaborators Sep 23, 2025
@apache apache unlocked this conversation Sep 23, 2025
@mbien mbien requested review from lahodaj and dbalek September 23, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants