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

auto completion inserting already-existing text ("overwrite" to the right) #1394

Closed
avertx opened this issue Sep 19, 2023 · 2 comments
Closed

Comments

@avertx
Copy link

avertx commented Sep 19, 2023

code completion unnecessarily not "overwriting" to the right (Java specific? language specific fixes with compile-check "smarter" "smart" acceptSuggestion possible)

TLDR; just look below at image attachments (step 1, 2, 3)

whoops didn't mean to submit to vscode-java-debug....

"overwriting" or "contextual insert" or "surrounding check" or "duplicate surround text" might be a better term

unsure about all cases (even in a language-specific context), but I hit this one enough that it warrants something to alleviate.

First stab at bug filing at "editor." level, though fixes (with compile-check bonus) could be language specific. (Java in this case)

discussion


fixes would include:

  1. just don't write duplicate text
  2. a property with options (as its possibly "destructive", though I'd prefer the "destructive" option here)
  3. language specific fix (bonus: detect which actually compiles)

between image 2 and image 3, both [tab] and [enter] seem to have the same results, so maybe this could be considered in configuration (on tab, check/replace same surrounding text, on enter just insert)

tried following settings, no difference observed:

"editor.acceptSuggestionOnEnter": "smart",
"editor.acceptSuggestionOnEnter": "on",

wanted:

"editor.acceptSuggestionOnEnter": "overwrite" or ("replacesame"),
"java.completion.acceptReplaceMode": "compile"

or
"editor.acceptSuggestionSurroundMode": {
 "replaceSame": ,
}

Also, separately, but not,

  1. editor.suggest isn't ordering by preexisting surround text
  2. language-specific e.g. "java.completion.orderByPriorityStaticMode": "preexisting" surround check could handle ordering better
  3. bonus language-specific e.g. "java.completion.orderByPriorityCompileCheck": "true" surround check could handle ordering
Environment
  • Operating System: N/A
  • JDK version: N/A
  • Visual Studio Code version: 1.82.2
  • Java extension version: 1.22.1
  • Java Debugger extension version: N/A
Steps To Reproduce

Here's a simple setter-to-fluent workflow change, but I seem to hit this case of not looking at preexisting text to the right

vscode-completion1
vscode-completion2
vscode-completion3

Current Result

see image 3

Expected Result
  1. don't not overwrite the same text as is being replaced (no idea about ALL cases, but something could be done, but maybe language specific)
  2. property options on "surrounding smartness"
Additional Informations
@avertx
Copy link
Author

avertx commented Sep 19, 2023

missed this is a -debug (vscode-java-debug) repo. going to submit to redhat-developer/vscode-java

@avertx avertx closed this as completed Sep 19, 2023
@avertx
Copy link
Author

avertx commented Sep 19, 2023

submitted

though this isn't language specific, specifically. includes language specific enhancements

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

No branches or pull requests

1 participant