← 输入框|github.com|刷新
Skip to content

Show issue hovers in Markdown/plaintext and in YAML strings - #9147

Draft
Alex Ross (alexr00) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-hover-issue-yaml-markdown
Draft

Alex Ross (alexr00) with Copilot wants to merge 4 commits into
mainfrom
copilot/fix-hover-issue-yaml-markdown

Conversation

Copilot AI commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Issue hovers don't appear in Markdown or YAML files. Outside Markdown and plaintext, shouldShowHover only allows hovers on comment tokens.

  • Markdown/plaintext: Move markdown/plaintext check into completion providers #8049 moved the Markdown/plaintext exception out of isComment and into the completion providers only. shouldShowHover still calls isComment, so issue and user hovers stopped working in prose (those tokens are Other).
  • YAML: comments already work. Issue references usually sit in string values, though, and the YAML grammar tokenizes those as String:
changes:
  - Fixed crash (#123)        # `#` not preceded by whitespace → plain scalar
  - "Quoted fix for #123"
notes: |
  Block scalar mentioning #123

Changes

  • shouldShowHover (src/issues/util.ts)
    • Returns true anywhere in markdown/plaintext, as before Move markdown/plaintext check into completion providers #8049.
    • Otherwise returns true for comment tokens, and for string tokens when the document language is in a new optional stringLanguageIds parameter.
    • Calls getTokenInformationAtPosition directly instead of going through isComment. isComment is unchanged for the completion and TODO providers.
  • IssueHoverProvider: passes ['yaml'].
  • UserHoverProvider: unchanged. YAML strings often contain @ that isn't a user (actions/checkout@v4, emails, @types/node), and each hover would trigger a user lookup.
  • Tests: shouldShowHover cases in src/test/issues/issuesUtils.test.ts, with vscode.languages.getTokenInformationAtPosition stubbed so they don't depend on grammar loading.

Review notes

  • In YAML, the issue hover now also matches digit-only hex strings like '#123456'. Unqualified references are still capped at the repo's max issue number, so these only produce a hover if that issue exists.
  • Only the yaml language ID is opted in. dockercompose and github-actions-workflow (GitHub Actions extension) stay comment-only.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix hover not working for YAML and Markdown files Show issue hovers in Markdown/plaintext and in YAML strings Nov 2, 2026
…imeout

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
…ning real documents

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
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.

Issue hover not working for YAML and Markdown files

2 participants