@likec4/language-server 1.0.0 → 1.0.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.
@@ -5,11 +5,19 @@ import { changeViewStyle } from "./changeViewStyle.js";
5
5
  function unionRangeOfAllEdits(edits) {
6
6
  let start = Number.MAX_SAFE_INTEGER;
7
7
  let end = Number.MIN_SAFE_INTEGER;
8
- for (const edit of edits) {
9
- start = Math.min(start, edit.range.start.line);
10
- end = Math.max(end, edit.range.end.line);
8
+ let startCharacter = 0;
9
+ let endCharacter = 0;
10
+ for (const { range } of edits) {
11
+ start = Math.min(start, range.start.line);
12
+ if (start === range.start.line) {
13
+ startCharacter = range.start.character;
14
+ }
15
+ end = Math.max(end, range.end.line);
16
+ if (end === range.end.line) {
17
+ endCharacter = range.end.character;
18
+ }
11
19
  }
12
- return Range.create(start, 0, end, 0);
20
+ return Range.create(start, startCharacter, end, endCharacter);
13
21
  }
14
22
  export class LikeC4ModelChanges {
15
23
  constructor(services) {
@@ -39,19 +47,12 @@ export class LikeC4ModelChanges {
39
47
  }
40
48
  });
41
49
  if (!applyResult.applied) {
42
- lspConnection.window.showErrorMessage(`Failed to apply changes${applyResult.failureReason}`);
50
+ lspConnection.window.showErrorMessage(`Failed to apply changes ${applyResult.failureReason}`);
43
51
  return;
44
52
  }
45
- const range = unionRangeOfAllEdits(edits);
46
- await lspConnection.window.showDocument({
47
- uri: textDocument.uri,
48
- external: false,
49
- takeFocus: true,
50
- selection: range
51
- });
52
53
  result = {
53
54
  uri: textDocument.uri,
54
- range
55
+ range: unionRangeOfAllEdits(edits)
55
56
  };
56
57
  });
57
58
  return result;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@likec4/language-server",
3
3
  "description": "LikeC4 Language Server",
4
- "version": "1.0.0",
4
+ "version": "1.0.1",
5
5
  "license": "MIT",
6
6
  "bugs": "https://github.com/likec4/likec4/issues",
7
7
  "homepage": "https://likec4.dev",
@@ -74,8 +74,8 @@
74
74
  "test": "vitest run"
75
75
  },
76
76
  "dependencies": {
77
- "@likec4/core": "1.0.0",
78
- "@likec4/graph": "1.0.0",
77
+ "@likec4/core": "1.0.1",
78
+ "@likec4/graph": "1.0.1",
79
79
  "@total-typescript/ts-reset": "^0.5.1",
80
80
  "fast-equals": "^5.0.1",
81
81
  "langium": "^3.0.0",
@@ -96,11 +96,11 @@
96
96
  "@types/object-hash": "^3.0.6",
97
97
  "@types/string-hash": "^1",
98
98
  "execa": "^8.0.1",
99
- "langium-cli": "^3.0.3",
99
+ "langium-cli": "3.0.3",
100
100
  "npm-run-all2": "^6.1.2",
101
101
  "typescript": "^5.4.5",
102
102
  "unbuild": "^2.0.0",
103
103
  "vitest": "~1.5.2"
104
104
  },
105
- "packageManager": "yarn@4.1.1"
105
+ "packageManager": "yarn@4.2.2"
106
106
  }