Skip to content

Commit dd96fba

Browse files
committed
Add more control over Rzk update checks, bump version, update changelog
1 parent 6659061 commit dd96fba

5 files changed

Lines changed: 98 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,51 @@ All notable changes to the "rzk-1-experimental-highlighting" extension will be d
44

55
Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how to structure this file.
66

7+
## v0.4.6 - 2026-05-31
8+
9+
Syntax highlighting:
10+
11+
- Extend the TextMate grammar to match the latest Rzk surface syntax. New
12+
constructs covered: block comments (`{- ... -}`), hole identifiers (`?`),
13+
modal type bracketing (`<| ... |>`), standalone `let` keyword, ASCII `_id`
14+
modality, `Unit` type and `unit` term, all tope/cube inversions
15+
(`invᵒᵖ`, `uninvᵒᵖ`, `flipᵒᵖ`, `unflipᵒᵖ` + ASCII variants), and the
16+
internal `$extract$` keyword (rendered as `invalid` to signal it is not
17+
for user code).
18+
- Fix lambda highlighting: `\` after a space (e.g. `:= \ x -> x`) now
19+
receives the lambda scope, and `->` correctly closes the lambda region.
20+
Two bugs were involved: a `\b` word-boundary in the lambda begin pattern
21+
that could not match between space and `\`, and a `#param-identifiers`
22+
regex that could match a zero-length span and silently collapse the
23+
enclosing begin/end region.
24+
- Add modal-syntax highlighting contributed by
25+
[Islam Talipov](https://github.com/LIshy2) ([#73](https://github.com/rzk-lang/vscode-rzk/pull/73)):
26+
modal-type brackets, `mod`/`let mod`, and the three Unicode modalities
27+
(``, ``, `ᵒᵖ`) plus ASCII forms.
28+
29+
UX:
30+
31+
- Suppress VS Code's automatic color decorators for Rzk files, so `#def`,
32+
`#abc`, etc. no longer get a colour-swatch preview from being mistaken
33+
for hex colour codes.
34+
- Add the `Rzk: Check for updates` command for triggering an on-demand
35+
update check ([#57](https://github.com/rzk-lang/vscode-rzk/issues/57)).
36+
- Add the `rzk.updateCheckIntervalMinutes` setting (default 60) to
37+
configure how often the extension checks GitHub for new `rzk` releases;
38+
set to `0` to disable the periodic check
39+
([#56](https://github.com/rzk-lang/vscode-rzk/issues/56)).
40+
41+
Project hygiene:
42+
43+
- Bump CI from Node 18 to Node 20 (the latest `@vscode/vsce` requires
44+
Node 20+); bump `actions/setup-node`, `actions/upload-artifact`, and
45+
`actions/download-artifact` from v3 to v4.
46+
- Add a grammar test suite (`vscode-tmgrammar-test` for inline-annotated
47+
unit tests and `vscode-tmgrammar-snap` for snapshot tests over real-world
48+
Rzk extracted from sHoTT). `npm test` runs both layers; CI invokes it.
49+
- Update the README to document `rzk.format.enable` and to mention support
50+
for `*.rzk.tex` files.
51+
752
## v0.4.5 - 2023-12-08
853

954
- Added some sensible default settings for Rzk files formatting and a message upon formatting for the first time ([#66](https://github.com/rzk-lang/vscode-rzk/pull/66))

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ Syntax and semantic highlighting for [`rzk`](https://rzk-lang.github.io/rzk/), a
1010

1111
Features:
1212

13-
1. Basic syntax highlighting with a simple TextMate grammar.
13+
1. Basic syntax highlighting with a simple TextMate grammar (for `*.rzk`, `*.rzk.md`, and `*.rzk.tex` files).
1414
2. Semantic highlighting via LSP (you must have `rzk` version v0.6 or above).
1515
3. Prompts for installing/updating `rzk` binaries from GitHub Releases automatically (usable from local Terminal).
1616
4. Markdown Preview button for `*.rzk.md` files.
1717
5. Automatic typechecking for all files listed in `rzk.yaml`
18+
6. Automatic code formatting on save (can be disabled via the `rzk.format.enable` setting).
1819

1920
See [Changelog](CHANGELOG.md) for recent updated and changes.
2021

@@ -43,7 +44,9 @@ Extension settings can be configured by going to the settings page (using the me
4344

4445
The currently available settings are:
4546

46-
| Name | Type | Default value | Description |
47-
| ---------------------- | --------- | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
48-
| `rzk.path` | `string` | `""` | The path to the `rzk` executable to use for the language server. `""` (default) means that `rzk` executable available in `PATH` will be used. |
49-
| `rzk.fetchPrereleases` | `boolean` | `false` | If true, will include releases marked as \"pre-release\" on GitHub when fetching the latest binaries. |
47+
| Name | Type | Default value | Description |
48+
| -------------------------------- | --------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
49+
| `rzk.path` | `string` | `""` | The path to the `rzk` executable to use for the language server. `""` (default) means that `rzk` executable available in `PATH` will be used. |
50+
| `rzk.fetchPrereleases` | `boolean` | `false` | If true, will include releases marked as \"pre-release\" on GitHub when fetching the latest binaries. |
51+
| `rzk.format.enable` | `boolean` | `true` | Enable the Rzk formatter (provided via LSP). Disable to opt out of formatting on save. |
52+
| `rzk.updateCheckIntervalMinutes` | `number` | `60` | How often (in minutes) to check GitHub for new releases of `rzk`. Only applies to extension-managed installations; set to `0` to disable periodic checks. You can always trigger a check via the `Rzk: Check for updates` command. |

package.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"displayName": "Rzk",
44
"description": "Interactive theorem proving support in VS Code for Rzk, a proof assistant for synthetic ∞-categories",
55
"icon": "images/icon.png",
6-
"version": "0.4.5",
6+
"version": "0.4.6",
77
"repository": "https://github.com/rzk-lang/vscode-rzk",
88
"publisher": "NikolaiKudasovfizruk",
99
"main": "./out/extension.js",
@@ -158,6 +158,12 @@
158158
"type": "boolean",
159159
"default": false,
160160
"description": "If true, will include releases marked as \"pre-release\" on GitHub when fetching the latest binaries"
161+
},
162+
"rzk.updateCheckIntervalMinutes": {
163+
"type": "number",
164+
"default": 60,
165+
"minimum": 0,
166+
"description": "How often (in minutes) to check GitHub for new releases of rzk. Only applies to extension-managed installations; set to 0 to disable periodic checks (you can still trigger a check manually via the \"Rzk: Check for updates\" command)."
161167
}
162168
}
163169
},
@@ -196,6 +202,10 @@
196202
{
197203
"command": "rzk.restartLspServer",
198204
"title": "Rzk: Restart LSP server"
205+
},
206+
{
207+
"command": "rzk.checkForUpdates",
208+
"title": "Rzk: Check for updates"
199209
}
200210
],
201211
"yamlValidation": [

src/extension.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ import * as vscode from 'vscode';
22
import { spawnSync } from 'node:child_process';
33
import { delimiter } from 'node:path';
44
import { output } from './logging';
5-
import { clearLocalInstallations, installRzkIfNotExists } from './installRzk';
5+
import {
6+
checkForUpdates,
7+
clearLocalInstallations,
8+
installRzkIfNotExists,
9+
} from './installRzk';
610
import {
711
LanguageClient,
812
LanguageClientOptions,
@@ -67,6 +71,24 @@ export function activate(context: vscode.ExtensionContext) {
6771
}
6872
);
6973

74+
vscode.commands.registerCommand('rzk.checkForUpdates', async () => {
75+
const path = locateRzk(context);
76+
if (!path) {
77+
vscode.window.showWarningMessage(
78+
'Cannot find rzk to check for updates. Configure `rzk.path` or install rzk first.'
79+
);
80+
return;
81+
}
82+
// Pass binFolder only when rzk is the extension-managed installation,
83+
// so an interactive update prompt is offered (instead of just a notice).
84+
const binExtension = process.platform === 'win32' ? '.exe' : '';
85+
const managedPath = vscode.Uri.joinPath(
86+
binFolder,
87+
'rzk' + binExtension
88+
).fsPath;
89+
await checkForUpdates(path, path === managedPath ? binFolder : undefined);
90+
});
91+
7092
let client: LanguageClient;
7193
if (rzkPath) {
7294
let serverOptions: ServerOptions = {

src/installRzk.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,16 @@ export async function installRzkIfNotExists({
7171
const path = join(binFolder.fsPath, localBin[0]);
7272
output.appendLine('Found local installation of rzk: ' + path);
7373
await checkForUpdates(path, binFolder);
74-
// Repeat the check for updates every hour
75-
// TODO: make the check period configurable by the user
76-
setInterval(() => checkForUpdates(path, binFolder), 1000 * 60 * 60);
74+
const intervalMinutes =
75+
vscode.workspace
76+
.getConfiguration()
77+
.get<number>('rzk.updateCheckIntervalMinutes') ?? 60;
78+
if (intervalMinutes > 0) {
79+
setInterval(
80+
() => checkForUpdates(path, binFolder),
81+
1000 * 60 * intervalMinutes
82+
);
83+
}
7784
return;
7885
}
7986

@@ -233,7 +240,7 @@ function buildRzkWithPackageManager(
233240
});
234241
}
235242

236-
async function checkForUpdates(binPath: string, binFolder?: vscode.Uri) {
243+
export async function checkForUpdates(binPath: string, binFolder?: vscode.Uri) {
237244
output.appendLine('Checking if updates are available');
238245
const version = spawnSync(binPath, ['version']).stdout.toString();
239246
const latestRelease = await fetchLatestCompatibleRelease();

0 commit comments

Comments
 (0)