@volar/language-server 2.3.1 → 2.3.3

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/browser.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare function createServer(connection: vscode.Connection): {
31
31
  dispose: () => void;
32
32
  };
33
33
  clearPushDiagnostics: () => void;
34
- refresh: (projects: import("./index").LanguageServerProject) => Promise<void>;
34
+ refresh: (project: import("./index").LanguageServerProject) => Promise<void>;
35
35
  };
36
36
  export declare function loadTsdkByUrl(tsdkUrl: string, locale: string | undefined): Promise<{
37
37
  typescript: typeof import("typescript");
@@ -83,8 +83,9 @@ function registerEditorFeatures(server) {
83
83
  }
84
84
  });
85
85
  server.connection.onNotification(protocol_1.WriteVirtualFilesNotification.type, async (params) => {
86
- const fsModeName = 'fs'; // avoid bundle
87
- const fs = await import(fsModeName);
86
+ // webpack compatibility
87
+ const _require = eval('require');
88
+ const fs = _require('fs');
88
89
  const uri = vscode_uri_1.URI.parse(params.uri);
89
90
  const languageService = (await server.project.getLanguageService(uri));
90
91
  if (languageService.context.language.typescript) {
package/lib/server.d.ts CHANGED
@@ -29,5 +29,5 @@ export declare function createServerBase(connection: vscode.Connection, fs: File
29
29
  dispose: () => void;
30
30
  };
31
31
  clearPushDiagnostics: () => void;
32
- refresh: (projects: LanguageServerProject) => Promise<void>;
32
+ refresh: (project: LanguageServerProject) => Promise<void>;
33
33
  };
package/lib/server.js CHANGED
@@ -376,14 +376,14 @@ function createServerBase(connection, fs) {
376
376
  });
377
377
  }
378
378
  }
379
- function activateServerPushDiagnostics(projects) {
379
+ function activateServerPushDiagnostics(project) {
380
380
  documents.onDidChangeContent(({ document }) => {
381
- pushAllDiagnostics(projects, document.uri);
381
+ pushAllDiagnostics(project, document.uri);
382
382
  });
383
383
  documents.onDidClose(({ document }) => {
384
384
  connection.sendDiagnostics({ uri: document.uri, diagnostics: [] });
385
385
  });
386
- onDidChangeConfiguration(() => refresh(projects));
386
+ onDidChangeConfiguration(() => refresh(project));
387
387
  }
388
388
  function clearPushDiagnostics() {
389
389
  if (!status.pullModelDiagnostics) {
@@ -392,10 +392,10 @@ function createServerBase(connection, fs) {
392
392
  }
393
393
  }
394
394
  }
395
- async function refresh(projects) {
395
+ async function refresh(project) {
396
396
  const req = ++semanticTokensReq;
397
397
  if (!status.pullModelDiagnostics) {
398
- await pushAllDiagnostics(projects);
398
+ await pushAllDiagnostics(project);
399
399
  }
400
400
  const delay = 250;
401
401
  await sleep(delay);
@@ -411,7 +411,7 @@ function createServerBase(connection, fs) {
411
411
  }
412
412
  }
413
413
  }
414
- async function pushAllDiagnostics(projects, docUri) {
414
+ async function pushAllDiagnostics(project, docUri) {
415
415
  const req = ++documentUpdatedReq;
416
416
  const delay = 250;
417
417
  const token = {
@@ -427,19 +427,19 @@ function createServerBase(connection, fs) {
427
427
  if (token.isCancellationRequested) {
428
428
  return;
429
429
  }
430
- await pushDiagnostics(projects, changeDoc.uri, changeDoc.version, token);
430
+ await pushDiagnostics(project, changeDoc.uri, changeDoc.version, token);
431
431
  }
432
432
  for (const doc of otherDocs) {
433
433
  await sleep(delay);
434
434
  if (token.isCancellationRequested) {
435
435
  break;
436
436
  }
437
- await pushDiagnostics(projects, doc.uri, doc.version, token);
437
+ await pushDiagnostics(project, doc.uri, doc.version, token);
438
438
  }
439
439
  }
440
- async function pushDiagnostics(projects, uriStr, version, cancel) {
440
+ async function pushDiagnostics(project, uriStr, version, cancel) {
441
441
  const uri = vscode_uri_1.URI.parse(uriStr);
442
- const languageService = (await projects.getLanguageService(uri));
442
+ const languageService = await project.getLanguageService(uri);
443
443
  const errors = await languageService.getDiagnostics(uri, cancel, result => {
444
444
  connection.sendDiagnostics({ uri: uriStr, diagnostics: result, version });
445
445
  });
package/node.d.ts CHANGED
@@ -31,7 +31,7 @@ export declare function createServer(connection: vscode.Connection): {
31
31
  dispose: () => void;
32
32
  };
33
33
  clearPushDiagnostics: () => void;
34
- refresh: (projects: import("./index").LanguageServerProject) => Promise<void>;
34
+ refresh: (project: import("./index").LanguageServerProject) => Promise<void>;
35
35
  };
36
36
  export declare const fs: FileSystem;
37
37
  export declare function loadTsdkByPath(tsdk: string, locale: string | undefined): {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-server",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -12,10 +12,10 @@
12
12
  "directory": "packages/language-server"
13
13
  },
14
14
  "dependencies": {
15
- "@volar/language-core": "2.3.1",
16
- "@volar/language-service": "2.3.1",
17
- "@volar/snapshot-document": "2.3.1",
18
- "@volar/typescript": "2.3.1",
15
+ "@volar/language-core": "2.3.3",
16
+ "@volar/language-service": "2.3.3",
17
+ "@volar/snapshot-document": "2.3.3",
18
+ "@volar/typescript": "2.3.3",
19
19
  "path-browserify": "^1.0.1",
20
20
  "request-light": "^0.7.0",
21
21
  "vscode-languageserver": "^9.0.1",
@@ -26,5 +26,5 @@
26
26
  "devDependencies": {
27
27
  "@types/path-browserify": "latest"
28
28
  },
29
- "gitHead": "51742317a2950abd97e1a1a266b2c137bede4ad3"
29
+ "gitHead": "08802f144de6ff05a86b99df1f55a5ba243cc926"
30
30
  }