microsoft / microsoft/TypeScript
Distinguishing suggestions from global scope from local suggestions
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
From https://github.com/Microsoft/vscode/issues/59437
Search Terms:
- TSServer
- completions
- suggestions
Code
For the example ts file:
class FooClass {
toString(): void {
|
}
}
Trigger suggestions at the | inside the toString method
Problem
We get back two completions from completionInfo:
{
"name": "toString",
"kind": "function",
"kindModifiers": "declare",
"sortText": "0"
},
{
"name": "toString",
"kind": "method",
"kindModifiers": "",
"sortText": "0",
"insertText": "this.toString"
},
However when we then make the completionEntryDetails request, we can only pass the identifier name: "toString". This makes it unclear which completion entry we are actually requesting completion details for.
Proposal
completionEntryDetails already has a source field that is used to identify when a suggestion is an auto import. I believe that this field could also be used for global symbols, such as when a symbol name comes from a global lib.d.ts file. In this case, the first toString suggestion comes from a global in dom.d.ts
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Usa l'esempio FooClass per riprodurre i completamenti toString duplicati restituiti da completionInfo. Leggi come completionEntryDetails usa attualmente source per gli import automatici, quindi valuta il caso proposto dei simboli globali da dom.d.ts; il lavoro è completato quando i chiamanti possono distinguere le voci e richiedere i dettagli corrispondenti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100