Skip to content

Align Quick Info display more closely with old language service #864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 13, 2025

Conversation

ahejlsberg
Copy link
Member

This PR more closely aligns Quick Info display (a.k.a. "hover") with the old language service.

@ahejlsberg ahejlsberg requested review from Copilot, andrewbranch and jakebailey and removed request for Copilot May 13, 2025 22:14
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors how Quick Info (hover) information is retrieved and formatted to more closely align with the previous language service behavior.

  • Refactors ProvideHover to call a new GetQuickInfoAtLocation method.
  • Introduces GetQuickInfoAtLocation in the type checker printer for centralized hover information formatting.
  • Adjusts type alias handling in GetTypeOfSymbolAtLocation for more accurate type resolution.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
internal/ls/hover.go Simplifies hover info retrieval by delegating to GetQuickInfoAtLocation.
internal/checker/printer.go Implements a centralized QuickInfo printing method and refactors type parameter printing.
internal/checker/checker.go Enhances type alias handling in type resolution within GetTypeOfSymbolAtLocation.
Comments suppressed due to low confidence (1)

internal/checker/checker.go:15174

  • The early check for a type alias might bypass scenarios where a symbol has multiple combined flags. Verify that the early return with getDeclaredTypeOfSymbol is the intended behavior for such cases.
if symbol.Flags&ast.SymbolFlagsTypeAlias != 0 {

Copy link
Member

@jakebailey jakebailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@ahejlsberg ahejlsberg added this pull request to the merge queue May 13, 2025
Merged via the queue into main with commit 9c70e77 May 13, 2025
23 checks passed
@jakebailey jakebailey deleted the improve-quick-info branch June 2, 2025 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants