Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review: fix: Improve comment handling in lambda parameters and local variables #6076

Conversation

I-Al-Istannen
Copy link
Collaborator

This fixes two or three different bugs:

  • Comments inside lambda parameters crashed the comment builder
  • Comments before the default expression of a local variable were never printed
  • Inline comments appearing on the same line as their element (e.g. /* foo */ System.exit();) were never printed

Closes: #6069.

Previously comments like `int a = /* foo */ 5` were attributed to the
CtLocalVariable, which did not print them (as they appear within and not
before/after).
@I-Al-Istannen I-Al-Istannen self-assigned this Nov 17, 2024
@I-Al-Istannen I-Al-Istannen force-pushed the fix/print-comments-in-lambda-or-local-var branch from 1d5a6ca to f73d5e0 Compare November 17, 2024 11:26
@I-Al-Istannen I-Al-Istannen changed the title wip: fix: Improve comment handling in lambda parameters and local variables review: fix: Improve comment handling in lambda parameters and local variables Nov 17, 2024
@MartinWitt MartinWitt merged commit 4c8531f into INRIA:master Nov 17, 2024
13 checks passed
@I-Al-Istannen I-Al-Istannen deleted the fix/print-comments-in-lambda-or-local-var branch November 17, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: JDTCommentBuilder IndexOutOfBoundsException exception
2 participants