Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 0 additions & 42 deletions .eslintrc.json

This file was deleted.

4 changes: 1 addition & 3 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>cucumber/renovate-config"
],
"extends": ["github>cucumber/renovate-config"],
"packageRules": [
{
"matchPackageNames": ["vscode"],
Expand Down
42 changes: 21 additions & 21 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@ jobs:
- ubuntu-latest
- macos-latest
node-version:
- '22.x'
- '24.x'
- '26.x'
- "22.x"
- "24.x"
- "26.x"

steps:
- name: set git core.autocrlf to 'input'
run: git config --global core.autocrlf input
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: package-lock.json
- run: npm install-ci-test
- run: npm run vscode-types-compatible
- run: npm run update-settings-docs
- run: npm run build
- run: npm run package
- run: npm run eslint
- name: set git core.autocrlf to 'input'
run: git config --global core.autocrlf input
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: with Node.js ${{ matrix.node-version }} on ${{ matrix.os }}
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
cache-dependency-path: package-lock.json
- run: npm install-ci-test
- run: npm run vscode-types-compatible
- run: npm run update-settings-docs
- run: npm run build
- run: npm run package
- run: npm run lint
6 changes: 3 additions & 3 deletions .github/workflows/codeql-javascript.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: codeql-javascript

permissions: { }
permissions: {}

on:
push:
Expand All @@ -10,7 +10,7 @@ on:
branches:
- main
schedule:
- cron: '18 5 * * 1'
- cron: "18 5 * * 1"

concurrency:
# Cancels in-progress runs only for pull requests
Expand All @@ -20,7 +20,7 @@ concurrency:
jobs:
analyze:
name: Analyze JavaScript
runs-on: 'ubuntu-latest'
runs-on: "ubuntu-latest"
permissions:
security-events: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions: {}

on:
push:
branches: [release/*]
branches: [ release/* ]

jobs:
create-github-release:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-marketplace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ permissions: {}

on:
push:
branches: [release/*]
branches: [ release/* ]

jobs:
publish-marketplace:
Expand All @@ -17,7 +17,7 @@ jobs:
persist-credentials: false
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: '26.x'
node-version: "26.x"
package-manager-cache: false
- run: npm install-ci-test
- name: Show Dependency Manifest
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/zizmor-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ on:
push:
branches:
- main
- 'releases/**'
- "releases/**"
paths:
- '.github/**'
- ".github/**"
pull_request:
paths:
- '.github/**'
- ".github/**"

permissions: {}

Expand Down
6 changes: 0 additions & 6 deletions .prettierrc.json

This file was deleted.

8 changes: 3 additions & 5 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
]
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["biomejs.biome"]
}
12 changes: 3 additions & 9 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@
"name": "Run Extension",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}"
],
"outFiles": [
"${workspaceFolder}/dist/**/*.js"
],
"args": ["--extensionDevelopmentPath=${workspaceFolder}"],
"outFiles": ["${workspaceFolder}/dist/**/*.js"],
"log": true,
"preLaunchTask": {
"type": "npm",
Expand All @@ -25,9 +21,7 @@
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/dist/src/test/suite/index"
],
"outFiles": [
"${workspaceFolder}/dist/src/test/**/*.js"
],
"outFiles": ["${workspaceFolder}/dist/src/test/**/*.js"],
"preLaunchTask": "${defaultBuildTask}"
}
]
Expand Down
16 changes: 8 additions & 8 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.exclude": {
"dist": true // set this to false to show the "dist" folder with the compiled JS files
},
"search.exclude": {
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
"files.exclude": {
"dist": true // set this to false to show the "dist" folder with the compiled JS files
},
"search.exclude": {
"dist": true // set this to false to include "dist" folder in search results
},
// Turn off tsc task auto detection since we have the necessary tasks as npm scripts
"typescript.tsc.autoDetect": "off"
}
82 changes: 41 additions & 41 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,60 @@ The following steps will help you to get the extension up and running locally -
5. Open a `.feature` file - you should observe gherkin syntax highlighting.
6. Finally, open the Output window to view logs from the extension under `Output -> Cucumber Language Server`.

