Skip to content

feat(vscode): add info to hover #4529

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 1 commit into from
May 26, 2025
Merged

Conversation

benfdking
Copy link
Contributor

@benfdking benfdking commented May 25, 2025

image

@benfdking benfdking force-pushed the adding_better_hover_description branch 3 times, most recently from bb34c16 to 7e51fbe Compare May 26, 2025 13:04
@benfdking benfdking requested a review from Copilot May 26, 2025 13:09
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 enhances VSCode hover tooltips by replacing plain descriptions with rich markdown tables detailing model columns.

  • Introduce generate_markdown_description to build a markdown table of columns.
  • Change Reference.description to Reference.markdown_description and wire it through LSP hover.
  • Update tests to assert on the new markdown_description content.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/lsp/test_reference.py Updated assertions to check markdown_description table
sqlmesh/lsp/description.py New file: generates markdown table from model metadata
sqlmesh/lsp/reference.py Swapped out description field for markdown_description and call generator
sqlmesh/lsp/main.py Hover now uses markdown_description for tooltip content
Comments suppressed due to low confidence (2)

sqlmesh/lsp/description.py:19

  • The variable name type shadows the built-in type; consider renaming to column_type or similar for clarity.
f"| {column} | {type} | {column_descriptions.get(column, '')} |"

sqlmesh/lsp/reference.py:29

  • The docstring still refers to description; it should be updated to markdown_description to match the actual field.
description: The description of the referenced model

@benfdking benfdking force-pushed the adding_better_hover_description branch from 7e51fbe to bf37d28 Compare May 26, 2025 13:26
@benfdking benfdking force-pushed the adding_better_hover_description branch from bf37d28 to 2c6bf25 Compare May 26, 2025 14:37
@benfdking benfdking enabled auto-merge (squash) May 26, 2025 14:37
@benfdking benfdking merged commit 9012790 into main May 26, 2025
23 checks passed
@benfdking benfdking deleted the adding_better_hover_description branch May 26, 2025 14:50
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.

1 participant