microsoft / microsoft/TypeScript

[tsserver] add support to fetch symbol references from only the current file.

Aperta
#60,763 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Awaiting More Feedback Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

🔍 Search Terms

Hey.
it will be awesome if the "references" command can only get references of a symbol at position (x,y) but only inside the current file.

✅ Viability Checklist
⭐ Suggestion

this can be added using currentFileOnly?: boolean; (like that inside interface NavtoRequestArgs).

📃 Motivating Example

i use it mainly for rewriting javascript files (usually obfuscated ones), so for each symbol i need to get all references but only for the currently opened file, so i wish there was a flag for it. as i thought it will be more performant (i.e. instead of searching references all across the project, if we restricted it to the current file - by a flag in a the request - then it can be more performant due to reduced search space?)

💻 Use Cases
  1. What do you want to use this for?
  • rewriting js files accurately.
  1. What shortcomings exist with current approaches?
  • performance issues.
  1. What workarounds are you using in the meantime?
  • requesting references then filtering them if the ref['file'] key is the same as that supplied in references request. however, i think tsserver can be more performant than this approach.

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 tracciando la richiesta references di tsserver e confrontandone gli argomenti con NavtoRequestArgs, che l’issue cita come precedente. Determina i percorsi di richiesta e risposta interessati, quindi aggiungi e convalida un’opzione limitata al file corrente, in modo che i riferimenti possano essere limitati al file fornito senza modificare il comportamento esistente.

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

Valutazione

Stack tecnologico
typescript
Ambito
tooling
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.