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

[Bug]: Double slash comments cause wrong position for syntax highlights in scss files #559

Open
1 task done
kryp71c opened this issue May 8, 2024 · 0 comments
Open
1 task done

Comments

@kryp71c
Copy link

kryp71c commented May 8, 2024

How did you encounter this bug?

When using stylelint with stylelint-prettier, any double slash comment in an scss file will move any following error syntax highlight up by two spaces:

// some comment
.test {
  padding: 0 ;
            ^ actual error (extra space)
          ^ squggly line denoting error is shown here
}

This is cumulative. Every line that starts with a double slash following errors are moved up by two spaces. Any */ inside a double slash comment will also move following errors up by two spaces. C style multi-line comments /* */ do not have that effect.

Note the changing position of the error for the extra space in the padding rule as comments are added:
vscode-bug

Link to Minimal Reproducible Example

https://github.com/kryp71c/stylelint-vscode-bug

Code Snippet

// some comment
.test {
  padding: 0 ;
}

Stylelint Configuration

/** @type {import('stylelint').Config} */
export default{
  extends: ["stylelint-config-standard-scss", "stylelint-prettier/recommended"],
};

Extension Configuration

{
  "stylelint.validate": [
    "scss",
  ],
}

Actual Behaviour

Adding a double slash comment in an scss file moves the syntax highlight of following errors up by two spaces.

Expected Behaviour

Double slash comments don't affect the syntax highlight position.

Logs

No response

Stylelint Version

v16.5.0

vscode-stylelint Version

v1.4.0

Node.js Version

v20.13.0

Operating System

macOS Ventura 13.5.2

Windows Subsystem for Linux

No response

Code of Conduct

  • I agree to follow vscode-stylelint's Code of Conduct
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

No branches or pull requests

1 participant