TSServer: Find all reference for per overloaded function type

Offen
#32,989 2 Kommentare 6 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Anfängerfreundlichkeit
35/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
typescript
Bereich
devtools

Rechercherichtung

Untersuche zunächst das Verhalten von TSServer bei find-references für überladene Funktionen und wie eine ausgewählte Überladung identifiziert wird. Definiere die Fertigstellung anhand der Beispiele: Die Referenzen für Überladung 1 enthalten nur use 1, während Überladung 2 use 2 und use 3 enthält.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Awaiting More Feedback Domain: LS: Refactorings Suggestion

Search Terms

Find references, overload, function, overloaded function

Suggestion

Provide a mechanism to search references of a function with particular overloaded type

Use Cases

In current implementation find all references for overloaded function shows all references for every overload
Some times we need to find references of particular overload only (i.e. a overload is deprecated and we want to update all use cases)

Examples

/**
 * @deprecated
 **/
declare function fn():void; // overload 1
declare function fn(param:string):number; // overload  2

fn(); // use 1

const x = fn('a'); // use 2
const y = fn('b'); // use 3

Finding references for overload 1 should list use 1.
Finding references for overload 2 should list use 2 and use 3.

Checklist

My suggestion meets these guidelines:

  • 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, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.4k
Ø Merge
1 T. 19 Std.
Gemergte PRs (30 T.)
117

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus microsoft/TypeScript

Alle Issues in microsoft/TypeScript

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.