Skip to content

Fix first character of non-code lines highlighted as a comment - #1155

Open
RDust4 wants to merge 1 commit into
quarto-dev:mainfrom
RDust4:fix/semantic-tokens-filler-lines
Open

RDust4 wants to merge 1 commit into
quarto-dev:mainfrom
RDust4:fix/semantic-tokens-filler-lines

Conversation

@RDust4

@RDust4 RDust4 commented Sep 27, 2026

Copy link
Copy Markdown

Fixes #985.

Semantic tokens for code cells come from a virtual doc where every non-cell line is a # filler.
Language servers that emit comment tokens colored the first character of each paragraph, heading and YAML line as a comment.

Now only tokens on lines inside the language's code cells are kept.
This also drops tokens on the virtual doc's injected header lines (e.g. # type: ignore), which mapped to negative lines and made the provider throw, losing semantic highlighting for Python cells.

Adds a unit test for unadjustedSemanticTokens.

@posit-snyk-bot

posit-snyk-bot commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

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

Successfully merging this pull request may close these issues.

Syntax highlighting: First character of line treated as comment

2 participants