Skip to content

Commit c0b1bf7

Browse files
committed
Use Soplang 3.6 compiler analysis in VS Code
1 parent 0735f0d commit c0b1bf7

18 files changed

Lines changed: 666 additions & 113 deletions

‎.vscodeignore‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
!CHANGELOG.md
55
!LICENSE
66
!language-configuration.json
7+
!schema-configuration.json
78
!out/extension.js
89
!syntaxes/**
910
!snippets/**

‎CHANGELOG.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.1.0 (unreleased)
4+
5+
- Use the installed Soplang 3.6 language server for current source and schema analysis.
6+
- Add `schema.sop` highlighting and snippets and update the Soplang grammar.
7+
- Keep bundled 3.0 analysis as a fallback when the compiler is unavailable.
8+
- Open native definitions from the compiler's read-only source provider.
9+
- Launch the REPL explicitly with `isdhexgal` and document toolchain-free builds.
10+
311
## 1.0.0 (2026-10-19)
412

513
- Replace duplicate client implementations with one generated TypeScript entry.

‎README.md‎

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
# Soplang for Visual Studio Code
22

3-
Editor tools for the implemented Soplang 3 language. `.sop` is recommended;
3+
Editor tools for Soplang 3.6. `.sop` is recommended;
44
`.so` remains associated for existing source files. Change the language mode
55
when opening a binary shared library with that extension.
66

7-
The extension bundles a native Rust analysis server with a pinned compiler
8-
frontend. Analysis uses unsaved buffers and imports without running source,
9-
reading interactive input, compiling native code, or invoking LLVM.
7+
In a trusted workspace, the extension uses an installed Soplang 3.6 compiler's
8+
`lsp` command for current language and `schema.sop` analysis. If that compiler
9+
is unavailable, its bundled 3.0 frontend remains available for older source.
10+
Analysis uses unsaved buffers and imports without running source code.
1011

1112
Available tools include syntax highlighting, canonical snippets, compiler
1213
frontend diagnostics, visible-symbol and typed-receiver completion, English
@@ -19,10 +20,12 @@ available in the command palette. Run also works from Explorer and the editor
1920
context menu. `Ctrl+Shift+R` (`Cmd+Shift+R` on macOS) runs the selected file.
2021
Compiler tasks have interactive terminals and use executable/argument arrays.
2122

22-
Install a real Soplang 3 compiler on the extension host for execution. Set
23+
Install a real Soplang 3.6 compiler on the extension host for current analysis
24+
and execution. Set
2325
`soplang.compilerPath` to its executable path if it is absent from `PATH`.
24-
The extension does not install a compiler. Standalone builds also need the
25-
compiler's clang, rustc, and matching Soplang runtime libraries. A source debugger
26+
The extension does not install a compiler. Official 3.6 packages include the
27+
LLVM generator, linker, and matching runtime needed to build standalone programs;
28+
they do not need separate Rust or Clang installations. A source debugger
2629
requires compiler debug information and a debug adapter; neither is included.
2730

2831
```json
@@ -42,16 +45,17 @@ working directory. Save cancellation or failure prevents execution. Workspace
4245
Trust is required for compiler tasks and custom server executables. Bundled
4346
analysis works in restricted mode, with disk imports restricted to workspace
4447
roots. Execution and analysis run on the workspace extension host, including
45-
SSH, WSL, and containers when a matching native server is present.
48+
SSH, WSL, and containers when Soplang is installed there.
4649

4750
No settings are changed when the extension activates. Formatting on save is
48-
opt-in. The formatter changes leading indentation only, preserves strings,
49-
comments, operators and EOLs, and returns no edits for malformed source. Range
50-
formatting touches only indentation wholly inside the selected range.
51+
opt-in. With Soplang 3.6 installed, formatting follows the compiler's language
52+
server. The bundled fallback formatter changes leading indentation only and
53+
preserves strings, comments, operators, and EOLs.
5154

5255
Code Spell Checker is optional. The contributed `soplang` dictionary can be
5356
enabled through its language settings; no global spelling settings are changed.
5457

5558
See [the support matrix](docs/SUPPORT.md) for verification status and limits,
56-
[the language catalog](keywords.md) for signatures and contracts, and
59+
[the 3.6 language reference](https://github.com/soplang/soplang/tree/v3.6.0/docs/language)
60+
for current signatures and contracts, and
5761
[development instructions](docs/DEVELOPMENT.md) for builds and tests.

‎docs/SUPPORT.md‎

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Support and limits
22

3-
The bundled analysis frontend is Soplang 3.0.0 at compiler revision
3+
With Soplang 3.6 or later installed, the extension uses the compiler's `lsp`
4+
command for current diagnostics, completion, navigation, formatting, and
5+
`schema.sop` support. Its native definitions open through the compiler's
6+
read-only `soplang-stdlib` source provider. The bundled fallback analysis
7+
frontend is Soplang 3.0.0 at compiler revision
48
`e72c6668276fa801691ddb1c753ebbe2f73a417c`. Its source and license are vendored,
59
with upstream file hashes and local editor changes recorded in
610
`vendor/soplang-frontend`. Packages never require a sibling checkout.
@@ -14,8 +18,11 @@ or compiler tasks. Virtual filesystem workspaces are unsupported.
1418

1519
The minimum declared VS Code version is 1.95.0. Basic grammar and snippets do
1620
not need a compiler or network connection. Run/Build/REPL support real 3.x CLI
17-
flags. The pinned frontend remains a 3.0 baseline when using a newer compiler;
18-
newer language syntax needs an updated server and catalog.
21+
flags. The bundled fallback remains a 3.0 baseline; install Soplang 3.6 for
22+
current language and schema analysis. `soplang.serverPath` explicitly selects
23+
a bundled-compatible legacy analysis server and bypasses compiler discovery.
24+
25+
## Bundled fallback behavior
1926

2027
Diagnostics retain the compiler's first-error behavior and Somali messages.
2128
Only lexer, parser, and semantic analyzer errors are reported. Failures that
@@ -46,5 +53,7 @@ indexed workspace files and imports; rename cannot claim completeness beyond
4653
these limits. Large projects need a larger-project indexing design before
4754
broad refactoring can be advertised.
4855

49-
No file IO, HTTP, async, package manager, or test runner APIs are offered as
50-
implemented language features. Source debugging is a separate project.
56+
Soplang 3.6 includes files, networking, tasks, packages, web, and data APIs.
57+
Those APIs are analyzed by the installed compiler server; the fallback server
58+
does not understand all new syntax or native APIs. Source debugging is a
59+
separate project.

‎keywords.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Soplang 3 editor reference
1+
# Bundled Soplang 3.0 fallback reference
22

33
Generated from language/catalog.json. Compiler revision: e72c6668276fa801691ddb1c753ebbe2f73a417c.
44

‎out/extension.js‎

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

‎package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "soplang",
33
"displayName": "Soplang",
4-
"description": "Soplang 3 language tools, compiler diagnostics, navigation, formatting, and execution.",
5-
"version": "1.0.0",
4+
"description": "Soplang 3.6 language tools, compiler diagnostics, schema support, and execution.",
5+
"version": "1.1.0",
66
"publisher": "soplang",
77
"license": "MIT",
88
"repository": {
@@ -47,7 +47,7 @@
4747
"type": "string",
4848
"default": "",
4949
"restricted": true,
50-
"description": "Optional native language server path. Restart the language server after changing this setting."
50+
"description": "Optional path to a legacy bundled-compatible analysis server. Leave empty to use the installed Soplang 3.6 language server when available."
5151
},
5252
"soplang.workingDirectory": {
5353
"type": "string",
@@ -99,13 +99,28 @@
9999
"light": "images/soplang-logo.svg",
100100
"dark": "images/soplang-logo.svg"
101101
}
102+
},
103+
{
104+
"id": "soplang-schema",
105+
"aliases": [
106+
"Soplang Schema"
107+
],
108+
"filenames": [
109+
"schema.sop"
110+
],
111+
"configuration": "./schema-configuration.json"
102112
}
103113
],
104114
"grammars": [
105115
{
106116
"language": "soplang",
107117
"scopeName": "source.soplang",
108118
"path": "./syntaxes/soplang.tmLanguage.json"
119+
},
120+
{
121+
"language": "soplang-schema",
122+
"scopeName": "source.soplang-schema",
123+
"path": "./syntaxes/schema.tmLanguage.json"
109124
}
110125
],
111126
"keybindings": [
@@ -143,6 +158,10 @@
143158
{
144159
"language": "soplang",
145160
"path": "./snippets/soplang.json"
161+
},
162+
{
163+
"language": "soplang-schema",
164+
"path": "./snippets/schema.json"
146165
}
147166
],
148167
"cSpell.dictionaries": [
@@ -222,7 +241,8 @@
222241
"vscode-textmate": "^9.2.0"
223242
},
224243
"activationEvents": [
225-
"onLanguage:soplang"
244+
"onLanguage:soplang",
245+
"onLanguage:soplang-schema"
226246
],
227247
"main": "./out/extension.js",
228248
"extensionKind": [

‎schema-configuration.json‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"comments": {
3+
"lineComment": "#"
4+
},
5+
"brackets": [
6+
[
7+
"{",
8+
"}"
9+
]
10+
],
11+
"autoClosingPairs": [
12+
{
13+
"open": "{",
14+
"close": "}"
15+
}
16+
],
17+
"surroundingPairs": [
18+
[
19+
"{",
20+
"}"
21+
]
22+
],
23+
"wordPattern": "[a-z_][a-z0-9_]*\\??"
24+
}

‎scripts/generate.cjs‎

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,17 @@
1-
const fs=require('fs');
2-
const catalog=JSON.parse(fs.readFileSync('language/catalog.json','utf8'));
3-
const names=receiver=>[...new Set(catalog.entries.filter(e=>e.receiver===receiver).flatMap(e=>[e.name,...e.aliases]))].sort();
4-
const word='[\\p{L}\\p{N}_]';
5-
const match=values=>`(?<!${word})(?:${values.join('|')})(?!${word})`;
6-
const keywords=names('keyword').filter(n=>!['kale','tijaabi','ilaa'].includes(n));
7-
const grammar={name:'Soplang',scopeName:'source.soplang',patterns:[
8-
{name:'comment.line.double-slash.soplang',begin:'//',end:'$'},
9-
{name:'comment.block.soplang',begin:'/\\*',end:'\\*/'},
10-
...['"',"'"].map(q=>({name:'string.quoted.soplang',begin:q,end:q})),
11-
{name:'entity.name.function.soplang',match:`(?<=hawl)\\s+[\\p{L}_][\\p{L}\\p{N}_]*`},
12-
{name:'entity.name.type.class.soplang',match:`(?<=qaab)\\s+[\\p{L}_][\\p{L}\\p{N}_]*`},
13-
{name:'support.function.method.soplang',match:`(?<=\\.)\\s*(?:${[...new Set(['teed','walax','qoraal'].flatMap(names))].join('|')})(?!${word})`},
14-
{name:'keyword.control.soplang',match:match(keywords)},
15-
{name:'keyword.control.contextual.soplang',match:`${match(['tijaabi'])}(?=\\s*\\{)|${match(['kale'])}(?=\\s*\\{|\\s*\\([^{}]*\\)\\s*\\{)|${match(['ilaa'])}`},
16-
{name:'constant.language.soplang',match:match(['run','been','maran','null'])},
17-
{name:'support.function.soplang',match:match(names('global'))},
18-
{name:'constant.numeric.soplang',match:'(?<![\\p{L}\\p{N}_])\\d+(?:\\.\\d+)?'},
19-
{name:'keyword.operator.soplang',match:'==|!=|>=|<=|&&|\\|\\||[+*/%!=<>-]'},
20-
{name:'variable.other.soplang',match:'[\\p{L}_][\\p{L}\\p{N}_]*'}]};
21-
fs.writeFileSync('syntaxes/soplang.tmLanguage.json',JSON.stringify(grammar,null,2)+'\n');
22-
fs.writeFileSync('dictionaries/soplang.txt',[...new Set(catalog.entries.flatMap(e=>[e.name,...e.aliases]).concat(['run','been','maran','null','dhis','dhaw']))].sort().join('\n')+'\n');
23-
let reference='# Soplang 3 editor reference\n\nGenerated from language/catalog.json. Compiler revision: e72c6668276fa801691ddb1c753ebbe2f73a417c.\n\n';
24-
for(const e of catalog.entries){reference+=`- \`${e.receiver==='global'||e.receiver==='keyword'?'':e.receiver+'.'}${e.name}${e.receiver==='keyword'?'':'('+e.parameters.join(', ')+')'}\`${e.returns?' → '+e.returns:''}: ${e.documentation}${e.aliases.length?' Supported aliases: '+e.aliases.map(a=>'`'+a+'`').join(', ')+'.':''}\n`;}
25-
fs.writeFileSync('keywords.md',reference);
1+
const fs = require('fs');
2+
const catalog = JSON.parse(fs.readFileSync('language/catalog.json', 'utf8'));
3+
4+
// The TextMate grammar is copied from the Soplang 3.6 compiler extension.
5+
// This catalog documents the bundled 3.0 analysis fallback.
6+
const words = [...new Set(catalog.entries.flatMap(entry => [entry.name, ...entry.aliases]).concat(['run', 'been', 'maran', 'null', 'dhis', 'dhaw']))].sort();
7+
fs.writeFileSync('dictionaries/soplang.txt', words.join('\n') + '\n');
8+
9+
let reference = '# Bundled Soplang 3.0 fallback reference\n\nGenerated from language/catalog.json. Compiler revision: e72c6668276fa801691ddb1c753ebbe2f73a417c.\n\n';
10+
for (const entry of catalog.entries) {
11+
const receiver = entry.receiver === 'global' || entry.receiver === 'keyword' ? '' : `${entry.receiver}.`;
12+
const parameters = entry.receiver === 'keyword' ? '' : `(${entry.parameters.join(', ')})`;
13+
const returns = entry.returns ? ` → ${entry.returns}` : '';
14+
const aliases = entry.aliases.length ? ` Supported aliases: ${entry.aliases.map(alias => `\`${alias}\``).join(', ')}.` : '';
15+
reference += `- \`${receiver}${entry.name}${parameters}\`${returns}: ${entry.documentation}${aliases}\n`;
16+
}
17+
fs.writeFileSync('keywords.md', reference);

0 commit comments

Comments
 (0)