@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 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 { Scheme } from "./likec4lib.js";
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
- minQuietPeriodMs: 250,
47
- maxBurstDurationMs: 1e3,
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 parsed = await modelBuilder.parseModel(cancelToken);
67
- return { model: parsed?.model ?? null };
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) => isLikeC4LangiumDocument(d) && notChanged(d.uri) && d.uri.scheme !== Scheme).map((d) => d.uri).toArray();
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("")}