Syntax highlighting: First character of line treated as comment
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- typescript, vscode
- Domain
- tooling
Research direction
Reproduce the issue in VS Code with a qmd document and the shown keyboard shortcut for “My Quarto Preview”; compare it with “Tasks: Run Task.” Use “Developer: Inspect Editor Tokens and Scopes” to confirm the first character is classified as a comment, and consider the issue complete when starting the shortcut no longer causes that character to change color or persist after reopening the editor.
Written by the indexing model from the issue text.
Description
The first character of a line in a qmd document is (sometimes) gray instead of the color of the rest of the line. That happens with a plain paragraph, a heading (first "#"), a blockquote (">"), inside the YAML block etc.
From "Developer: Inspect Editor Tokens and Scopes", it appears that this first character is classified as a comment, and therefore has the comment color (gray in my syntax theme):
The gray color appears slightly later than the regular color, i.e. first coloring is correct, then first characters become gray, as if there is a second pass of syntax highlighting.
Strangely, this glitch is triggered when I execute a user task:
{
"label": "My Quarto Preview",
"type": "shell",
"command": "quarto-preview '${file}'",
"isBackground": true,
"presentation": {
"reveal": "always",
"panel": "new",
"close": false
},
"runOptions": {
"instanceLimit": 5,
"instancePolicy": "terminateOldest"
},
"problemMatcher": []
}
quarto-preview is a bash script which wraps quarto preview --no-browser. It implements custom port finding logic, and then copies the URL output by Quarto to the clipboard, to be pasted manually into "Simple Browser". It is a workaround for quarto preview having problems with file names or a path which contain spaces.
The script itself doesn't interact with VS Code in any way – except maybe quarto does, despite --no-browser?
Moreover, the problem is not triggered if the task is started through "Tasks: Run Task", only if started via a keyboard shortcut:
{
"key": "ctrl+shift+k",
"command": "workbench.action.tasks.runTask",
"args": "My Quarto Preview",
"when": "editorTextFocus && editorLangId == 'quarto'"
}
The problem remains after the task is stopped, and even if the editor is closed and reopened. Closing and reopening the project in VS Code reverts it.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from quarto-dev/quarto
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
quarto-dev/quarto#1099 ·
-
vscode
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
quarto-dev/quarto#934 · 1 comment · 2 reactions ·
-
vscode
Difficulty 5/5 Over a week Newbie friendliness 42/100
quarto-dev/quarto#1130 ·
-
vscode
Difficulty 3/5 1-2 days Newbie friendliness 68/100
quarto-dev/quarto#1122 ·
-
bug vscode zotero
Difficulty 4/5 3-5 days Newbie friendliness 48/100
quarto-dev/quarto#1119 · 1 comment ·
All issues in quarto-dev/quarto
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:tools bug good first issue help wanted priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
TaewoooPark/Motifcode#14 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
newrelic-experimental/preflight#793 · 1 comment ·
-
bug 🐞
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
[Bounty proposal] fix(web): memory insights count an evening memory on the next day ($25 proposed) Open
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
BasedHardware/omi#15320 ·