microsoft / microsoft/TypeScript
`default` keyword is offered in expression-bodied arrow function completions
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
## Bug Report
### Search Terms
- arrow function completion
- default keyword completion
- expression-bodied arrow function
- keyword completions
- completionListAtEndOfWordInArrowFunction
### Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about keyword completions in expression-bodied arrow function contexts.
### Playground Link
Playground link with relevant code: https://www.typescriptlang.org/play?#code/PTAEFkE9QYwewCYFNQHM5IM6gBZIE5JA
### Code
```ts
(d, defaultIsAnInvalidParameterName) => d
(d, defaultIsAnInvalidParameterName) => default
```
### Actual behavior
At the expression-bodied arrow function completion position, `default` is offered as a keyword completion.
### Expected behavior
`default` should not appear as a keyword completion in expression-bodied arrow function expression context.
### Additional information about the issue
There are already nearby fourslash tests that appear to acknowledge this behavior as undesirable:
- `tests/cases/fourslash/completionListAtEndOfWordInArrowFunction02.ts`
- `tests/cases/fourslash/completionListAtEndOfWordInArrowFunction03.ts`
I also traced the completion path locally and confirmed the keyword currently comes from the generic `FunctionLikeBodyKeywords` filtering path.
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
Inizia con il percorso di completion descritto nell’issue e con il percorso generico di filtraggio di FunctionLikeBodyKeywords. Leggi tests/cases/fourslash/completionListAtEndOfWordInArrowFunction02.ts e tests/cases/fourslash/completionListAtEndOfWordInArrowFunction03.ts, quindi usa l’esempio Playground collegato per riprodurre la completion. Il lavoro è completato quando `default` è assente nelle completions delle espressioni di funzione freccia con corpo espressione e la relativa copertura fourslash passa.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- tooling
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 68/100