Skip to content

Commit 2ecb506

Browse files
committed
chore(vscode): release 0.51.0 tracking leo-lsp 4.4.1
1 parent ac2bd5a commit 2ecb506

7 files changed

Lines changed: 55 additions & 29 deletions

File tree

CONTRIBUTING.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,13 @@ npm run package:vscode
2020

2121
## Local Leo LSP Testing
2222

23-
For local language-server validation, install `leo-lsp` so the executable is
24-
available on `PATH`, or point the extension at it explicitly with the
25-
`leo.languageServer.path` setting.
23+
For local language-server validation, install the supported `leo-lsp` version:
2624

27-
When the extension finds `leo-lsp`, it starts the Rust language server over
28-
stdio. When it does not find the binary, the extension stays in its
29-
tree-sitter-derived fallback mode instead of failing activation.
25+
```bash
26+
cargo install leo-lsp --version 4.4.1 --locked
27+
leo-lsp --version
28+
```
29+
30+
The executable must be available on `PATH`. You can also set `leo.languageServer.path` to its absolute path.
31+
32+
When the extension finds `leo-lsp`, it starts the Rust language server over stdio. When it does not find the binary, the extension uses its tree-sitter-derived fallback mode.

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/vscode/Developer.md

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
# Leo VS Code Extension
22

3-
This package contains the Leo 4.0 VS Code extension scaffold for the existing
4-
`aleohq.leo-extension` marketplace entry.
3+
This package contains the Leo VS Code extension for the existing `aleohq.leo-extension` Marketplace entry.
54

65
## Current Scope
76

87
- Leo language registration for `.leo` files
9-
- Leo 4.0-aware TextMate fallback highlighting
8+
- TextMate fallback highlighting generated from the released Leo grammar
109
- Optional `leo-lsp` startup when a local server binary is available
1110
- LSP-backed go-to-definition when `leo-lsp` advertises definition support
1211
- Approximate workspace-wide go-to-definition fallback when `leo-lsp` is unavailable
@@ -21,26 +20,20 @@ validation notes.
2120

2221
## Syncing Tree-Sitter Source
2322

24-
For current testing before a Leo 4.0 release tag exists, fetch the latest Leo
25-
`master` in the sibling checkout and then run:
23+
To test an unreleased grammar, fetch the latest Leo `master` branch in the sibling checkout and run:
2624

2725
```bash
2826
git -C ../leo fetch origin master
2927
npm run sync:tree-sitter
3028
```
3129

32-
For the actual Leo 4.0 release process, sync from the Leo 4.0 release tag
33-
instead of from `master` so the extension ships against the released language
34-
syntax:
30+
For a release, sync from the corresponding `leo-lang` tag so that the extension uses the released language syntax:
3531

3632
```bash
37-
./scripts/sync-tree-sitter-from-leo.sh ../leo <leo-4.0-tag>
33+
./scripts/sync-grammar-artifacts.sh ../leo leo-lang-v4.4.1
3834
```
3935

40-
The plan is to test from `master` for now, then publish the updated
41-
`aleohq.leo-extension` marketplace package after Leo mainnet ships. Because the
42-
extension identity stays the same, existing VS Code users should receive the
43-
update automatically.
36+
The extension identity does not change, so existing VS Code users receive Marketplace updates automatically.
4437

4538
## Generated Syntax Artifacts
4639

@@ -112,13 +105,12 @@ npm run package:vscode
112105

113106
## Manual Marketplace Publish
114107

115-
Once `VSCODE_PUBLISHER_TOKEN` is configured for this repository, maintainers can
116-
publish from the Actions tab with `.github/workflows/publish-vscode-extension.yml`.
108+
Once `VSCODE_PUBLISHER_TOKEN` is configured for this repository, maintainers can publish from the Actions tab with `.github/workflows/publish-vscode-extension.yml`.
117109

118110
The manual workflow:
119111

120112
- checks out the default branch
121-
- requires an exact version input such as `0.49.1`
113+
- requires an exact version input such as `0.51.0`
122114
- builds the extension and uploads `dist/leo-extension.vsix`
123115
- publishes `aleohq.leo-extension` to the VS Code Marketplace
124116
- leaves the repository version untouched, so a follow-up commit can sync repo

packages/vscode/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,19 @@ Today it supports:
5151
- optional `leo-lsp` startup for semantic tokens and go-to-definition when the binary is installed locally
5252
- approximate client-side go-to-definition fallback when `leo-lsp` is unavailable
5353

