redhat-developer / redhat-developer/vscode-java

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

Aperta
#3,312 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
TypeScript
Stelle
2.3k
Fork
546
Merge medio
20h 1m
PR unite (30g)
11

Descrizione

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)

at the basic, this isn't language specific, but language enhancements possible

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

Not sure where to file this at the "editor." level

filing in vscode-java for language specific completion enhancement ability (less so for compile check, mores to not overwrite text that is suppose to be repeated, but ymmv)

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il flusso di lavoro setter-to-fluent con le versioni indicate di VS Code e vscode-java, confrontando Tab ed Enter e le impostazioni dei suggerimenti specificate. Non sono indicati file sorgente né test, quindi individua prima il comportamento di accettazione dei completamenti dell’editor e la relativa integrazione con l’estensione Java. Il lavoro è completato quando il testo circostante duplicato non viene inserito e la configurazione prevista o il comportamento specifico del linguaggio è verificato.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java, typescript, vscode
Ambito
developer-experience, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.