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

Add Assign statement to new variable/field code action #1319

Merged
merged 1 commit into from
Jan 24, 2020

Conversation

snjeza
Copy link
Contributor

@snjeza snjeza commented Jan 8, 2020

@snjeza snjeza requested review from gorkem and fbricon January 8, 2020 19:34
@snjeza
Copy link
Contributor Author

snjeza commented Jan 8, 2020

Test failures are caused by #1318

@fbricon
Copy link
Contributor

fbricon commented Jan 9, 2020

test this please

@fbricon
Copy link
Contributor

fbricon commented Jan 10, 2020

It works well, but it doesn't show up as a refactoring. It has the quickassist kind instead.
I'd expect to see refactor.assign.variable and refactor.assign.field kinds instead, so that they could eventually be bound to shortcuts

@fbricon
Copy link
Contributor

fbricon commented Jan 10, 2020

So Eclipse doesn't show it as a refactoring either (obviously since QuickAssistProcessor is coming from there), but there's a shortcut assigned nonetheless.
Screen Shot 2020-01-10 at 10 10 06 AM

Not sure which kind we're supposed to use then, but most definitely something more precise than quickassist

@snjeza
Copy link
Contributor Author

snjeza commented Jan 16, 2020

test this please

@snjeza
Copy link
Contributor Author

snjeza commented Jan 16, 2020

@fbricon I have updated the PR.

@fbricon
Copy link
Contributor

fbricon commented Jan 20, 2020

Could we automatically trigger the variable/field rename, after the code action has been applied, similar to 'extract to ...' methods? This requires extra code on the client side.

@snjeza snjeza changed the title Add Assign statement to new variable/field quick action [WIP] Add Assign statement to new variable/field quick action Jan 21, 2020
@fbricon fbricon changed the title [WIP] Add Assign statement to new variable/field quick action Add Assign statement to new variable/field quick action Jan 21, 2020
@snjeza
Copy link
Contributor Author

snjeza commented Jan 21, 2020

@fbricon I have updated the PR.

@fbricon
Copy link
Contributor

fbricon commented Jan 23, 2020

So, if I try the example from redhat-developer/vscode-java#1208:

session.createNativeQuery("sqlString").scroll();

when the cursor is on session (or when selecting the full expression), I get the "Assign statement" proposals when triggering quickfixes in vscode (ctrl+.), which is good, but not when the cursor is on createNativeQuery or scroll.
Whereas Eclipse IDE proposes those on all these locations.

Signed-off-by: Snjezana Peco <snjezana.peco@redhat.com>
@snjeza
Copy link
Contributor Author

snjeza commented Jan 23, 2020

@fbricon I have updated the PR.

@fbricon fbricon merged commit 74a3ea1 into eclipse-jdtls:master Jan 24, 2020
@fbricon
Copy link
Contributor

fbricon commented Jan 24, 2020

Thanks @snjeza !

@fbricon fbricon added this to the Mid January 2020 milestone Jan 24, 2020
@fbricon fbricon changed the title Add Assign statement to new variable/field quick action Add Assign statement to new variable/field code action Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Assign statement to new variable/field quick action
2 participants