microsoft / microsoft/vscode-css-languageservice

Improper handling of `//` and `/*` in unknown at rules in SCSS

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

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
384
Forks
217
Avg merge
3d 16h
Merged PRs (30d)
14

Description

// should not mark a comment here:

image

This compiles fine but displays an error in VS Code. Though if there were a space, for example, before the //, then it should mark a comment and throw an error.

Another example is that VS Code does not display a syntax error for this despite it throwing an error during compilation:

image

All of this also applies to /*. This should not be a comment:

image

CSS has none of these issues, while SCSS does.

Additionally, it may be worth noting that the syntax highlighting is fixed when an @each rule precedes the unknown at rule, but the parsing is still incorrect as it still shows an error despite the syntax being fine. (Not every at rule fixes the syntax highlighting, and @each is the only such one I found from my testing.)

image

Contributor guide

No contributing guide indexed for this repository

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

Reproduce the reported SCSS cases involving unknown at-rules and // or /*, including the @each example, and compare syntax highlighting with compilation errors. Trace the SCSS parsing and highlighting entry points, then verify that comments, parsing, diagnostics, and highlighting consistently match the described behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
scss, typescript
Domain
compilers, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.