microsoft / microsoft/TypeScript
Go-to-definition should only show relevant definitions when value & type have same name
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
🔎 Search Terms
"go to definition", "same identifier", "value", "type"
🕗 Version & Regression Information
Always was the case, AFAIK
⏯ Playground Link
💻 Code
type t = {}
const t = {}
function f(arg: t) { } // going to definition on `t` here gives definitions of both - type and value `t`, even though value `t` cannot be used in this place: tsc - error TS2749: 't' refers to a value, but is being used as a type here. Did you mean 'typeof t'?
🙁 Actual behavior
"Go to definition" on a param type t shows 2 definitions - value & type which have same name - even though the value's definition is completely irrelevant.
🙂 Expected behavior
"Go to definition" shows only relevant definition of type t
Additional information about the issue
No response
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 la riproduzione in Playground e la richiesta go-to-definition per t in function f(arg: t). Traccia come il servizio del linguaggio risolve le definizioni quando un tipo e un valore condividono lo stesso nome; il lavoro è completato quando il risultato contiene solo la definizione del tipo, preservando le definizioni rilevanti negli altri contesti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 45/100