Skip to content
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

Syntax test assertion violations are off by one char #6499

Open
deathaxe opened this issue Sep 27, 2024 · 1 comment
Open

Syntax test assertion violations are off by one char #6499

deathaxe opened this issue Sep 27, 2024 · 1 comment

Comments

@deathaxe
Copy link
Collaborator

Description of the bug

I have a feeling, new syntax test outputs test failures with one char off.

syntax test case

    {#each objects as { id, ...rest }}
|   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ meta.embedded.block.svelte
        <li><span>{id}</span><MyComponent {...rest} /></li>
|       ^^^^^^^^^^ meta.tag
|                 ^^^^ meta.embedded.block.svelte
|                     ^^^^^^^ meta.tag
|                            ^^^^^^^^^^^^^^^^^^^^^^^^^ meta.tag.component
|                            ^ punctuation.definition.tag.begin.html
|                             ^^^^^^^^^^^ entity.name.tag.inline.form.html
|                                                     ^^^^^ meta.tag

syntax test output

Packages/Svelte/tests/syntax_test_scope.svelte:153:30
error: scope does not match
153 |         <li><span>{id}</span><MyComponent {...rest} /></li>
159 | |                             ^^^^^^^^^^^ entity.name.tag.inline.form.html
    |                               ^^^^^^^^^^^ these locations did not match
actual:
    |                               ^^^^^^^^^^^ text.html.svelte meta.tag.component.html entity.name.tag.component.svelte 

FAILED: 1 of 182 assertions in 1 files failed
[Finished]

Steps to reproduce

  1. Create a failing syntax test case
  2. Navigate to it via F4

Expected behavior

Column of failure should be 31 and caret should be located in front of MyComponent after navigating to it via F4 key.

Actual behavior

The error is the MyComponent token being mis-scoped.

Syntax error says it begins on column 30 and status bar says it placed caret on column 30 after navigating via F4.

Caret is however located in front of <.

grafik

Sublime Text build number

4183

Operating system & version

Windows 11

(Linux) Desktop environment and/or window manager

No response

Additional information

No response

OpenGL context information

No response

@jrappen
Copy link
Contributor

jrappen commented Sep 27, 2024

Context backtraces are also off by one, might be related.

Haven't checked, yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants