Skip to content

Infer record components for "Create record" quickfix - #3857

Merged
jjohnstn merged 1 commit into
eclipse-jdtls:mainfrom
SougandhS:RecordTypeFix
Jul 30, 2026
Merged

Infer record components for "Create record" quickfix#3857
jjohnstn merged 1 commit into
eclipse-jdtls:mainfrom
SougandhS:RecordTypeFix

Conversation

@SougandhS

Copy link
Copy Markdown
Contributor

Previously the quick fix always generated an empty record header. Now it infers component types and names from the constructor call's arguments when one is present

Fixes : #3856

@eclipse-ls-bot

Copy link
Copy Markdown
Contributor

Can one of the admins verify this patch?

@SougandhS

Copy link
Copy Markdown
Contributor Author

Hi @jjohnstn, could you please check this too ?

@jjohnstn jjohnstn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If I type in a random line: Re1 re1 = new Re1(1, "abc"); The compiler marks this line in error. If I select the line and click on the light bulb, then select Create Re1 Record, your code works. If I instead hover over one of the Re1 references that are marked in error and then do Quick Fix....I am offered Create Re1 class or Create Re1 record. When I click on Create Re1 record, it doesn't add the record components. This should be made consistent.

Previously the quick fix always generated an empty record header. Now it
infers component types and names from the constructor call's arguments
when one is present

Fixes : eclipse-jdtls#3856
@SougandhS

Copy link
Copy Markdown
Contributor Author

If I instead hover over one of the Re1 references that are marked in error and then do Quick Fix....I am offered Create Re1 class or Create Re1 record. When I click on Create Re1 record, it doesn't add the record components. This should be made consistent.

Fixed this case
Fix

@SougandhS
SougandhS requested a review from jjohnstn July 29, 2026 06:42
@jjohnstn

Copy link
Copy Markdown
Contributor

Thanks @SougandhS

@jjohnstn jjohnstn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good.

@jjohnstn

Copy link
Copy Markdown
Contributor

Ignoring test failure which has no relevance to this patch.

@jjohnstn
jjohnstn merged commit f77624d into eclipse-jdtls:main Jul 30, 2026
6 of 7 checks passed
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.

"Create record" quick fix doesn't infer record components from constructor call arguments

3 participants