microsoft / microsoft/TypeScript
Find All References should include composed return value
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
🔍 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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Beispiel für ein zusammengesetztes Objekt und vergleiche die Ergebnisse von Find All References für die innere Funktion und die zurückgegebene Eigenschaft. Beginne am language-service-Einstiegspunkt von Find All References und identifiziere anschließend die relevanten Referenztests; als erledigt gilt die Aufgabe, wenn Referenzen über den zusammengesetzten Rückgabewert hinweg enthalten sind, ohne das Laufzeitverhalten zu ändern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, typescript
- Bereich
- devtools
- Issue-Typ
- Feature
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100