54+
### Install the language server
55+
56+
This extension is tested with [`leo-lsp` 4.4.1](https://github.com/ProvableHQ/leo/releases/tag/leo-lsp-v4.4.1).
57+
58+
Install the supported version from crates.io:
59+
60+
```bash
61+
cargo install leo-lsp --version 4.4.1 --locked
62+
leo-lsp --version
63+
```
64+
65+
The extension finds `leo-lsp` in the Cargo binary directory, on `PATH`, or at the path in the `leo.languageServer.path` setting. The extension continues with fallback definitions if the binary is not available.
66+
5467
### 🛠️ Migration Status
5568

5669
The previous LSP-backed implementation is being replaced as part of the migration to faster Rust-based Leo tooling.

packages/vscode/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "leo-extension",
33
"displayName": "Leo",
4-
"version": "0.50.0",
4+
"version": "0.51.0",
55
"publisher": "aleohq",
6-
"description": "The official VS Code extension for Leo",
6+
"description": "The official VS Code extension for Leo, tested with leo-lsp 4.4.1",
77
"license": "SEE LICENSE IN LICENSE.txt",
88
"engines": {
99
"vscode": "^1.82.0"
@@ -58,7 +58,7 @@
5858
"leo.languageServer.path": {
5959
"type": "string",
6060
"default": "",
61-
"markdownDescription": "Absolute or workspace-relative path to the `leo-lsp` executable. When unset, the extension searches common local development locations and `PATH`."
61+
"markdownDescription": "Absolute or workspace-relative path to the `leo-lsp` executable. This release is tested with `leo-lsp` 4.4.1. When unset, the extension searches common local development locations and `PATH`."
6262
},
6363
"leo.languageServer.args": {
6464
"type": "array",

packages/vscode/src/extension.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import * as vscode from "vscode";
22

33
import { createLeoDefinitionProvider } from "./definitionProvider";
4-
import { activateLeoLanguageServer, deactivateLeoLanguageServer } from "./languageServer";
4+
import {
5+
activateLeoLanguageServer,
6+
deactivateLeoLanguageServer,
7+
SUPPORTED_LEO_LSP_VERSION
8+
} from "./languageServer";
59

610
export function activate(context: vscode.ExtensionContext): void {
711
const selector = [{ language: "leo", scheme: "file" }];
@@ -16,7 +20,7 @@ export function activate(context: vscode.ExtensionContext): void {
1620
context.subscriptions.push(
1721
vscode.commands.registerCommand("leo-extension.about", async () => {
1822
await vscode.window.showInformationMessage(
19-
"Leo 4.0 support includes tree-sitter-derived syntax tooling, optional leo-lsp startup, LSP-backed go-to-definition when leo-lsp is available, and approximate fallback definitions when it is not."
23+
`Leo includes tree-sitter-derived syntax tooling, optional leo-lsp startup, LSP-backed go-to-definition, and approximate fallback definitions. This extension is tested with leo-lsp ${SUPPORTED_LEO_LSP_VERSION}.`
2024
);
2125
})
2226
);

packages/vscode/src/languageServer.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ const SERVER_COMMAND = "leo-lsp";
99
const LANGUAGE_SERVER_PATH_SETTING = "languageServer.path";
1010
const LANGUAGE_SERVER_ARGS_SETTING = "languageServer.args";
1111

12+
export const SUPPORTED_LEO_LSP_VERSION = "4.4.1";
13+
1214
let client: LanguageClient | undefined;
1315

1416
/**
@@ -39,7 +41,19 @@ export function activateLeoLanguageServer(
3941
client = languageClient;
4042
void languageClient.start().then(
4143
() => {
42-
outputChannel.appendLine("leo-lsp started.");
44+
const serverVersion = languageClient.initializeResult?.serverInfo?.version;
45+
if (serverVersion === SUPPORTED_LEO_LSP_VERSION) {
46+
outputChannel.appendLine(`leo-lsp ${serverVersion} started.`);
47+
} else if (serverVersion) {
48+
const compatibilityMessage =
49+
`leo-lsp ${serverVersion} started. This extension is tested with leo-lsp ${SUPPORTED_LEO_LSP_VERSION}.`;
50+
outputChannel.appendLine(compatibilityMessage);
51+
void vscode.window.showWarningMessage(compatibilityMessage);
52+
} else {
53+
outputChannel.appendLine(
54+
`leo-lsp started without reporting a version. This extension is tested with leo-lsp ${SUPPORTED_LEO_LSP_VERSION}.`
55+
);
56+
}
4357
},
4458
error => {
4559
outputChannel.appendLine(`Failed to start leo-lsp: ${describeError(error)}`);

0 commit comments

Comments
 (0)