release: prepare WRNexusJS 0.8.8
This commit is contained in:
@@ -68,7 +68,13 @@ test("language server starts under Node and keeps official typed components clea
|
||||
messages.push({ jsonrpc: "2.0", method: "exit", params: {} });
|
||||
|
||||
const responses = run(messages);
|
||||
assert.equal(responses.find((item) => item.id === 1)?.result?.serverInfo?.version, "0.8.3");
|
||||
const initialization = responses.find((item) => item.id === 1)?.result;
|
||||
assert.equal(initialization?.serverInfo?.version, "0.8.3");
|
||||
assert.deepEqual(initialization?.capabilities?.textDocumentSync, {
|
||||
openClose: true,
|
||||
change: 1,
|
||||
save: true,
|
||||
});
|
||||
const diagnostics = responses.filter((item) => item.method === "textDocument/publishDiagnostics");
|
||||
assert.equal(diagnostics.length, 2);
|
||||
assert.deepEqual(
|
||||
@@ -77,6 +83,36 @@ test("language server starts under Node and keeps official typed components clea
|
||||
);
|
||||
});
|
||||
|
||||
test("language server defers expensive type analysis while typing and restores it on save", () => {
|
||||
const uri = "file:///tmp/wrnexus-save-analysis.wrn";
|
||||
const valid = `component SaveAnalysis {
|
||||
outputs { save(payload: { id: string }) }
|
||||
functions { client function submit(): void { output.save({ id: "ok" }) } }
|
||||
view { <button @click="submit()"></button> }
|
||||
}`;
|
||||
const invalid = valid.replace('id: "ok"', "id: 123");
|
||||
const responses = run([
|
||||
{ jsonrpc: "2.0", id: 1, method: "initialize", params: { rootPath: root } },
|
||||
{ jsonrpc: "2.0", method: "initialized", params: {} },
|
||||
{
|
||||
jsonrpc: "2.0",
|
||||
method: "textDocument/didOpen",
|
||||
params: { textDocument: { uri, languageId: "wrn", version: 1, text: valid } },
|
||||
},
|
||||
{
|
||||
jsonrpc: "2.0",
|
||||
method: "textDocument/didChange",
|
||||
params: { textDocument: { uri, version: 2 }, contentChanges: [{ text: invalid }] },
|
||||
},
|
||||
{ jsonrpc: "2.0", method: "textDocument/didSave", params: { textDocument: { uri } } },
|
||||
{ jsonrpc: "2.0", id: 2, method: "shutdown", params: {} },
|
||||
{ jsonrpc: "2.0", method: "exit", params: {} },
|
||||
]);
|
||||
const diagnostics = responses.filter((item) => item.method === "textDocument/publishDiagnostics");
|
||||
assert.equal(diagnostics.length, 2);
|
||||
assert.ok(diagnostics.at(-1).params.diagnostics.some((item) => item.code === "WRN-TYPE-2322"));
|
||||
});
|
||||
|
||||
test("language server formatter preserves code samples and compact sibling markup", () => {
|
||||
const source = `page Docs {
|
||||
view {
|
||||
|
||||
Reference in New Issue
Block a user