Skip to content
Open
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
8 changes: 3 additions & 5 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ jobs:
cache: npm
- name: Install dependencies
run: npm install
- name: Compile the language client
run: npm run compile
- name: Test syntax highlighting
- name: Build the language client
run: npm run build
- name: Run all tests
run: npm test
- name: Test LSP features
run: npm run test-client
- name: Test package
run: npm run package
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ screenshots.xcf
.tmp*
.dora
client/out
*.vcl
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
],
"preLaunchTask": {
"type": "npm",
"script": "watch"
"script": "build"
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"tasks": [
{
"type": "npm",
"script": "compile",
"script": "build",
"group": "build",
"presentation": {
"panel": "dedicated",
Expand Down
5 changes: 5 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ node_modules/fastly-vcl-lsp/src/**
node_modules/fastly-vcl-language-client/src/test/**
node_modules/fastly-vcl-language-client/out/test/**
node_modules/fastly-vcl-language-client/testFixture/**
.aider*
.aider*/*
.eslintignore
.github/workflows/test.yaml
*.vcl
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

### Changed

- Refactor npm scripts and GitHub workflow configuration
- Update @vscode/test-electron to handle new VS Code builds
- Syntax highlighting improvements:
- Add 'w' (week) time unit to duration pattern
Expand Down
13 changes: 6 additions & 7 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

## Building and running this extension

You'll need [Node.js](https://nodejs.org) and [npm](https://www.npmjs.com/):
You'll need [Node.js](https://nodejs.org) and [npm](https://www.npmjs.com/):

```term
brew install npm
Expand All @@ -31,24 +31,24 @@ npm i
1. Press `Cmd+Shift+D` to switch to the **Run and Debug View** in the sidebar.
1. Select `Fastly VCL Client` from the drop down.
1. Press **▷** to run the launch config with the debugger attached (`F5`).
1. In the [Extension Development Host](https://code.visualstudio.com/api/get-started/your-first-extension#:~:text=Then%2C%20inside%20the%20editor%2C%20press%20F5.%20This%20will%20compile%20and%20run%20the%20extension%20in%20a%20new%20Extension%20Development%20Host%20window.) instance of VSCode, open a document in `Fastly VCL` language mode.
1. Save the file with a `.vcl` extension.
1. In the [Extension Development Host](https://code.visualstudio.com/api/get-started/your-first-extension#:~:text=Then%2C%20inside%20the%20editor%2C%20press%20F5.%20This%20will%20compile%20and%20run%20the%20extension%20in%20a%20new%20Extension%20Development%20Host%20window.) instance of VSCode, open a document in `Fastly VCL` language mode.
1. Save the file with a `.vcl` extension.
1. Use it as a scratchpad to try out all the features!

### Testing

To run the grammar tests:

```bash
npm test
npm run test:colorization
```

The test cases are stored as markdown files under `test/colorize-fixtures`. Grammar test results are stored under `test/colorize-results`, which are automatically generated from the fixtures.

To run the LSP tests:

```bash
npm run test-client
npm run test:e2e
```

### Packaging and installation
Expand All @@ -59,7 +59,7 @@ Run the following command to compile the VSCode extension as a `.vsix` file.
npm run package
```

Then, either run `code --install-extension vscode-fastly-vcl-{VERSION}.vsix` or follow the steps below to install the extension:
Then, either run `code --install-extension vscode-fastly-vcl-{VERSION}.vsix` or follow the steps below to install the extension:

1. Press `Cmd+Shift+X` to go to the VS Code extension tab.
1. Click the ellipsis (above "Search Extensions in Marketplace") and pick `Install from VSIX...` from the dropdown.
Expand Down Expand Up @@ -104,7 +104,6 @@ The GitHub Dark default theme maps the keyword scope to red using a JavaScript o
}
```


### Fastly VCL LSP capabilities

The [Fastly VCL Language Server Protocol (LSP) server](https://www.npmjs.com/package/fastly-vcl-lsp) works for `.vcl` files. The server is still in an early state. The following list tracks the protocol features that are supported:
Expand Down
17 changes: 11 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,20 @@
"./client"
],
"scripts": {
"test": "node ./test/runTest.mjs",
"vscode:prepublish": "npm run compile",
"compile": "tsc -b",
"watch": "tsc -b -w",
"build": "tsc -b",
"clean": "rm -rf client/out",
"dev": "tsc -b -w",
"lint": "eslint ./client/src --ext .ts,.tsx",
"test-client": "sh ./scripts/e2e.sh",
"package": "vsce package",
"prebuild": "npm run clean",
"prepackage": "npm run build && npm run lint",
"prepare": "husky install",
"pretest:e2e": "npm run build",
"publish": "vsce package",
"prepare": "husky install"
"test:colorization": "node ./test/runTest.mjs",
"test:e2e": "sh ./scripts/e2e.sh",
"test": "npm run test:colorization && npm run test:e2e",
"vscode:prepublish": "npm run build && npm run lint && npm run test"
},
"categories": [
"Programming Languages",
Expand Down
Loading