@volar/language-server 1.4.0-alpha.1 → 1.4.0-alpha.10

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.
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.sleep = exports.createWorkspaces = void 0;
3
4
  const vscode = require("vscode-languageserver");
@@ -110,7 +111,7 @@ function createWorkspaces(context) {
110
111
  const mode = context.initOptions.serverMode === types_1.ServerMode.PartialSemantic ? 'semantic'
111
112
  : context.initOptions.serverMode === types_1.ServerMode.Syntactic ? 'syntactic'
112
113
  : 'all';
113
- const errors = await languageService.doValidation(uri, cancel, mode, result => {
114
+ const errors = await languageService.doValidation(uri, mode, cancel, result => {
114
115
  context.server.connection.sendDiagnostics({ uri: uri, diagnostics: result, version });
115
116
  });
116
117
  context.server.connection.sendDiagnostics({ uri: uri, diagnostics: errors, version });
package/out/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
3
  if (k2 === undefined) k2 = k;
3
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.createNodeFileSystemHost = void 0;
3
4
  const vscode = require("vscode-languageserver");
@@ -48,8 +49,14 @@ function createNodeFileSystemHost(ts, capabilities, env, _initOptions) {
48
49
  return new Proxy(fn, {
49
50
  apply(target, thisArg, args) {
50
51
  if (currentCwd !== rootPath) {
51
- if (ts.sys.directoryExists(rootPath)) { // #2234, #2039
52
- process.chdir(rootPath);
52
+ // https://github.com/vuejs/language-tools/issues/2039
53
+ // https://github.com/vuejs/language-tools/issues/2234
54
+ if (ts.sys.directoryExists(rootPath)) {
55
+ // https://github.com/vuejs/language-tools/issues/2480
56
+ try {
57
+ process.chdir(rootPath);
58
+ }
59
+ catch { }
53
60
  }
54
61
  currentCwd = rootPath;
55
62
  }
package/out/node/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
2
3
  if (k2 === undefined) k2 = k;
3
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -47,11 +48,18 @@ function startLanguageServer(connection, ...plugins) {
47
48
  loadTypescript(tsdk) {
48
49
  for (const name of ['./typescript.js', './tsserverlibrary.js']) {
49
50
  try {
50
- const path = require.resolve(name, { paths: [tsdk] });
51
- return require(path);
51
+ return require(require.resolve(name, { paths: [tsdk] }));
52
52
  }
53
53
  catch { }
54
54
  }
55
+ // for bun
56
+ for (const name of ['typescript.js', 'tsserverlibrary.js']) {
57
+ try {
58
+ return require(tsdk + '/' + name);
59
+ }
60
+ catch { }
61
+ }
62
+ throw new Error(`Can't find typescript.js or tsserverlibrary.js in ${tsdk}`);
55
63
  },
56
64
  async loadTypescriptLocalized(tsdk, locale) {
57
65
  try {
package/out/protocol.d.ts CHANGED
@@ -4,12 +4,6 @@ import type { FileKind, FileRangeCapabilities } from '@volar/language-core';
4
4
  /**
5
5
  * Server request client
6
6
  */
7
- export declare namespace ShowReferencesNotification {
8
- type ResponseType = vscode.TextDocumentPositionParams & {
9
- references: vscode.Location[];
10
- };
11
- const type: vscode.NotificationType<ResponseType>;
12
- }
13
7
  export declare namespace FsReadFileRequest {
14
8
  const type: vscode.RequestType<string, Uint8Array | null | undefined, unknown>;
15
9
  }
package/out/protocol.js CHANGED
@@ -1,13 +1,10 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
- exports.ReportStats = exports.GetVirtualFileRequest = exports.GetVirtualFileNamesRequest = exports.ReloadProjectNotification = exports.WriteVirtualFilesNotification = exports.AutoInsertRequest = exports.GetMatchTsConfigRequest = exports.FindFileReferenceRequest = exports.FsReadDirectoryRequest = exports.FsReadFileRequest = exports.ShowReferencesNotification = void 0;
3
+ exports.ReportStats = exports.GetVirtualFileRequest = exports.GetVirtualFileNamesRequest = exports.ReloadProjectNotification = exports.WriteVirtualFilesNotification = exports.AutoInsertRequest = exports.GetMatchTsConfigRequest = exports.FindFileReferenceRequest = exports.FsReadDirectoryRequest = exports.FsReadFileRequest = void 0;
3
4
  const vscode = require("vscode-languageserver-protocol");
4
5
  /**
5
6
  * Server request client
6
7
  */
7
- var ShowReferencesNotification;
8
- (function (ShowReferencesNotification) {
9
- ShowReferencesNotification.type = new vscode.NotificationType('volar/server/showReferences');
10
- })(ShowReferencesNotification = exports.ShowReferencesNotification || (exports.ShowReferencesNotification = {}));
11
8
  var FsReadFileRequest;
12
9
  (function (FsReadFileRequest) {
13
10
  FsReadFileRequest.type = new vscode.RequestType('volar/server/fs/readFile');
package/out/types.d.ts CHANGED
@@ -36,12 +36,12 @@ export interface LanguageServiceContext {
36
36
  sys: FileSystem;
37
37
  }
38
38
  export interface LanguageServerPlugin {
39
- (initOptions: LanguageServerInitializationOptions): {
39
+ (initOptions: LanguageServerInitializationOptions, modules: {
40
+ typescript?: typeof import('typescript/lib/tsserverlibrary');
41
+ }): {
40
42
  extraFileExtensions?: ts.FileExtensionInfo[];
41
43
  watchFileExtensions?: string[];
42
- resolveConfig?(config: Config, modules: {
43
- typescript?: typeof import('typescript/lib/tsserverlibrary');
44
- }, ctx?: LanguageServiceContext): Config;
44
+ resolveConfig?(config: Config, ctx: LanguageServiceContext | undefined): Config;
45
45
  onInitialized?(getLanguageService: (uri: string) => Promise<LanguageService | undefined>, env: RuntimeEnvironment): void;
46
46
  };
47
47
  }
@@ -80,7 +80,6 @@ export interface LanguageServerInitializationOptions {
80
80
  };
81
81
  serverMode?: ServerMode;
82
82
  diagnosticModel?: DiagnosticModel;
83
- textDocumentSync?: vscode.TextDocumentSyncKind | number;
84
83
  /**
85
84
  * For better JSON parsing performance language server will filter CompletionList.
86
85
  *
@@ -92,7 +91,6 @@ export interface LanguageServerInitializationOptions {
92
91
  * https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#cancellation
93
92
  */
94
93
  cancellationPipeName?: string;
95
- noProjectReferences?: boolean;
96
94
  reverseConfigFilePriority?: boolean;
97
95
  disableFileWatcher?: boolean;
98
96
  maxFileSize?: number;
package/out/types.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use strict";
1
2
  Object.defineProperty(exports, "__esModule", { value: true });
2
3
  exports.DiagnosticModel = exports.ServerMode = void 0;
3
4
  var ServerMode;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volar/language-server",
3
- "version": "1.4.0-alpha.1",
3
+ "version": "1.4.0-alpha.10",
4
4
  "main": "out/index.js",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -17,8 +17,8 @@
17
17
  "directory": "packages/language-server"
18
18
  },
19
19
  "dependencies": {
20
- "@volar/language-core": "1.4.0-alpha.1",
21
- "@volar/language-service": "1.4.0-alpha.1",
20
+ "@volar/language-core": "1.4.0-alpha.10",
21
+ "@volar/language-service": "1.4.0-alpha.10",
22
22
  "@vscode/l10n": "^0.0.11",
23
23
  "request-light": "^0.7.0",
24
24
  "typesafe-path": "^0.2.2",
@@ -28,5 +28,5 @@
28
28
  "vscode-languageserver-textdocument": "^1.0.8",
29
29
  "vscode-uri": "^3.0.7"
30
30
  },
31
- "gitHead": "41ea915b137aea284e2bf5edd98a788ce21b779c"
31
+ "gitHead": "715bc5f17a0d1cadd4190712dcaff732989eb330"
32
32
  }