microsoft / microsoft/TypeScript

Display operator informaton on mouse-over

Offen
#40,683 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Awaiting More Feedback Suggestion
Vorherrschende Sprache
Go
Sterne
111k
Forks
14.3k
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
132

Beschreibung

Search Terms

operator information definition mouse over hover preview tool-tip

Suggestion

Show a tooltip when hovering over operators like +=, %or ===. The tooltip should explain the operator.

I was told in https://github.com/microsoft/vscode/issues/107046 to apply here.

Use Cases

As a beginner developer, I usually download foreign code to help me understand implementations. Often the more experienced developers use operators I do not know. It would be very helpful if the IDE could show me a short definition of that operator when I hover my mouse over it, similar to how it tells me what a function does. Ideally it also tells me how the operator is called and gives a link to some online documentation.

Examples

When I have code like var x = condition ? 12 : (int?)null; I can hover over ? or : and it shows tool-tip like "Ternary operator: is this condition true ? yes : no".

Or a more simple example: What does x += y do? Hover: "Addition assignment: x = x + y".

Checklist

My suggestion meets these guidelines:

  • [ x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • [ x] This wouldn't change the runtime behavior of existing JavaScript code
  • [ x] This could be implemented without emitting different JS based on the types of the expressions
  • [ x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • [ x] This feature would agree with the rest of TypeScript's Design Goals.

(To be perfectly honest, I don't really understand all of the above, but I'm guessing yes..)

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, das angeforderte Hover-Verhalten für Operatoren und das verknüpfte VS Code-Issue zu prüfen. Es ist keine Implementierungsdatei, kein Test und kein Einstiegspunkt angegeben, daher besteht die erste Aufgabe darin, den relevanten Bereich des TypeScript-Sprachdienstes zu finden. Als abgeschlossen gilt die Aufgabe, wenn das Hovering über unterstützten Operatoren eine kurze Erklärung, Hinweise zur Verwendung und idealerweise Dokumentationslinks anzeigt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, typescript
Bereich
developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

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