@lokascript/language-server 2.11.1 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/README.md +20 -18
- package/dist/server.js +244 -148
- package/package.json +9 -11
- package/dist/dist-QIYYJ23V.js +0 -7889
- package/dist/server.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,14 @@ All notable changes to `@lokascript/language-server` will be documented in this
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
> **Superseded by the root changelog.** Every package in this monorepo publishes
|
|
9
|
+
> in lockstep at the root version, and the entries below use an older
|
|
10
|
+
> per-package numbering that no published version ever matched. They are kept
|
|
11
|
+
> for the migration notes they carry; they are not a record of recent releases.
|
|
12
|
+
> **For anything since, see
|
|
13
|
+
> [the monorepo CHANGELOG](https://github.com/codetalcott/hyperfixi/blob/main/CHANGELOG.md)**
|
|
14
|
+
> and [GitHub Releases](https://github.com/codetalcott/hyperfixi/releases).
|
|
15
|
+
|
|
8
16
|
## [1.0.0] - 2026-02-05
|
|
9
17
|
|
|
10
18
|
### Added
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The language server supports four operating modes:
|
|
|
15
15
|
|
|
16
16
|
### Mode Selection
|
|
17
17
|
|
|
18
|
-
- **auto** (default):
|
|
18
|
+
- **auto** (default): `lokascript` mode when the semantic package exposes its API; `hyperscript` mode in builds that replace it with a shim (the standalone `hyperscript-vscode` extension does this)
|
|
19
19
|
- **hyperscript**: Enforces \_hyperscript-compatible syntax, English keywords only
|
|
20
20
|
- **hyperscript-i18n**: Enforces \_hyperscript-compatible syntax with multilingual keyword support. Use this if you have original \_hyperscript with `@lokascript/hyperscript-adapter` for writing in non-English languages
|
|
21
21
|
- **lokascript**: Enables all features including LokaScript extensions and multilingual support
|
|
@@ -50,9 +50,11 @@ This allows LokaScript users to maintain \_hyperscript compatibility by using `h
|
|
|
50
50
|
|
|
51
51
|
### Multilingual Support
|
|
52
52
|
|
|
53
|
-
Works with hyperscript written in any of
|
|
53
|
+
Works with hyperscript written in any of the 24 supported languages:
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
ar (Arabic), bn (Bengali), de (German), en (English), es (Spanish), fr (French), he (Hebrew), hi (Hindi), id (Indonesian), it (Italian), ja (Japanese), ko (Korean), ms (Malay), pl (Polish), pt (Portuguese), qu (Quechua), ru (Russian), sw (Swahili), th (Thai), tl (Tagalog), tr (Turkish), uk (Ukrainian), vi (Vietnamese), zh (Chinese)
|
|
56
|
+
|
|
57
|
+
In `lokascript` and `hyperscript-i18n` modes the server parses each region with the semantic front-end in the configured `language`, falling back to auto-detection across the other languages when that fails. When the front-end accepts a region in a non-English language, the English core parser's errors for that region are suppressed (the core parser is English-only, and its "unexpected token" on valid Spanish is noise, not a diagnostic).
|
|
56
58
|
|
|
57
59
|
### HTML Support
|
|
58
60
|
|
|
@@ -113,7 +115,13 @@ require('lspconfig').lokascript.setup{}
|
|
|
113
115
|
|
|
114
116
|
## Configuration
|
|
115
117
|
|
|
116
|
-
The server
|
|
118
|
+
The server reads its settings three ways, and every field is optional (a partial object is merged over the defaults):
|
|
119
|
+
|
|
120
|
+
1. `initializationOptions` on `initialize` (both VS Code extensions pass `{ language }` here);
|
|
121
|
+
2. a `workspace/didChangeConfiguration` push carrying a `lokascript` or `hyperscript` section (vscode-languageclient only sends one when the client sets `synchronize.configurationSection`; both bundled extensions do);
|
|
122
|
+
3. a `workspace/configuration` pull for the `lokascript` and `hyperscript` sections, made at startup and whenever a push arrives with no payload, for clients that advertise the capability.
|
|
123
|
+
|
|
124
|
+
When both namespaces are present the `lokascript` one wins, unless the server was launched with `HYPERSCRIPT_LS_DEFAULT_MODE` set (the standalone hyperscript product), in which case `hyperscript` wins.
|
|
117
125
|
|
|
118
126
|
```json
|
|
119
127
|
{
|
|
@@ -218,13 +226,10 @@ For users who prefer the `hyperscript` namespace:
|
|
|
218
226
|
|
|
219
227
|
## Dependencies
|
|
220
228
|
|
|
221
|
-
|
|
229
|
+
- `@lokascript/semantic` and `@lokascript/framework` are **required** (regular dependencies): the semantic package registers the 24 languages at startup, and the framework renders the LSE bracket notation shown in hover. They used to be declared as optional peers while being imported statically, so a server installed without them crashed at startup instead of falling back.
|
|
230
|
+
- `@hyperfixi/core` is an **optional** peer. With it the server surfaces real parse errors, complexity diagnostics and schema-inferred roles in hover; without it, diagnostics degrade to the pattern-based quote/bracket checks and hover uses built-in fallback docs.
|
|
222
231
|
|
|
223
|
-
|
|
224
|
-
- `@lokascript/ast-toolkit` - Enables AST-based analysis and complexity metrics
|
|
225
|
-
- `@lokascript/core` - Enables full hyperscript parsing and AST-based formatting
|
|
226
|
-
|
|
227
|
-
Without these dependencies, the server falls back to pattern-based analysis (English only).
|
|
232
|
+
A bundler that wants an English-only, dependency-free server (the standalone `hyperscript-vscode` extension) replaces the semantic, framework and core imports with throwing or empty shims at bundle time; the server's capability probes are written for that case.
|
|
228
233
|
|
|
229
234
|
## Development
|
|
230
235
|
|
|
@@ -247,7 +252,7 @@ npm test -- --coverage
|
|
|
247
252
|
|
|
248
253
|
## Architecture
|
|
249
254
|
|
|
250
|
-
The language server is
|
|
255
|
+
The language server entry point is `server.ts` (LSP wiring and the request handlers), with the testable logic in sibling modules — `extraction.ts` (HTML region extraction and position mapping), `simple-diagnostics.ts`, `command-tiers.ts` (the _hyperscript-compatibility allowlists), `symbol-table.ts` (definition/references/rename), `document-symbols.ts`, `completion-context.ts`, `formatting.ts` and `localized-descriptions.ts`. Together they:
|
|
251
256
|
|
|
252
257
|
1. **Extracts** hyperscript regions from HTML documents
|
|
253
258
|
2. **Analyzes** code using semantic parsing (multilingual) or pattern-based fallback
|
|
@@ -299,13 +304,10 @@ npm test -- --run src/server.test.ts
|
|
|
299
304
|
|
|
300
305
|
Test categories:
|
|
301
306
|
|
|
302
|
-
- HTML document detection
|
|
303
|
-
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
- Find References
|
|
307
|
-
- Code Formatting
|
|
308
|
-
- LSP integration tests
|
|
307
|
+
- Unit tests against the shipped modules: HTML document detection, region extraction, position mapping, the symbol table (definition, references, rename), document symbols, completion context, formatting, diagnostics, and the compatibility allowlists
|
|
308
|
+
- `lsp-integration.test.ts` spawns the built `dist/server.js` over stdio and speaks JSON-RPC: diagnostics publishing (including the non-English cases), completions, hover, symbols, definition, references, rename, formatting, code actions, configuration changes in both push and pull form, and the `lokascript/translateWithVerification` request
|
|
309
|
+
|
|
310
|
+
`npm test` rebuilds this package first (`pretest`), and refreshes any stale sibling `dist/` the integration suite resolves through the workspace.
|
|
309
311
|
|
|
310
312
|
## License
|
|
311
313
|
|