microsoft / microsoft/TypeScript

Considering limiting hover length

Open
#37,648 1 comment 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

TypeScript Version: 3.7.x-dev.201xxxxx

Search Terms: hover, length

Code

// A *self-contained* demonstration of the problem follows...
// Test this by running `tsc` on the command-line, rather than through another build tool such as Gulp, Webpack, etc.

Expected behavior: JSDocs can always be shown

Actual behavior: JSDocs is hidden because hover is too long

image

image

Playground Link: https://www.typescriptlang.org/play/#code/FAegVGwARlAqALApgTygYwPYFsAOAbAQwEsA7JAEygBcFDqoBHAV2PQGsoyAzTKXgE79mpdNWKZSAZygB3ZAKRRCNFLiW5CAwtiTUkQ4jJ4HFVan0KkomAEYArJGIxWoAcz1RFhfPjQA3A1tMKSUyKFJMBkCBNGZQ7mZ8OUIUKQAaZVIqYjxMAWoraj8aBCMbWyl0ZkUZWiUAKQBlABFMdAwcXVJqKQA6KABJBlCkbBl8YnYlesVATAIZAUwcGj5c3CXA0qUWNk4ePiQAD3UBYiRRJQUlAAoyfW0xYi3jzWyQLF9CXFCAfgBKTK2ZgMeooOZUWxXb64NDEbhQABqTSgAGFMBQlPZ4iMEJhZJRtlBmm0OpJVrgBgBRQhSc5CCxQUZyOgMQZQXSucKEJ6STJSPjsxTobz6KgqKoXLQSJm5YhEBl8eT0bZoKR4glUXQALmgsAAApptNgmMwDGhEDszbF+PkoLYiAh7Y7nYQEHqoPrjjoCEgPQADQP2KQe7hkCgAeXINwA3q6nQBff4AbgDgY9HoAgtlVlAKHwBbpaGQ3Hn4dwDBdqLqYFA0-7g6Hw1GkLHbZggVpMsr9DEoEn63qQMBMegFUpEqJxOSw9kWwAeOAAPhuLHN2vg-w3AAUltgjEh5wAlJCEfOkPyLpdL1OgECmvZcUi8KDXYCzyPRmPQGzkDcARnSH9qFkTANwAJiAqBSkUJANwAZig20ag3AAWJCw0CDcAFYkLpI4NwANjwpBAlIDcAHYkKQYg3AQasoAADmAAcgA

Related Issues: https://github.com/microsoft/vscode/issues/92787

It seems certain type hover will be formatted to one property each line. I'm wondering if you could only adopt this behavior when the total lines do not exceed a threshold (like 10 lines), so it wouldn't affect JSDocs.

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 reproducing the hover behavior with the provided Playground Link and compare the expected and actual displays, including the linked VS Code issue. Investigate the hover formatting behavior and determine how a line threshold could preserve JSDoc visibility without changing shorter type hovers. Done means long hovers still show JSDocs while the proposed formatting remains for shorter hovers.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
developer-experience
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.