microsoft / microsoft/TypeScript
Find All References should include composed return value
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
"Find all References", "find references composable", "find all references returned"
✅ Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
⭐ 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:
Using 'findAllReferences' on the function defined on the returned object itself, does return such references:
💻 Use Cases
- When editing a function in a composed store, it is common to check for references to the function being changed.
- 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.
- 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
- 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
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