Skip to content

Commit 72270c2

Browse files
committed
Merge #5: feat: streamline imports and enums integration
c8bc7d7 feat: streamline imports and enums integration (Kyryl R) Pull request description: ACKs for top commit: gerau: ACK c8bc7d7; tested locally, code review Tree-SHA512: bcae18a8f882c1fd142c6900604cf9be24e1e6ea0ca848bd01a4af1c86d61f5f38a1d5282c97cd2f43e7206971c975540c4849f5b727e9554901865c5ae3ea9c
2 parents bc05d76 + c8bc7d7 commit 72270c2

18 files changed

Lines changed: 964 additions & 2023 deletions

.github/workflows/typescript.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: VS Code extension (ESLint)
1+
name: VS Code extension
22

33
on:
44
push:
@@ -16,8 +16,8 @@ on:
1616
workflow_dispatch:
1717

1818
jobs:
19-
eslint:
20-
name: Lint on Node v${{ matrix.node }}
19+
checks:
20+
name: Check on Node v${{ matrix.node }}
2121
runs-on: ubuntu-latest
2222
timeout-minutes: 10
2323

@@ -51,7 +51,7 @@ jobs:
5151
env:
5252
CI: true
5353

54-
- name: Run ESLint
55-
run: npm run eslint-check
54+
- name: Run checks
55+
run: npm run check
5656
env:
5757
CI: true

.vscodeignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ src
44
docs
55
.gitignore
66
tsconfig.json
7-
esbuild.js
7+
esbuild.mjs
88
package-lock.json
99
.github
10-
eslint.config.js
10+
.idea
11+
eslint.config.ts
1112
*.ts
13+
dist/**/*.map

README.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,29 @@ SimplicityHL is a high-level language for writing Simplicity smart contracts. Si
88

99
## Features
1010

11-
- Syntax highlighting for .simf and .wit files
12-
- Basic language configuration (brackets, comments)
11+
- Syntax highlighting and snippets for `.simf` and `.wit` files
12+
- Compiler diagnostics, completion, hover, signature help, symbols, references, and go to definition
13+
- Opt-in imports and enums support in the language server and direct compiler commands
14+
15+
The extension installs or connects to the [SimplicityHL language server](https://github.com/BlockstreamResearch/simplicityhl-lsp), which provides language intelligence:
1316

14-
Also, you can install the [SimplicityHL language server](https://github.com/distributed-lab/simplicityhl-lsp), which enables several features:
1517
- Error diagnostics
1618
![diagnostics](https://github.com/user-attachments/assets/54315645-464b-40c3-bb72-c6e8c4bc0ad5)
1719

18-
- Completion of user-defined functions and jets
20+
- Completion of user-defined functions, imported items, built-ins, and jets
1921
![completion](https://github.com/user-attachments/assets/bbc2b9de-c286-4d31-b47e-ac95885f8916)
2022

23+
## Experimental features
24+
25+
Open Settings and search for `SimplicityHL: Experimental Features`. `Imports` and `Enums` are independent checkboxes and both are disabled by default.
26+
27+
Import and module syntax requires `simplicityhl.experimentalFeatures.imports`. Enum syntax requires `simplicityhl.experimentalFeatures.enums`. The extension sends these choices to the LSP and adds the matching `-Z` flags to its direct `simc` commands and tasks.
28+
29+
The enum switch requires `simplicityhl-lsp` and `simc` 0.7.0 or newer.
2130

31+
The language server owns `Simplex.toml` discovery and imported-file analysis. The extension does not duplicate that resolver. Direct `simc` commands currently add feature flags only; they do not translate Simplex dependencies into `--dep` arguments. Use the project build tooling or invoke `simc` with the required dependency mappings for projects with external imports.
2232

33+
For local extension development, `simplicityhl.server.path` can point to a locally built `simplicityhl-lsp` binary.
2334

2435
### Development
2536

docs/development.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## Extension installation from source code
22

3-
Install Node.js (v14 or later recommended).
3+
Install Node.js 20.19 or later (Node.js 22 LTS is recommended).
44

55
### Local Installation
66

@@ -26,6 +26,10 @@ Install Node.js (v14 or later recommended).
2626
- Select "Install from VSIX..."
2727
- Navigate to and select the `.vsix` file you created
2828

29+
To test a local language-server build, set `simplicityhl.server.path` to its absolute executable path.
30+
Enable `simplicityhl.experimentalFeatures.imports` or `simplicityhl.experimentalFeatures.enums` as needed.
31+
Open a project at its Simplex root so the language server can discover its manifest.
32+
2933
### Alternative Installation Method
3034

3135
You can also install the extension directly from the source code:

esbuild.js renamed to esbuild.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ const esbuildProblemMatcherPlugin = {
5151
},
5252
};
5353

54-
main().catch((e) => {
55-
console.error(e);
54+
main().catch((error) => {
55+
console.error(error);
5656
process.exit(1);
5757
});

eslint.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default defineConfig(
3434
},
3535
},
3636
{
37-
files: ["**/*.js"],
37+
files: ["**/*.{js,mjs}"],
3838
languageOptions: {
3939
globals: {
4040
...globals.node,

0 commit comments

Comments
 (0)