Skip to content

TreeUtilities: fix record span computation#8937

Merged
mbien merged 1 commit into
apache:masterfrom
mbien:fix-record-spans
Nov 2, 2025
Merged

TreeUtilities: fix record span computation#8937
mbien merged 1 commit into
apache:masterfrom
mbien:fix-record-spans

Conversation

@mbien
Copy link
Copy Markdown
Member

@mbien mbien commented Oct 18, 2025

ErrorDescriptionFactory can now compute spans for record declarations. This allows hints like Unused to correctly highlight hints on records.

TreeUtilities: use compact Collections and minor cleanup.

note: record is parsed as an identifier token since it is no reserved keyword, that is why this needs special casing.

before:
image

after:
image

@mbien mbien added this to the NB29 milestone Oct 18, 2025
@mbien mbien requested a review from lahodaj October 18, 2025 01:30
@mbien mbien added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) hints labels Oct 18, 2025
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Oct 18, 2025

oops. looks like a few tests failed.

@mbien mbien marked this pull request as draft October 18, 2025 02:01
@mbien mbien marked this pull request as ready for review October 18, 2025 03:52
@mbien
Copy link
Copy Markdown
Member Author

mbien commented Nov 1, 2025

@jlahoda can you take a look at this PR too?

Copy link
Copy Markdown
Contributor

@lahodaj lahodaj 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 to me, thanks. One typo inline.

Comment thread java/java.source.base/src/org/netbeans/api/java/source/TreeUtilities.java Outdated
Comment thread java/java.source.base/src/org/netbeans/api/java/source/TreeUtilities.java Outdated
ErrorDescriptionFactory can now compute spans for record declarations.
This allows hints like Unused to correctly annotate spans on records.

TreeUtilities: use compact Collections and minor cleanup.
@mbien mbien merged commit c3fec61 into apache:master Nov 2, 2025
69 of 70 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hints 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