TryGhost / TryGhost/vscode

Hover misdetects when partial and helper are on the same line

Open
#14 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
22
Forks
2
Avg merge
8h 57m
Merged PRs (30d)
13

Description

<a class="gh-social-link gh-social-facebook" href="{{facebook_url @site.facebook}}" title="Facebook" target="_blank" rel="me noopener">{{> "icons/facebook"}}</a>

Default word detection provided by VS Code's API, uses a simple regex to isolate words. This works for most cases, where {{facebook}} is recognized as facebook. However, for something like a partial, the syntax of which relies on non-word characters, detection is more problematic.

The current custom resolver fails when a helper and partial are on the same line.

Solutions:

  • Write more advanced custom resolvers
  • Remove the default word regex and use a custom one
  • Look into using the Language Extensions API

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

No file or test path is given; begin by reproducing the hover behavior with the Handlebars line in the issue and locate the extension's custom resolver. Compare detection when the helper and partial share a line, then verify that hover detection handles both correctly without breaking the existing default cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
handlebars, typescript, vscode
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.