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

贡献指南

打开贡献指南

调研方向

首先,使用 issue 中的 YAML 示例,在启用 extension v0.26.2 的新 workflow 文件中复现高亮问题。比较包含 `if:` 的注释与 `if` 后没有冒号的注释;当 `if:` 文本及其后续注释文本保持灰色,且不改变 workflow 的其他高亮时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript, vscode
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。