Skip to content

In VSCode extension added user configuration for commit characters for accepting code suggestions #8515

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Achal1607
Copy link
Collaborator

This PR adds support for configurable commit characters in the Java LSP server. Users can now define which characters (e.g., ., ,) trigger the acceptance of a code completion suggestion via the new netbeans.java.completion.commit.chars setting in the Netbeans VS Code extension. The server reads this configuration and applies the characters to completion items dynamically. This improves the flexibility and user control over the code completion behaviour.

@Achal1607 Achal1607 requested review from lahodaj, dbalek and sdedic May 21, 2025 10:27
@Achal1607 Achal1607 added Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests labels May 21, 2025
@apache apache locked and limited conversation to collaborators May 22, 2025
@apache apache unlocked this conversation May 22, 2025
@lahodaj
Copy link
Contributor

lahodaj commented May 22, 2025

Not sure what @dbalek thinks here, but thinking of this for a bit: I am not sure that forcing the same list of commit characters on all completion items is ideal. E.g. there may be some items where it may make sense to confirm them on (, while some not, and that is not possible to do with a single list.

Maybe one of these would work better:

  • have a boolean switch that would enable/disable the commit characters that the provider filled in. I.e. if enabled, whatever commit character that the provider filled in the item would be used; if disabled, none would be used.
  • have a setting with permitted commit characters. I.e. the real commit characters in an item would be the intersection between this setting and the characters from the provider. (Or, the setting could be a deny list - i.e. the characters in the list would be removed from every item's commit characters.)

@Achal1607 Achal1607 added this to the NB27 milestone May 23, 2025
@lahodaj
Copy link
Contributor

lahodaj commented Jun 12, 2025

Going back to this - thinking of this more, the actual commit characters sent out from the server should probably be an intersection between the commit characters requested by the completion item, and the user-selected commit characters. That would make most sense to me.

@dbalek
Copy link
Contributor

dbalek commented Jun 12, 2025

Going back to this - thinking of this more, the actual commit characters sent out from the server should probably be an intersection between the commit characters requested by the completion item, and the user-selected commit characters. That would make most sense to me.

Yes, this approach would be better, however even in NetBeans, all JavaCompletionItems currently share the same list of commit characters (even though the API would allow more fine grained approach). Would be a nice enhancement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Java [ci] enable extra Java tests (java.completion, java.source.base, java.hints, refactoring.java, form) LSP [ci] enable Language Server Protocol tests VSCode Extension [ci] enable VSCode Extension tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants