github / github/vscode-github-actions
`if` statement in comment not shown as comment (syntax highlighting)
- Dominant language
- TypeScript
- Stars
- 660
- Forks
- 213
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Create a new workflow file and paste in the below code.
2. Observe how `if: ...` is highlighted incorrectly.
```yml
name: Example Workflow File
on:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: A fake step
run: echo Hello World
# This is a block comment
# The if: with a colon after it is not highlighted properly
# An if without a colon is fine.
```
**Expected behavior**
A clear and concise description of what you expected to happen.
The `if:` and following text should remain grey like a comment.
**Screenshots**
If applicable, add screenshots to help explain your problem.

**Extension Version**
`v0.26.2`
**Additional context**
Add any other context about the problem here.
This seems slightly related to #158
Contributor guide
Research direction
Start by reproducing the highlighting issue in a new workflow file using the YAML example in the issue, with extension v0.26.2. Compare comments containing `if:` with comments where `if` has no colon; done means the `if:` text and following comment text remain grey without changing other workflow highlighting.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100