@presolve/lsp 0.1.0-alpha.7 → 0.2.0-beta.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@presolve/lsp",
3
- "version": "0.1.0-alpha.7",
3
+ "version": "0.2.0-beta.1",
4
4
  "description": "LSP projection over Presolve compiler products.",
5
5
  "license": "MIT OR Apache-2.0",
6
6
  "type": "module",
@@ -11,13 +11,13 @@
11
11
  },
12
12
  "publishConfig": {
13
13
  "access": "public",
14
- "tag": "alpha"
14
+ "tag": "beta"
15
15
  },
16
16
  "exports": {
17
17
  ".": "./src/index.js"
18
18
  },
19
19
  "dependencies": {
20
- "@presolve/language-service": "0.1.0-alpha.7"
20
+ "@presolve/language-service": "0.2.0-beta.1"
21
21
  },
22
22
  "scripts": {
23
23
  "test": "node test/smoke.mjs"
package/src/index.js CHANGED
@@ -2,6 +2,7 @@ import { initializeLanguageService } from "@presolve/language-service";
2
2
 
3
3
  const requestSchema = "presolve.language-service-wasm-request";
4
4
  const supported = new Map([
5
+ ["textDocument/hover", (params) => ({ operation: "hover", querySemanticId: params.querySemanticId })],
5
6
  ["textDocument/definition", (params) => ({ operation: "definition", querySemanticId: params.querySemanticId })],
6
7
  ["textDocument/references", (params) => ({ operation: "references", querySemanticId: params.querySemanticId })],
7
8
  ["textDocument/documentSymbol", (params) => ({ operation: "documentSymbols", sourceUnitId: params.sourceUnitId })],
package/test/smoke.mjs CHANGED
@@ -10,5 +10,5 @@ const wasm = await readFile(fileURLToPath(new URL("../../compiler-wasm/dist/pres
10
10
  const lsp = await initializeLsp(wasm);
11
11
  const target = snapshot.references[0].targetQuerySemanticId;
12
12
  const unit = snapshot.sourceUnits[0].sourceUnitId;
13
- const cases = { definition:{jsonrpc:"2.0",id:1,method:"textDocument/definition",params:{querySemanticId:target}}, references:{jsonrpc:"2.0",id:2,method:"textDocument/references",params:{querySemanticId:target}}, symbols:{jsonrpc:"2.0",id:3,method:"textDocument/documentSymbol",params:{sourceUnitId:unit}}, diagnostics:{jsonrpc:"2.0",id:4,method:"textDocument/publishDiagnostics",params:{sourceUnitId:unit}}, position:{jsonrpc:"2.0",id:5,method:"presolve/position",params:{sourceUnitId:unit,offset:114}}, unsupported:{jsonrpc:"2.0",id:6,method:"textDocument/hover"}, unknown:{jsonrpc:"2.0",id:7,method:"textDocument/definition",params:{querySemanticId:"query-semantic:missing"}}, invalid:{id:8} };
13
+ const cases = { definition:{jsonrpc:"2.0",id:1,method:"textDocument/definition",params:{querySemanticId:target}}, references:{jsonrpc:"2.0",id:2,method:"textDocument/references",params:{querySemanticId:target}}, symbols:{jsonrpc:"2.0",id:3,method:"textDocument/documentSymbol",params:{sourceUnitId:unit}}, diagnostics:{jsonrpc:"2.0",id:4,method:"textDocument/publishDiagnostics",params:{sourceUnitId:unit}}, position:{jsonrpc:"2.0",id:5,method:"presolve/position",params:{sourceUnitId:unit,offset:114}}, unsupported:{jsonrpc:"2.0",id:6,method:"textDocument/rename"}, unknown:{jsonrpc:"2.0",id:7,method:"textDocument/definition",params:{querySemanticId:"query-semantic:missing"}}, invalid:{id:8}, hover:{jsonrpc:"2.0",id:9,method:"textDocument/hover",params:{querySemanticId:target}} };
14
14
  for (const [name, request] of Object.entries(cases)) if (createHash("sha256").update(JSON.stringify(lsp.dispatch(product, request))).digest("hex") !== fixtures.responseSha256[name]) throw new Error(`L12-D fixture drift: ${name}`);