github / github/vscode-github-actions

`if` statement in comment not shown as comment (syntax highlighting)

未關閉
#259 1 則留言 1 個 reaction 已指派 0 人 在 GitHub 檢視
bug
主要語言
TypeScript
星號
660
分支
213
PR 合併指標
30 天內沒有已合併 PR

描述

**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.

![image](https://github.com/github/vscode-github-actions/assets/91494019/d6aca271-4675-445b-a98a-69bc62bf7079)

**Extension Version**
`v0.26.2`

**Additional context**
Add any other context about the problem here.

This seems slightly related to #158

貢獻指南

開啟貢獻指南

研究方向

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.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
typescript, vscode
領域
tooling
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。