microsoft / microsoft/TypeScript

Display operator informaton on mouse-over

Open
#40,683 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Awaiting More Feedback Suggestion
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

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..)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the requested operator hover behavior and the linked VS Code issue. No implementation file, test, or entry point is named, so the first task is to locate the relevant TypeScript language-service area. Done means hovering supported operators shows a short explanation, usage guidance, and ideally documentation links.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, typescript
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.