@likec4/language-server 1.24.0 → 1.24.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/dist/Rpc.js +6 -7
- package/dist/bundled.mjs +1949 -1943
- package/dist/lsp/CodeLensProvider.js +3 -2
- package/dist/lsp/DocumentLinkProvider.js +4 -13
- package/dist/model/deployments-index.d.ts +2 -3
- package/dist/model/deployments-index.js +14 -12
- package/dist/model/fqn-index.d.ts +7 -6
- package/dist/model/fqn-index.js +64 -44
- package/dist/model/model-builder.d.ts +2 -5
- package/dist/model/model-builder.js +19 -18
- package/dist/model/model-locator.d.ts +1 -1
- package/dist/model/model-locator.js +1 -1
- package/dist/model/model-parser.d.ts +148 -148
- package/dist/model/model-parser.js +26 -16
- package/dist/test/testServices.js +7 -7
- package/package.json +12 -12
package/dist/Rpc.js
CHANGED
|
@@ -4,7 +4,7 @@ import { LikeC4Model, nonexhaustive } from "@likec4/core";
|
|
|
4
4
|
import { Disposable, interruptAndCheck, URI, UriUtils } from "langium";
|
|
5
5
|
import { DiagnosticSeverity } from "vscode-languageserver";
|
|
6
6
|
import { isLikeC4LangiumDocument } from "./ast.js";
|
|
7
|
-
import {
|
|
7
|
+
import { isLikeC4Builtin } from "./likec4lib.js";
|
|
8
8
|
import {
|
|
9
9
|
buildDocuments,
|
|
10
10
|
changeView,
|
|
@@ -43,9 +43,8 @@ export class Rpc extends ADisposable {
|
|
|
43
43
|
});
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
minGapMs: 200
|
|
46
|
+
triggerAt: "both",
|
|
47
|
+
minGapMs: 350
|
|
49
48
|
}
|
|
50
49
|
);
|
|
51
50
|
let isFirstBuild = true;
|
|
@@ -63,8 +62,8 @@ export class Rpc extends ADisposable {
|
|
|
63
62
|
return { model: null };
|
|
64
63
|
}),
|
|
65
64
|
connection.onRequest(fetchModel, async (cancelToken) => {
|
|
66
|
-
const
|
|
67
|
-
return { model
|
|
65
|
+
const model = await modelBuilder.parseModel(cancelToken);
|
|
66
|
+
return { model };
|
|
68
67
|
}),
|
|
69
68
|
connection.onRequest(computeView, async ({ viewId }, cancelToken) => {
|
|
70
69
|
const view = await modelBuilder.computeView(viewId, cancelToken);
|
|
@@ -82,7 +81,7 @@ export class Rpc extends ADisposable {
|
|
|
82
81
|
connection.onRequest(buildDocuments, async ({ docs }, cancelToken) => {
|
|
83
82
|
const changed = docs.map((d) => URI.parse(d));
|
|
84
83
|
const notChanged = (uri) => changed.every((c) => !UriUtils.equals(c, uri));
|
|
85
|
-
const deleted = LangiumDocuments.all.filter((d) =>
|
|
84
|
+
const deleted = LangiumDocuments.all.toArray().filter((d) => !isLikeC4Builtin(d.uri) && isLikeC4LangiumDocument(d) && notChanged(d.uri)).map((d) => d.uri);
|
|
86
85
|
logger.debug(
|
|
87
86
|
`[ServerRpc] received request to build:
|
|
88
87
|
changed (total ${changed.length}):${docs.map((d) => "\n - " + d).join("")}
|