![Visual Studio Code Output](https://raw.githubusercontent.com/cucumber/vscode/main/images/vscode-output.png)
![Visual Studio Code Output](https://raw.githubusercontent.com/cucumber/vscode/main/images/vscode-output.png)

Achievement unlocked! You are now running the extension locally! 🏆

## Modifying the Language Server

Once you have completed [getting started](#getting-started), you may be wondering how you can begin modifying the implementation. 🤔

This extension uses the _Language Server Protocol_ to communicate with Visual Studio Code, which is an open protocol that allows the development of a common implementation - called a __language server__ - that can communicate with different IDEs. This implementation is stored in the [Cucumber Language Server](https://github.com/cucumber/language-server) and the underlying [Cucumber Language Service](https://github.com/cucumber/language-service). Let's integrate local versions of each into our extension so we can modify them.
This extension uses the _Language Server Protocol_ to communicate with Visual Studio Code, which is an open protocol that allows the development of a common implementation - called a **language server** - that can communicate with different IDEs. This implementation is stored in the [Cucumber Language Server](https://github.com/cucumber/language-server) and the underlying [Cucumber Language Service](https://github.com/cucumber/language-service). Let's integrate local versions of each into our extension so we can modify them.

1. First, clone the Language Server and the Language Service to the same directory in which you cloned the extension. Your directory structure should appear as follows:

```console
directory/
├── language-server/
├── language-service/
└── vscode/
```
```console
directory/
├── language-server/
├── language-service/
└── vscode/
```

2. At this point, please [download and install docker](https://www.docker.com/products/docker-desktop/) if you have not already done so. A [docker installation is required](https://github.com/cucumber/language-service/blob/main/CONTRIBUTING.md#prerequisites) to build the Language Service.
3. Now for the tricky part - we need to build and link to the packages of the repositories we've just cloned.

a. Inside the __Language Service__ repository, build and link the package to your global node modules.
a. Inside the **Language Service** repository, build and link the package to your global node modules.

When you run `npm link` in the package directory, npm creates a symlink in the global node modules directory that links to the package. This makes the package appear as if it's globally installed on your system.
When you run `npm link` in the package directory, npm creates a symlink in the global node modules directory that links to the package. This makes the package appear as if it's globally installed on your system.

```console
npm install
npm link
npm run build
```
```console
npm install
npm link
npm run build
```

b. Repeat the same inside the __Language Server__ repository, this time linking back to the Language Service we just built - so the Language Server uses our local version.
b. Repeat the same inside the **Language Server** repository, this time linking back to the Language Service we just built - so the Language Server uses our local version.

```console
npm install
npm link @cucumber/language-service
npm link
npm run build
```
```console
npm install
npm link @cucumber/language-service
npm link
npm run build
```

c. Finally, within the __extension__ repository, link back to the Language Server we just built.
c. Finally, within the **extension** repository, link back to the Language Server we just built.

```console
npm install
npm link @cucumber/language-server
```
```console
npm install
npm link @cucumber/language-server
```

You can verify that links are correctly configured by executing the below command in each respective repository
You can verify that links are correctly configured by executing the below command in each respective repository

```console
la node_modules/@cucumber
lrwxr-xr-x 1 username staff 24 Jan 22 09:32 language-server -> ../../../language-server
```
```console
la node_modules/@cucumber
lrwxr-xr-x 1 username staff 24 Jan 22 09:32 language-server -> ../../../language-server
```

4. Now open the extension repository in Visual Studio Code.
5. As before, press `F5` to build and run the extension in a new window.
Expand Down Expand Up @@ -99,23 +99,23 @@ Before submitting a pull request, there are a few actions that we must ensure to

- Format all code to align with project coding standards. This is executed by the pre-commit hook by default.

```console
npm run eslint-fix
```
```console
npm run fix
```

- Run the update command for any modifications to [extension settings](README.md#extension-settings) in `README.md`, to ensure they are reflected in `package.json`. This is executed by the pre-commit hook by default.

```console
npm run update-settings-docs
```
```console
npm run update-settings-docs
```

- Update `.vscodeignore` with the paths of any new or modified files or directories that should be included in the packaged version of the extension.

- Package the extension locally and ensure the command runs without error - see [Packaging Extensions](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#packaging-extensions) for more detail.

```console
npm run package
```
```console
npm run package
```

- [Perform manual testing](RELEASING.md#perform-manual-testing) and verify that the [extension features](README.md#features) are working as expected.

Expand Down
10 changes: 5 additions & 5 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ We haven't invested in automated tests to catch regressions.

Run the extension (opens a new window) and check all the functionality such as:

* Syntax highlighting
* Autocomplete
* Formatting
- Syntax highlighting
- Autocomplete
- Formatting

## GitHub Actions release

See [.github/RELEASING](https://github.com/cucumber/.github/blob/main/RELEASING.md).

*IMPORTANT:* After updating dependencies, revert both `engines.vscode` and `"@types/vscode"` to the *same* version.
_IMPORTANT:_ After updating dependencies, revert both `engines.vscode` and `"@types/vscode"` to the _same_ version.

Use a version that is 2 *minor* versions behind the latest version so that the extension doesn't require the latest version of Visual Studio Code.
Use a version that is 2 _minor_ versions behind the latest version so that the extension doesn't require the latest version of Visual Studio Code.
14 changes: 14 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"extends": ["./node_modules/@cucumber/biome-config/base.json"],
"files": {
"includes": ["!README.md", "!CHANGELOG.md"]
},
"linter": {
"rules": {
"correctness": {
"noUndeclaredDependencies": "off"
}
}
}
}
2 changes: 1 addition & 1 deletion images/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading