Skip to content

Commit c9f68a9

Browse files
committed
Merge branch 'master' into klinvill/tlc-options-prompt
2 parents 9a33a53 + 193c979 commit c9f68a9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+1907
-525
lines changed

.devcontainer/devcontainer.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "TLA+ VSCode",
3+
4+
"postCreateCommand": "sudo apt update && sudo apt install libxshmfence1 xvfb -y",
5+
}

.eslintrc.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
"semi-spacing": "warn",
2323
"keyword-spacing": [ "warn" ],
2424
"space-before-blocks": [ "warn" ],
25-
"@typescript-eslint/no-unused-vars": [ "warn", { "vars": "all", "args": "none", "ignoreRestSiblings": false }]
25+
"@typescript-eslint/no-unused-vars": [ "warn", { "vars": "all", "args": "none", "ignoreRestSiblings": false }],
26+
"@typescript-eslint/no-inferrable-types": [
27+
2,
28+
{
29+
"ignoreParameters": true
30+
}
31+
]
2632
}
2733
}

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v1
1313
- uses: actions/setup-node@v1
1414
with:
15-
node-version: '12.12'
15+
node-version: '14.17'
1616
- name: Install dependencies
1717
run: npm install
1818
- name: Build

.github/workflows/nightly.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Switch to nightly
4+
5+
# Calculate version
6+
VERSION=`git log -1 --format=%cd --date="format:%Y.%-m.%-d%H"`
7+
COMMIT=`git log -1 --format=%H`
8+
9+
# Change parameters in package.json
10+
(cat package.json | jq --indent 4 --arg VERSION "${VERSION}" '
11+
.version=$VERSION |
12+
.preview=true |
13+
.name="vscode-tlaplus-nightly" |
14+
.displayName="TLA+ Nightly" |
15+
.description="TLA+ language support (Nightly)" |
16+
.icon="resources/images/tlaplus-nightly.png"
17+
') > /tmp/package.json.nightly && mv /tmp/package.json.nightly package.json
18+
19+
# Add version info to CHANGELOG.md
20+
printf "## ${VERSION}\n\nCommit ${COMMIT}\n\n" | cat - CHANGELOG.md > /tmp/CHANGELOG.md.nightly && mv /tmp/CHANGELOG.md.nightly CHANGELOG.md
21+
22+
# Add header to README.md
23+
tail -n +2 README.md | cat README-nightly.md - > /tmp/README.md.nightly && mv /tmp/README.md.nightly README.md

.github/workflows/pre-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- uses: actions/checkout@v1
1616
- uses: actions/setup-node@v1
1717
with:
18-
node-version: '12.12'
18+
node-version: '14.17'
1919
- name: Get current version
2020
id: version
2121
run: echo "::set-output name=version::$(jq -r .version package.json)"

.github/workflows/release-nightly.yml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Release Nightly
2+
3+
on:
4+
schedule:
5+
- cron: "0 6 * * *"
6+
workflow_dispatch:
7+
8+
jobs:
9+
checksecret:
10+
name: check if VSCODE_MARKETPLACE_TOKEN is set in github secrets
11+
runs-on: ubuntu-latest
12+
outputs:
13+
is_MY_SECRET_set: ${{ steps.checksecret_job.outputs.is_MY_SECRET_set }}
14+
steps:
15+
- name: Check secret present
16+
id: checksecret_job
17+
env:
18+
MY_SECRET: ${{ secrets.VSCODE_MARKETPLACE_TOKEN }}
19+
run: |
20+
echo "is_MY_SECRET_set: ${{ env.MY_SECRET != '' }}"
21+
echo "::set-output name=is_MY_SECRET_set::${{ env.MY_SECRET != '' }}"
22+
23+
build:
24+
## Do not run this action without the marketplace token present,
25+
## e.g., in a fork of this repo.
26+
needs: [checksecret]
27+
if: needs.checksecret.outputs.is_MY_SECRET_set == 'true'
28+
runs-on: macOS-latest
29+
steps:
30+
- uses: actions/checkout@v1
31+
- uses: actions/setup-node@v1
32+
with:
33+
node-version: '14.17'
34+
- name: Prepare nightly
35+
run: |
36+
.github/workflows/nightly.sh
37+
git diff package.json
38+
- name: Get current version
39+
id: version
40+
run: echo "::set-output name=version::$(jq -r .version package.json)"
41+
- name: Install dependencies
42+
run: |
43+
npm install
44+
npm install -g vsce
45+
- name: Build
46+
run: |
47+
npm run vscode:prepublish
48+
vsce package
49+
- name: Check
50+
run: |
51+
npm run lint
52+
npm test --silent
53+
- name: Publish to Marketplace
54+
run: vsce publish --pat "${{ secrets.VSCODE_MARKETPLACE_TOKEN }}"
55+
- name: Publish to Open VSX
56+
run: npx ovsx publish "vscode-tlaplus-nightly-${{ steps.version.outputs.version }}.vsix" -p "${{ secrets.OPEN_VSX_TOKEN }}"

.github/workflows/release.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ jobs:
99
- uses: actions/checkout@v1
1010
- uses: actions/setup-node@v1
1111
with:
12-
node-version: '12.12'
12+
node-version: '14.17'
1313
- name: Get current version
1414
id: version
1515
run: echo "::set-output name=version::$(jq -r .version package.json)"
1616
- name: Install dependencies
1717
run: |
1818
npm install
1919
npm install -g vsce
20-
npm install -g npx
2120
- name: Build
2221
run: |
2322
npm run vscode:prepublish

.vscode/launch.json

+10
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
],
2929
"outFiles": ["${workspaceFolder}/out/tests/**/*.js"],
3030
"preLaunchTask": "npm: watch"
31+
},
32+
{
33+
"name": "Run TLA Plus Grammar Tests",
34+
"type": "node",
35+
"request": "launch",
36+
"runtimeExecutable": "npm",
37+
"args": [
38+
"run",
39+
"test:tlaplus-grammar"
40+
]
3141
}
3242
]
3343
}

CHANGELOG.md

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# Change Log
2-
31
## 1.5.4 – 21st March, 2021
42

53
### Enhancements

CONTRIBUTING.md

+36-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ For those, who whant to write some code, here's a short guide.
1010
2. The extension requires [NodeJS](https://nodejs.org/en/) runtime (12.12 at the moment).
1111
3. It's written mostly in [TypeScript](https://www.typescriptlang.org), so you'll need to install it too.
1212

13-
## Clone, Build, Test
13+
## Clone, Build, Test, Package
1414

1515
Clone the repository:
1616

@@ -33,6 +33,7 @@ Build, check and test:
3333
npm run vscode:prepublish
3434
npm run lint
3535
npm test
36+
npm run test:tlaplus-grammar
3637
```
3738

3839
## Run and Debug
@@ -57,6 +58,40 @@ To run unit tests from VS Code:
5758

5859
Or just use a hotkey for the `Start Debugging` command if the "Run Extension Tests" configuration is already selected.
5960

61+
### TLA+ Grammar Tests
62+
To run the [TLA+ grammar tests](./tests/suite/languages/GrammarTests.md) from VS Code:
63+
1. Open the project directory in VS Code.
64+
2. Switch to the [Debug and Run](https://code.visualstudio.com/docs/editor/debugging) panel.
65+
3. Select the "Run TLA+ Grammar Tests" config.
66+
67+
The output of the tests will be who under the [DEBUG CONSOLE](https://code.visualstudio.com/docs/editor/debugging) in VS Code.
68+
69+
### Test from Github Codespaces
70+
71+
To run unit tests from within a Codespace:
72+
73+
```
74+
## Install missing libraries and framebuffer x-server.
75+
## (Runs automatically in Github Codepsaces because
76+
## of `.devcontainer/devcontainer.json`).
77+
sudo apt-get install libxshmfence1 xvfb -y
78+
## Launch framebuffer x-server and force tests to use
79+
## framebuffer x-server.
80+
Xvfb -ac :99 -screen 0 1280x1024x16 &
81+
export DISPLAY=:99
82+
## Run tests.
83+
npm test
84+
```
85+
86+
### Package
87+
88+
To package the extension and create the .vsix file:
89+
90+
```
91+
npm install -g vsce
92+
vsce package
93+
```
94+
6095
# Overview
6196

6297
The extension consists of the following components:

README-nightly.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# TLA<sup>+</sup> Nightly for Visual Studio Code
2+
3+
> **ATTENTION:** This is the preview version of the [TLA<sup>+</sup> for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=alygin.vscode-tlaplus) extension, used for early feedback and testing.
4+
>
5+
> **ATTENTION:** Both the stable and nightly versions cannot be used at the same time. You must [disable](https://code.visualstudio.com/docs/editor/extension-marketplace#_disable-an-extension) or [uninstall](https://code.visualstudio.com/docs/editor/extension-marketplace#_uninstall-an-extension) one of them.
6+
7+
> TLA<sup>+</sup> Nightly:
8+
> * Is released more frequently.
9+
> * Includes features and bug fixes that may not have been tested yed.
10+
> * May include nightly builds of the TLA<sup>+</sup> tools.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TLA<sup>+</sup> for Visual Studio Code
22

3-
[![Build Status](https://img.shields.io/github/workflow/status/alygin/vscode-tlaplus/CI/master?style=flat-square)](https://github.com/alygin/vscode-tlaplus/actions?query=workflow%3ACI) [![Quality Gate](https://img.shields.io/sonar/quality_gate/alygin_vscode-tlaplus?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=alygin_vscode-tlaplus) [![VS Code extension version](https://img.shields.io/visual-studio-marketplace/i/alygin.vscode-tlaplus?color=blue&label=Visual%20Studio%20Marketplace&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=alygin.vscode-tlaplus)
3+
[![Build Status](https://img.shields.io/github/workflow/status/alygin/vscode-tlaplus/CI/master?style=flat-square)](https://github.com/alygin/vscode-tlaplus/actions?query=workflow%3ACI) [![Quality Gate](https://img.shields.io/sonar/quality_gate/alygin_vscode-tlaplus?server=https%3A%2F%2Fsonarcloud.io&style=flat-square)](https://sonarcloud.io/dashboard?id=alygin_vscode-tlaplus) [![VS Code extension version](https://img.shields.io/visual-studio-marketplace/i/alygin.vscode-tlaplus?color=blue&label=Visual%20Studio%20Marketplace&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=alygin.vscode-tlaplus) [![VS Code extension version nightly](https://img.shields.io/visual-studio-marketplace/i/alygin.vscode-tlaplus-nightly?color=blue&label=Visual%20Studio%20Marketplace&style=flat-square)](https://marketplace.visualstudio.com/items?itemName=alygin.vscode-tlaplus-nightly)
44

55
This extension adds support for the [TLA<sup>+</sup> formal specification language](http://research.microsoft.com/en-us/um/people/lamport/tla/tla.html) to VS Code. It also supports running the TLC model checker on TLA<sup>+</sup> specifications.
66

languages/cfg-grammar.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"repository": {
2525
"keywords": {
2626
"name": "keyword.control",
27-
"match": "\\b(SPECIFICATION|INVARIANT(S)?|PROPERT(Y|IES)|CONSTANT(S)?|INIT|NEXT|SYMMETRY|CONSTRAINT(S)?|ACTION_CONSTRAINT(S)?|VIEW|CHECK_DEADLOCK|POSTCONDITION)\\b"
27+
"match": "\\b(SPECIFICATION|INVARIANT(S)?|PROPERT(Y|IES)|CONSTANT(S)?|INIT|NEXT|SYMMETRY|CONSTRAINT(S)?|ACTION_CONSTRAINT(S)?|VIEW|CHECK_DEADLOCK|POSTCONDITION|ALIAS)\\b"
2828
},
2929
"line_comments": {
3030
"name": "comment.line",

0 commit comments

Comments
 (0)