microsoft / microsoft/TypeScript

Find All References should include composed return value

Aperta
#58,509 0 commenti 2 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

"Find all References", "find references composable", "find all references returned"

✅ Viability Checklist
⭐ Suggestion

Running 'Find all references' on a Function defined within a function and returned in a composed object, should include references to the function defined on the composed object.

📃 Motivating Example

It's a common practice to compose objects within functions that are exported for use by the program.
For example, using object composition with pinia and vue:

import { defineStore } from "pinia";

export const useMyStore = defineStore('mystore', () => {

	function funcA() { }

	return {
		funcA,
	}

});

However, using 'findAllReferences' on the function defined within the composing function does not detect references through the returned object:

findAllRefs

Using 'findAllReferences' on the function defined on the returned object itself, does return such references:

findAllRefsReturn

💻 Use Cases
  1. When editing a function in a composed store, it is common to check for references to the function being changed.
  2. The references of the function defined within the composable function only returns the references within the store, rather than uses linked by the composed object.
  3. Currently you must scroll from the function being worked on to the composed object, and run 'Find All References' from there. It is a minor inconvenience, but an extremely common one.

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

Riproduci l'esempio di un oggetto composto e confronta i risultati di Find All References per la funzione interna e la proprietà restituita. Inizia dal punto di ingresso del language-service di Find All References, quindi individua i test di riferimento pertinenti; il lavoro è completato quando vengono incluse le references attraverso il valore restituito composto senza modificare il comportamento a runtime.

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

Valutazione

Stack tecnologico
javascript, typescript
Ambito
devtools
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.