typescript-language-server 0.6.5 → 0.8.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/CHANGELOG.md +84 -0
- package/README.md +105 -30
- package/lib/cli.js +4 -4
- package/lib/cli.js.map +1 -1
- package/lib/commands.d.ts +3 -0
- package/lib/commands.d.ts.map +1 -1
- package/lib/commands.js +4 -1
- package/lib/commands.js.map +1 -1
- package/lib/completion.d.ts +4 -1
- package/lib/completion.d.ts.map +1 -1
- package/lib/completion.js +171 -19
- package/lib/completion.js.map +1 -1
- package/lib/diagnostic-queue.d.ts +3 -0
- package/lib/diagnostic-queue.d.ts.map +1 -1
- package/lib/diagnostic-queue.js +14 -3
- package/lib/diagnostic-queue.js.map +1 -1
- package/lib/logger.d.ts.map +1 -1
- package/lib/logger.js +1 -0
- package/lib/logger.js.map +1 -1
- package/lib/lsp-connection.d.ts.map +1 -1
- package/lib/lsp-connection.js +2 -0
- package/lib/lsp-connection.js.map +1 -1
- package/lib/lsp-server.d.ts +7 -12
- package/lib/lsp-server.d.ts.map +1 -1
- package/lib/lsp-server.js +174 -52
- package/lib/lsp-server.js.map +1 -1
- package/lib/lsp-server.spec.js +213 -10
- package/lib/lsp-server.spec.js.map +1 -1
- package/lib/organize-imports.d.ts +2 -1
- package/lib/organize-imports.d.ts.map +1 -1
- package/lib/organize-imports.js +7 -5
- package/lib/organize-imports.js.map +1 -1
- package/lib/organize-imports.spec.js +14 -7
- package/lib/organize-imports.spec.js.map +1 -1
- package/lib/protocol-translation.js +7 -10
- package/lib/protocol-translation.js.map +1 -1
- package/lib/semantic-tokens.d.ts +9 -0
- package/lib/semantic-tokens.d.ts.map +1 -0
- package/lib/semantic-tokens.js +47 -0
- package/lib/semantic-tokens.js.map +1 -0
- package/lib/test-utils.d.ts.map +1 -1
- package/lib/test-utils.js +4 -2
- package/lib/test-utils.js.map +1 -1
- package/lib/ts-protocol.d.ts +19 -0
- package/lib/ts-protocol.d.ts.map +1 -1
- package/lib/ts-protocol.js +10 -1
- package/lib/ts-protocol.js.map +1 -1
- package/lib/tsp-client.d.ts +7 -1
- package/lib/tsp-client.d.ts.map +1 -1
- package/lib/tsp-client.js +24 -14
- package/lib/tsp-client.js.map +1 -1
- package/lib/tsp-client.spec.js +74 -82
- package/lib/tsp-client.spec.js.map +1 -1
- package/lib/tsp-command-types.d.ts +14 -1
- package/lib/tsp-command-types.d.ts.map +1 -1
- package/lib/tsp-command-types.js +21 -1
- package/lib/tsp-command-types.js.map +1 -1
- package/lib/utils/SnippetString.d.ts +12 -0
- package/lib/utils/SnippetString.d.ts.map +1 -0
- package/lib/utils/SnippetString.js +69 -0
- package/lib/utils/SnippetString.js.map +1 -0
- package/lib/utils/api.d.ts +45 -0
- package/lib/utils/api.d.ts.map +1 -0
- package/lib/utils/api.js +95 -0
- package/lib/utils/api.js.map +1 -0
- package/lib/utils/configuration.d.ts +10 -0
- package/lib/utils/configuration.d.ts.map +1 -0
- package/lib/utils/configuration.js +3 -0
- package/lib/utils/configuration.js.map +1 -0
- package/lib/utils/modules-resolver.d.ts +2 -0
- package/lib/utils/modules-resolver.d.ts.map +1 -0
- package/lib/{modules-resolver.js → utils/modules-resolver.js} +8 -22
- package/lib/utils/modules-resolver.js.map +1 -0
- package/lib/{modules-resolver.spec.d.ts → utils/modules-resolver.spec.d.ts} +0 -0
- package/lib/utils/modules-resolver.spec.d.ts.map +1 -0
- package/lib/{modules-resolver.spec.js → utils/modules-resolver.spec.js} +9 -9
- package/lib/utils/modules-resolver.spec.js.map +1 -0
- package/lib/utils/typeConverters.d.ts +11 -0
- package/lib/utils/typeConverters.d.ts.map +1 -0
- package/lib/utils/typeConverters.js +22 -0
- package/lib/utils/typeConverters.js.map +1 -0
- package/lib/utils/versionProvider.d.ts +30 -0
- package/lib/utils/versionProvider.d.ts.map +1 -0
- package/lib/utils/versionProvider.js +147 -0
- package/lib/utils/versionProvider.js.map +1 -0
- package/lib/utils.d.ts +0 -1
- package/lib/utils.d.ts.map +1 -1
- package/lib/utils.js +1 -8
- package/lib/utils.js.map +1 -1
- package/package.json +31 -17
- package/lib/modules-resolver.d.ts +0 -3
- package/lib/modules-resolver.d.ts.map +0 -1
- package/lib/modules-resolver.js.map +0 -1
- package/lib/modules-resolver.spec.d.ts.map +0 -1
- package/lib/modules-resolver.spec.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modules-resolver.spec.js","sourceRoot":"","sources":["../../src/utils/modules-resolver.spec.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,2CAA6B;AAC7B,yDAAsD;AACtD,uDAAmD;AAEnD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;QAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1C,MAAM,YAAY,GAAG,IAAA,mCAAgB,EAAC,GAAG,EAAE,gCAAc,CAAC,CAAC;QAC3D,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,6BAA6B,CAAC,CAAC,CAAC;IACtF,CAAC,CAAC,CAAC;IACH,EAAE,CAAC,uCAAuC,EAAE,GAAG,EAAE;QAC7C,MAAM,YAAY,GAAG,IAAA,mCAAgB,EAAC,SAAS,EAAE,gCAAc,CAAC,CAAC;QACjE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,mCAAmC,CAAC,CAAC,CAAC;IAClG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for converting FROM LanguageServer types language-server ts types
|
|
3
|
+
*/
|
|
4
|
+
import type * as lsp from 'vscode-languageserver-protocol';
|
|
5
|
+
import type tsp from 'typescript/lib/protocol';
|
|
6
|
+
export declare namespace Position {
|
|
7
|
+
const fromLocation: (tslocation: tsp.Location) => lsp.Position;
|
|
8
|
+
const toLocation: (position: lsp.Position) => tsp.Location;
|
|
9
|
+
const toFileLocationRequestArgs: (file: string, position: lsp.Position) => tsp.FileLocationRequestArgs;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=typeConverters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeConverters.d.ts","sourceRoot":"","sources":["../../src/utils/typeConverters.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,KAAK,KAAK,GAAG,MAAM,gCAAgC,CAAC;AAC3D,OAAO,KAAK,GAAG,MAAM,yBAAyB,CAAC;AAE/C,yBAAiB,QAAQ,CAAC;IACf,MAAM,YAAY,eAAgB,IAAI,QAAQ,KAAG,YAKvD,CAAC;IAEK,MAAM,UAAU,aAAc,YAAY,KAAG,IAAI,QAGtD,CAAC;IAEI,MAAM,yBAAyB,SAAU,MAAM,YAAY,YAAY,KAAG,IAAI,uBAInF,CAAC;CACN"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Position = void 0;
|
|
4
|
+
var Position;
|
|
5
|
+
(function (Position) {
|
|
6
|
+
Position.fromLocation = (tslocation) => {
|
|
7
|
+
return {
|
|
8
|
+
line: tslocation.line - 1,
|
|
9
|
+
character: tslocation.offset - 1
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
Position.toLocation = (position) => ({
|
|
13
|
+
line: position.line + 1,
|
|
14
|
+
offset: position.character + 1
|
|
15
|
+
});
|
|
16
|
+
Position.toFileLocationRequestArgs = (file, position) => ({
|
|
17
|
+
file,
|
|
18
|
+
line: position.line + 1,
|
|
19
|
+
offset: position.character + 1
|
|
20
|
+
});
|
|
21
|
+
})(Position = exports.Position || (exports.Position = {}));
|
|
22
|
+
//# sourceMappingURL=typeConverters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typeConverters.js","sourceRoot":"","sources":["../../src/utils/typeConverters.ts"],"names":[],"mappings":";;;AAUA,IAAiB,QAAQ,CAkBxB;AAlBD,WAAiB,QAAQ;IACR,qBAAY,GAAG,CAAC,UAAwB,EAAgB,EAAE;QACnE,OAAO;YACH,IAAI,EAAE,UAAU,CAAC,IAAI,GAAG,CAAC;YACzB,SAAS,EAAE,UAAU,CAAC,MAAM,GAAG,CAAC;SACnC,CAAC;IACN,CAAC,CAAC;IAEW,mBAAU,GAAG,CAAC,QAAsB,EAAgB,EAAE,CAAC,CAAC;QACjE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,CAAC;QACvB,MAAM,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC;KACjC,CAAC,CAAC;IAEU,kCAAyB,GAAG,CAAC,IAAY,EAAE,QAAsB,EAA+B,EAAE,CAAC,CAAC;QAC7G,IAAI;QACJ,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,CAAC;QACvB,MAAM,EAAE,QAAQ,CAAC,SAAS,GAAG,CAAC;KACjC,CAAC,CAAC;AACP,CAAC,EAlBgB,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAkBxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import API from './api';
|
|
2
|
+
import { IServerOptions } from './configuration';
|
|
3
|
+
export declare const enum TypeScriptVersionSource {
|
|
4
|
+
Bundled = "bundled",
|
|
5
|
+
UserSetting = "user-setting",
|
|
6
|
+
Workspace = "workspace"
|
|
7
|
+
}
|
|
8
|
+
export declare class TypeScriptVersion {
|
|
9
|
+
readonly source: TypeScriptVersionSource;
|
|
10
|
+
readonly path: string;
|
|
11
|
+
private readonly _pathLabel?;
|
|
12
|
+
private _api;
|
|
13
|
+
constructor(source: TypeScriptVersionSource, path: string, _pathLabel?: string | undefined);
|
|
14
|
+
get tscPath(): string;
|
|
15
|
+
get tsServerPath(): string;
|
|
16
|
+
get pathLabel(): string;
|
|
17
|
+
get isValid(): boolean;
|
|
18
|
+
get version(): API | null;
|
|
19
|
+
get versionString(): string | null;
|
|
20
|
+
private getTypeScriptVersion;
|
|
21
|
+
}
|
|
22
|
+
export declare const MODULE_FOLDERS: string[];
|
|
23
|
+
export declare class TypeScriptVersionProvider {
|
|
24
|
+
private configuration?;
|
|
25
|
+
constructor(configuration?: IServerOptions | undefined);
|
|
26
|
+
getUserSettingVersion(): TypeScriptVersion | null;
|
|
27
|
+
getWorkspaceVersion(workspaceFolders: string[]): TypeScriptVersion | null;
|
|
28
|
+
bundledVersion(): TypeScriptVersion | null;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=versionProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionProvider.d.ts","sourceRoot":"","sources":["../../src/utils/versionProvider.ts"],"names":[],"mappings":"AAQA,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,0BAAkB,uBAAuB;IACrC,OAAO,YAAY;IACnB,WAAW,iBAAiB;IAC5B,SAAS,cAAc;CAC1B;AAED,qBAAa,iBAAiB;aAGN,MAAM,EAAE,uBAAuB;aAC/B,IAAI,EAAE,MAAM;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAJhC,OAAO,CAAC,IAAI,CAAyB;gBAEjB,MAAM,EAAE,uBAAuB,EAC/B,IAAI,EAAE,MAAM,EACX,UAAU,CAAC,oBAAQ;IAKxC,IAAW,OAAO,IAAI,MAAM,CAE3B;IAED,IAAW,YAAY,IAAI,MAAM,CAEhC;IAED,IAAW,SAAS,IAAI,MAAM,CAE7B;IAED,IAAW,OAAO,IAAI,OAAO,CAE5B;IAED,IAAW,OAAO,IAAI,GAAG,GAAG,IAAI,CAM/B;IAED,IAAW,aAAa,IAAI,MAAM,GAAG,IAAI,CAGxC;IAED,OAAO,CAAC,oBAAoB;CAkC/B;AAED,eAAO,MAAM,cAAc,UAAgG,CAAC;AAE5H,qBAAa,yBAAyB;IACf,OAAO,CAAC,aAAa,CAAC;gBAAd,aAAa,CAAC,4BAAgB;IAElD,qBAAqB,IAAI,iBAAiB,GAAG,IAAI;IAsCjD,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,GAAG,iBAAiB,GAAG,IAAI;IAazE,cAAc,IAAI,iBAAiB,GAAG,IAAI;CAapD"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TypeScriptVersionProvider = exports.MODULE_FOLDERS = exports.TypeScriptVersion = void 0;
|
|
7
|
+
/*---------------------------------------------------------------------------------------------
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
10
|
+
*--------------------------------------------------------------------------------------------*/
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
13
|
+
const which_1 = __importDefault(require("which"));
|
|
14
|
+
const pkg_up_1 = __importDefault(require("pkg-up"));
|
|
15
|
+
const api_1 = __importDefault(require("./api"));
|
|
16
|
+
const modules_resolver_1 = require("./modules-resolver");
|
|
17
|
+
class TypeScriptVersion {
|
|
18
|
+
constructor(source, path, _pathLabel) {
|
|
19
|
+
this.source = source;
|
|
20
|
+
this.path = path;
|
|
21
|
+
this._pathLabel = _pathLabel;
|
|
22
|
+
this._api = null;
|
|
23
|
+
}
|
|
24
|
+
get tscPath() {
|
|
25
|
+
return path_1.default.resolve(this.path, '../bin/tsc');
|
|
26
|
+
}
|
|
27
|
+
get tsServerPath() {
|
|
28
|
+
return path_1.default.resolve(this.path, 'tsserver.js');
|
|
29
|
+
}
|
|
30
|
+
get pathLabel() {
|
|
31
|
+
return typeof this._pathLabel === 'undefined' ? this.path : this._pathLabel;
|
|
32
|
+
}
|
|
33
|
+
get isValid() {
|
|
34
|
+
return this.version !== null;
|
|
35
|
+
}
|
|
36
|
+
get version() {
|
|
37
|
+
if (this._api) {
|
|
38
|
+
return this._api;
|
|
39
|
+
}
|
|
40
|
+
this._api = this.getTypeScriptVersion(this.tsServerPath);
|
|
41
|
+
return this._api;
|
|
42
|
+
}
|
|
43
|
+
get versionString() {
|
|
44
|
+
const version = this.version;
|
|
45
|
+
return version ? version.displayName : null;
|
|
46
|
+
}
|
|
47
|
+
getTypeScriptVersion(serverPath) {
|
|
48
|
+
if (!fs_1.default.existsSync(serverPath)) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
const p = serverPath.split(path_1.default.sep);
|
|
52
|
+
if (p.length <= 2) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
const p2 = p.slice(0, -2);
|
|
56
|
+
const modulePath = p2.join(path_1.default.sep);
|
|
57
|
+
let fileName = path_1.default.join(modulePath, 'package.json');
|
|
58
|
+
if (!fs_1.default.existsSync(fileName)) {
|
|
59
|
+
// Special case for ts dev versions
|
|
60
|
+
if (path_1.default.basename(modulePath) === 'built') {
|
|
61
|
+
fileName = path_1.default.join(modulePath, '..', 'package.json');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (!fs_1.default.existsSync(fileName)) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const contents = fs_1.default.readFileSync(fileName).toString();
|
|
68
|
+
let desc = null;
|
|
69
|
+
try {
|
|
70
|
+
desc = JSON.parse(contents);
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
return null;
|
|
74
|
+
}
|
|
75
|
+
if (!desc || !desc.version) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
return desc.version ? api_1.default.fromVersionString(desc.version) : null;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.TypeScriptVersion = TypeScriptVersion;
|
|
82
|
+
exports.MODULE_FOLDERS = ['node_modules/typescript/lib', '.vscode/pnpify/typescript/lib', '.yarn/sdks/typescript/lib'];
|
|
83
|
+
class TypeScriptVersionProvider {
|
|
84
|
+
constructor(configuration) {
|
|
85
|
+
this.configuration = configuration;
|
|
86
|
+
}
|
|
87
|
+
getUserSettingVersion() {
|
|
88
|
+
const { tsserverPath } = this.configuration || {};
|
|
89
|
+
if (!tsserverPath) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
let resolvedPath = tsserverPath;
|
|
93
|
+
// Resolve full path to the binary if path is not absolute.
|
|
94
|
+
if (!path_1.default.isAbsolute(resolvedPath)) {
|
|
95
|
+
const binaryPath = which_1.default.sync(tsserverPath, { nothrow: true });
|
|
96
|
+
if (binaryPath) {
|
|
97
|
+
resolvedPath = binaryPath;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
// Resolve symbolic link.
|
|
101
|
+
let stat = fs_1.default.lstatSync(resolvedPath, { throwIfNoEntry: false });
|
|
102
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isSymbolicLink()) {
|
|
103
|
+
resolvedPath = fs_1.default.realpathSync(resolvedPath);
|
|
104
|
+
}
|
|
105
|
+
// Get directory path
|
|
106
|
+
stat = fs_1.default.lstatSync(resolvedPath, { throwIfNoEntry: false });
|
|
107
|
+
if (stat === null || stat === void 0 ? void 0 : stat.isFile()) {
|
|
108
|
+
resolvedPath = path_1.default.dirname(resolvedPath);
|
|
109
|
+
}
|
|
110
|
+
// Resolve path to the "lib" dir.
|
|
111
|
+
try {
|
|
112
|
+
const packageJsonPath = pkg_up_1.default.sync({ cwd: resolvedPath });
|
|
113
|
+
if (packageJsonPath) {
|
|
114
|
+
resolvedPath = path_1.default.join(path_1.default.dirname(packageJsonPath), 'lib');
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
catch (_a) {
|
|
118
|
+
// ignore
|
|
119
|
+
}
|
|
120
|
+
return new TypeScriptVersion("user-setting" /* UserSetting */, resolvedPath);
|
|
121
|
+
}
|
|
122
|
+
getWorkspaceVersion(workspaceFolders) {
|
|
123
|
+
for (const p of workspaceFolders) {
|
|
124
|
+
const libFolder = (0, modules_resolver_1.findPathToModule)(p, exports.MODULE_FOLDERS);
|
|
125
|
+
if (libFolder) {
|
|
126
|
+
const version = new TypeScriptVersion("workspace" /* Workspace */, libFolder);
|
|
127
|
+
if (version.isValid) {
|
|
128
|
+
return version;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
bundledVersion() {
|
|
135
|
+
try {
|
|
136
|
+
const file = require.resolve('typescript');
|
|
137
|
+
const bundledVersion = new TypeScriptVersion("bundled" /* Bundled */, path_1.default.dirname(file), '');
|
|
138
|
+
return bundledVersion;
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
// window.showMessage('Bundled typescript module not found', 'error');
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
exports.TypeScriptVersionProvider = TypeScriptVersionProvider;
|
|
147
|
+
//# sourceMappingURL=versionProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versionProvider.js","sourceRoot":"","sources":["../../src/utils/versionProvider.ts"],"names":[],"mappings":";;;;;;AAAA;;;gGAGgG;AAChG,4CAAoB;AACpB,gDAAwB;AACxB,kDAA0B;AAC1B,oDAA2B;AAC3B,gDAAwB;AAExB,yDAAsD;AAQtD,MAAa,iBAAiB;IAE1B,YACoB,MAA+B,EAC/B,IAAY,EACX,UAAmB;QAFpB,WAAM,GAAN,MAAM,CAAyB;QAC/B,SAAI,GAAJ,IAAI,CAAQ;QACX,eAAU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AC;IAEM,mBAAmB,CAAC,gBAA0B;QACjD,KAAK,MAAM,CAAC,IAAI,gBAAgB,EAAE;YAC9B,MAAM,SAAS,GAAG,IAAA,mCAAgB,EAAC,CAAC,EAAE,sBAAc,CAAC,CAAC;YACtD,IAAI,SAAS,EAAE;gBACX,MAAM,OAAO,GAAG,IAAI,iBAAiB,8BAAoC,SAAS,CAAC,CAAC;gBACpF,IAAI,OAAO,CAAC,OAAO,EAAE;oBACjB,OAAO,OAAO,CAAC;iBAClB;aACJ;SACJ;QACD,OAAO,IAAI,CAAC;IAChB,CAAC;IAEM,cAAc;QACjB,IAAI;YACA,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC3C,MAAM,cAAc,GAAG,IAAI,iBAAiB,0BAExC,cAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAClB,EAAE,CAAC,CAAC;YACR,OAAO,cAAc,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACR,sEAAsE;YACtE,OAAO,IAAI,CAAC;SACf;IACL,CAAC;CACJ;AAnED,8DAmEC"}
|
package/lib/utils.d.ts
CHANGED
package/lib/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAQ,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhC,OAAO,aAGJ;CACN
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAOA,qBAAa,QAAQ,CAAC,CAAC;IACnB,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IAEhC,OAAO,aAGJ;CACN"}
|
package/lib/utils.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.
|
|
9
|
+
exports.Deferred = void 0;
|
|
10
10
|
class Deferred {
|
|
11
11
|
constructor() {
|
|
12
12
|
this.promise = new Promise((resolve, reject) => {
|
|
@@ -16,11 +16,4 @@ class Deferred {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
exports.Deferred = Deferred;
|
|
19
|
-
function getTsserverExecutable() {
|
|
20
|
-
return isWindows() ? 'tsserver.cmd' : 'tsserver';
|
|
21
|
-
}
|
|
22
|
-
exports.getTsserverExecutable = getTsserverExecutable;
|
|
23
|
-
function isWindows() {
|
|
24
|
-
return /^win/.test(process.platform);
|
|
25
|
-
}
|
|
26
19
|
//# sourceMappingURL=utils.js.map
|
package/lib/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,MAAa,QAAQ;IAArB;QAII,YAAO,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;CAAA;AARD,4BAQC
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,MAAa,QAAQ;IAArB;QAII,YAAO,GAAG,IAAI,OAAO,CAAI,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YACzC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;YACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACzB,CAAC,CAAC,CAAC;IACP,CAAC;CAAA;AARD,4BAQC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typescript-language-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Language Server Protocol (LSP) implementation for TypeScript using tsserver",
|
|
5
5
|
"author": "TypeFox and others",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=12"
|
|
9
|
+
},
|
|
7
10
|
"eslintIgnore": [
|
|
8
11
|
"!.eslintrc.js"
|
|
9
12
|
],
|
|
@@ -17,39 +20,50 @@
|
|
|
17
20
|
"bin": {
|
|
18
21
|
"typescript-language-server": "./lib/cli.js"
|
|
19
22
|
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"clean": "rimraf lib *.tsbuildinfo",
|
|
25
|
+
"test": "mocha --exit --reporter spec \"./lib/**/*.spec.js\"",
|
|
26
|
+
"lint": "eslint --ext \".js,.ts\" src",
|
|
27
|
+
"build": "concurrently -n compile,lint -c blue,green \"yarn compile\" \"yarn lint\"",
|
|
28
|
+
"compile": "tsc -b",
|
|
29
|
+
"watch": "tsc -b --watch --verbose",
|
|
30
|
+
"postversion": "git push --follow-tags"
|
|
31
|
+
},
|
|
32
|
+
"husky": {
|
|
33
|
+
"hooks": {
|
|
34
|
+
"pre-commit": "yarn lint && yarn build && yarn test",
|
|
35
|
+
"post-merge": "yarn"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
20
38
|
"dependencies": {
|
|
21
|
-
"
|
|
22
|
-
"commander": "^7.2.0",
|
|
39
|
+
"commander": "^8.3.0",
|
|
23
40
|
"fs-extra": "^10.0.0",
|
|
24
41
|
"p-debounce": "^2.1.0",
|
|
42
|
+
"pkg-up": "^3.1.0",
|
|
43
|
+
"semver": "^7.3.5",
|
|
25
44
|
"tempy": "^1.0.1",
|
|
26
45
|
"vscode-languageserver": "^7.0.0",
|
|
27
46
|
"vscode-languageserver-protocol": "^3.16.0",
|
|
28
47
|
"vscode-languageserver-textdocument": "^1.0.1",
|
|
29
|
-
"vscode-uri": "^
|
|
30
|
-
|
|
31
|
-
"scripts": {
|
|
32
|
-
"clean": "rimraf lib *.tsbuildinfo",
|
|
33
|
-
"test": "mocha --exit --reporter spec \"./lib/**/*.spec.js\"",
|
|
34
|
-
"lint": "eslint --ext \".js,.ts\" src",
|
|
35
|
-
"build": "concurrently -n compile,lint -c blue,green \"yarn compile\" \"yarn lint\"",
|
|
36
|
-
"compile": "tsc -b",
|
|
37
|
-
"watch": "tsc -b --watch --verbose"
|
|
48
|
+
"vscode-uri": "^3.0.2",
|
|
49
|
+
"which": "^2.0.2"
|
|
38
50
|
},
|
|
39
51
|
"devDependencies": {
|
|
40
52
|
"@types/chai": "^4.2.19",
|
|
41
53
|
"@types/fs-extra": "^9.0.11",
|
|
42
54
|
"@types/mocha": "^9.0.0",
|
|
43
55
|
"@types/node": "^16.11.6",
|
|
44
|
-
"@
|
|
45
|
-
"@typescript-eslint/
|
|
56
|
+
"@types/which": "^2.0.1",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
58
|
+
"@typescript-eslint/parser": "^5.3.1",
|
|
46
59
|
"chai": "^4.3.4",
|
|
47
|
-
"concurrently": "^6.
|
|
48
|
-
"eslint": "^
|
|
60
|
+
"concurrently": "^6.4.0",
|
|
61
|
+
"eslint": "^8.2.0",
|
|
62
|
+
"husky": "4.x.x",
|
|
49
63
|
"mocha": "^9.0.1",
|
|
50
64
|
"rimraf": "^3.0.2",
|
|
51
65
|
"source-map-support": "^0.5.19",
|
|
52
|
-
"ts-node": "
|
|
66
|
+
"ts-node": "^10.4.0",
|
|
53
67
|
"typescript": "^4.4.3"
|
|
54
68
|
}
|
|
55
69
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules-resolver.d.ts","sourceRoot":"","sources":["../src/modules-resolver.ts"],"names":[],"mappings":"AASA,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAC,SAAS,CAMlF;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYrF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules-resolver.js","sourceRoot":"","sources":["../src/modules-resolver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;GAKG;AACH,uCAAyB;AACzB,2CAA6B;AAE7B,SAAgB,gBAAgB,CAAC,GAAW,EAAE,UAAkB;IAC5D,IAAI;QACA,OAAO,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;KACxD;IAAC,WAAM;QACJ,OAAO,SAAS,CAAC;KACpB;AACL,CAAC;AAND,4CAMC;AAED,SAAgB,iBAAiB,CAAC,GAAW,EAAE,UAAkB;IAC7D,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9B,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;QACjE,IAAI,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;YAC1B,OAAO,SAAS,CAAC;SACpB;KACJ;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IACvC,IAAI,MAAM,KAAK,GAAG,EAAE;QAChB,OAAO,iBAAiB,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;KAChD;AACL,CAAC;AAZD,8CAYC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules-resolver.spec.d.ts","sourceRoot":"","sources":["../src/modules-resolver.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modules-resolver.spec.js","sourceRoot":"","sources":["../src/modules-resolver.spec.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;;;;;;AAEH,2CAA6B;AAC7B,2CAA6B;AAC7B,yDAAsD;AAEtD,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;IAC9B,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACnC,MAAM,YAAY,GAAG,IAAA,mCAAgB,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAC;QAC5E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,yCAAyC,CAAC,EAAE,YAAY,CAAC,CAAC;IACxG,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|