Skip to content

Add QuickAssist for adding/updating field access modifiers - #3863

Merged
jjohnstn merged 1 commit into
eclipse-jdtls:mainfrom
SougandhS:QuickAssistModify
Aug 12, 2026
Merged

Add QuickAssist for adding/updating field access modifiers#3863
jjohnstn merged 1 commit into
eclipse-jdtls:mainfrom
SougandhS:QuickAssistModify

Conversation

@SougandhS

Copy link
Copy Markdown
Contributor

Adds a new Quick Assist for adding or changing the access modifier of a field. For fields without an explicit access modifier, it offers “Add Access Modifier”, while fields with an existing modifier get “Change modifier for ''”. This provides a convenient way to update field visibility directly from the Quick Assist menu, avoiding the need to manually edit the field declaration and making access modifier changes quicker and easier during development.

quickAssist

Adds a new quick assist that offers "Change modifier for '<name>'" on
fields with existing access modifiers, and "Add Access Modifier" on
package-private fields.
@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 when you get some time ?

@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.

I'm ok with the patch, but it is a bit inconsistent due to the upstream code. When it is already package-private, we offer to add a modifier, but there is no way to change to package-private. I guess this could be done with a remove modifier action in the future.

@jjohnstn
jjohnstn merged commit 074e558 into eclipse-jdtls:main Aug 12, 2026
7 checks passed
@SougandhS

Copy link
Copy Markdown
Contributor Author

but there is no way to change to package-private.

The backend does expose package-private but couldn't find anything relevant to it in https://github.com/redhat-developer/vscode-java/ too, I think it is microsoft-vscode that does the labelling work, and decides what to show in the dropdown.

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.

3 participants