@knip/language-server 2.0.1 → 2.0.2

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.
Files changed (2) hide show
  1. package/package.json +3 -3
  2. package/src/server.js +11 -7
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@knip/language-server",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/webpro-nl/knip.git",
7
7
  "directory": "packages/language-server"
8
8
  },
9
- "type": "module",
10
9
  "bin": {
11
10
  "knip-language-server": "./src/cli.js"
12
11
  },
12
+ "type": "module",
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./src/types.d.ts",
@@ -20,7 +20,7 @@
20
20
  "dependencies": {
21
21
  "vscode-languageserver": "^9.0.1",
22
22
  "vscode-languageserver-textdocument": "^1.0.12",
23
- "knip": "^5.85.0"
23
+ "knip": "^5.86.0"
24
24
  },
25
25
  "engines": {
26
26
  "node": ">=18.20.0"
package/src/server.js CHANGED
@@ -278,16 +278,20 @@ export class LanguageServer {
278
278
 
279
279
  if (changes.length === 0) return;
280
280
 
281
- const result = await this.session.handleFileChanges(changes);
281
+ try {
282
+ const result = await this.session.handleFileChanges(changes);
282
283
 
283
- if (!result) return;
284
+ if (!result) return;
284
285
 
285
- this.connection.console.log(
286
- `Module graph updated (${Math.floor(result.duration)}ms • ${(result.mem / 1024 / 1024).toFixed(2)}M)`
287
- );
286
+ this.connection.console.log(
287
+ `Module graph updated (${Math.floor(result.duration)}ms • ${(result.mem / 1024 / 1024).toFixed(2)}M)`
288
+ );
288
289
 
289
- const config = await this.getConfig();
290
- this.publishDiagnostics(this.buildDiagnostics(this.session.getIssues().issues, config, this.rules));
290
+ const config = await this.getConfig();
291
+ this.publishDiagnostics(this.buildDiagnostics(this.session.getIssues().issues, config, this.rules));
292
+ } catch (_error) {
293
+ this.connection.console.error(`Error handling file changes: ${_error}`);
294
+ }
291
295
  }
292
296
 
293
297
  /**