Skip to content
This repository has been archived by the owner on Feb 7, 2024. It is now read-only.

test: add test for twoslash query notation offset #98

Merged
merged 4 commits into from
Jan 16, 2024

Conversation

jxom
Copy link
Contributor

@jxom jxom commented Jan 15, 2024

Description

It seems when I offset the query notation (^?) to a different letter of the token, it causes Shikiji to render the hover popup classes for the previous characters.

I would expect this to always render the same as if I were to put the ^? on the starting character, ie:

// Renders correctly (no hover popup)
const foobar = "123"
//    ^?

// Renders incorrectly (hover popup on first two characters)
const foobar = "123"
//      ^?

This PR adds a breaking test. Can add a fix if I get some time!

Input:

const foobar = "123"
//      ^?

Output:

Kapture 2024-01-16 at 10 47 47

Copy link

netlify bot commented Jan 15, 2024

Deploy Preview for shikiji ready!

Name Link
🔨 Latest commit 7174dee
🔍 Latest deploy log https://app.netlify.com/sites/shikiji/deploys/65a6aad95f4be20008b734a0
😎 Deploy Preview https://deploy-preview-98--shikiji.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@antfu antfu changed the title bug: twoslash query notation offset test: add test for twoslash query notation offset Jan 16, 2024
@antfu
Copy link
Owner

antfu commented Jan 16, 2024

Fixed in twoslashes/twoslash@f223176

Copy link

codecov bot commented Jan 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (ef7b614) 97.02% compared to head (b17b740) 97.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage   97.02%   97.02%           
=======================================
  Files          50       50           
  Lines        4471     4471           
  Branches      569      569           
=======================================
  Hits         4338     4338           
  Misses        131      131           
  Partials        2        2           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@antfu antfu merged commit ba420e1 into antfu:main Jan 16, 2024
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants