cucumber / cucumber/vscode

Semantic syntax highlighting is applied in all files

Open
#305 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
88
Forks
33
PR merge metrics
No merged PRs in 30d

Description

### 👓 What did you see?

Once the extension is initialised (by opening any `.feature` file), the syntax highlighting is present in all other files.

I originally noticed this because ```#[given(regex = r"^I request `(/\w+)`$")]``` line became comment-style (grey color and italic)

Image

I then bisected my extensions to confirm this happens only when Cucumber is enabled. And then I tried just pasting the `Feature` section in some arbitrary file's multiline comment:

Image

---
`>Developer: Inspect Editor Tokens and Scopes` Before and after extension initialization:

| before | after |
|--------|--------|
| Image | Image |

### ✅ What did you expect to see?

The gherkin-specific syntax highlighting should only be applied in `.feature` files.

### 📦 Which tool/library version are you using?

```console
$ cargo -vV
cargo 1.93.0 (083ac5135 2025-12-15)
release: 1.93.0
commit-hash: 083ac5135f967fd9dc906ab057a2315861c7a80d
commit-date: 2025-12-15
host: x86_64-unknown-linux-gnu
libgit2: 1.9.1 (sys:0.20.2 vendored)
libcurl: 8.15.0-DEV (sys:0.4.83+curl-8.15.0 vendored ssl:OpenSSL/3.5.4)
ssl: OpenSSL 3.5.4 30 Sep 2025
os: Arch Linux Rolling Release [64-bit]
```

```toml
[dev-dependencies]
cucumber = "0.22.1"
```

https://marketplace.visualstudio.com/items?itemName=CucumberOpen.cucumber-official

```md
Installation
Identifier
cucumberopen.cucumber-official
Version
1.11.0
Last Updated
6 months ago
Size
13.09MB
```

```json
{
"cucumber.glue": [
"backend/e2e/**/*.rs"
],
"cucumber.features": [
"backend/e2e/**/*.feature"
]
}
```

### 🔬 How could we reproduce it?

I guess just open any file and try making a multi-line comment with gherkin syntax in it.

### 📚 Any additional context?

This is mostly a concern of the [cucumber/language-service](https://github.com/cucumber/language-service) repo, right?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.