typescript-language-server 0.7.1 → 0.8.0
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 +24 -0
- package/README.md +13 -1
- package/lib/cli.js +1 -2
- package/lib/cli.js.map +1 -1
- package/lib/completion.d.ts +4 -1
- package/lib/completion.d.ts.map +1 -1
- package/lib/completion.js +142 -10
- 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 +6 -12
- package/lib/lsp-server.d.ts.map +1 -1
- package/lib/lsp-server.js +140 -71
- package/lib/lsp-server.js.map +1 -1
- package/lib/lsp-server.spec.js +93 -2
- package/lib/lsp-server.spec.js.map +1 -1
- package/lib/protocol-translation.js +6 -9
- 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 +18 -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 +6 -1
- package/lib/tsp-client.d.ts.map +1 -1
- package/lib/tsp-client.js +20 -13
- 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 +2 -1
- package/lib/tsp-command-types.d.ts.map +1 -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/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/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 +29 -0
- package/lib/utils/versionProvider.d.ts.map +1 -0
- package/lib/utils/versionProvider.js +148 -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 +30 -17
- package/lib/modules-resolver.d.ts +0 -3
- package/lib/modules-resolver.d.ts.map +0 -1
- package/lib/modules-resolver.js +0 -54
- package/lib/modules-resolver.js.map +0 -1
- package/lib/modules-resolver.spec.d.ts +0 -2
- package/lib/modules-resolver.spec.d.ts.map +0 -1
- package/lib/modules-resolver.spec.js +0 -37
- package/lib/modules-resolver.spec.js.map +0 -1
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.0",
|
|
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,40 +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",
|
|
25
43
|
"semver": "^7.3.5",
|
|
26
44
|
"tempy": "^1.0.1",
|
|
27
45
|
"vscode-languageserver": "^7.0.0",
|
|
28
46
|
"vscode-languageserver-protocol": "^3.16.0",
|
|
29
47
|
"vscode-languageserver-textdocument": "^1.0.1",
|
|
30
|
-
"vscode-uri": "^
|
|
31
|
-
|
|
32
|
-
"scripts": {
|
|
33
|
-
"clean": "rimraf lib *.tsbuildinfo",
|
|
34
|
-
"test": "mocha --exit --reporter spec \"./lib/**/*.spec.js\"",
|
|
35
|
-
"lint": "eslint --ext \".js,.ts\" src",
|
|
36
|
-
"build": "concurrently -n compile,lint -c blue,green \"yarn compile\" \"yarn lint\"",
|
|
37
|
-
"compile": "tsc -b",
|
|
38
|
-
"watch": "tsc -b --watch --verbose"
|
|
48
|
+
"vscode-uri": "^3.0.2",
|
|
49
|
+
"which": "^2.0.2"
|
|
39
50
|
},
|
|
40
51
|
"devDependencies": {
|
|
41
52
|
"@types/chai": "^4.2.19",
|
|
42
53
|
"@types/fs-extra": "^9.0.11",
|
|
43
54
|
"@types/mocha": "^9.0.0",
|
|
44
55
|
"@types/node": "^16.11.6",
|
|
45
|
-
"@
|
|
46
|
-
"@typescript-eslint/
|
|
56
|
+
"@types/which": "^2.0.1",
|
|
57
|
+
"@typescript-eslint/eslint-plugin": "^5.3.1",
|
|
58
|
+
"@typescript-eslint/parser": "^5.3.1",
|
|
47
59
|
"chai": "^4.3.4",
|
|
48
|
-
"concurrently": "^6.
|
|
49
|
-
"eslint": "^
|
|
60
|
+
"concurrently": "^6.4.0",
|
|
61
|
+
"eslint": "^8.2.0",
|
|
62
|
+
"husky": "4.x.x",
|
|
50
63
|
"mocha": "^9.0.1",
|
|
51
64
|
"rimraf": "^3.0.2",
|
|
52
65
|
"source-map-support": "^0.5.19",
|
|
53
|
-
"ts-node": "
|
|
66
|
+
"ts-node": "^10.4.0",
|
|
54
67
|
"typescript": "^4.4.3"
|
|
55
68
|
}
|
|
56
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"}
|
package/lib/modules-resolver.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.findPathToYarnSdk = exports.findPathToModule = void 0;
|
|
23
|
-
/*
|
|
24
|
-
* Copyright (C) 2017, 2018 TypeFox and others.
|
|
25
|
-
*
|
|
26
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
27
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
28
|
-
*/
|
|
29
|
-
const fs = __importStar(require("fs"));
|
|
30
|
-
const path = __importStar(require("path"));
|
|
31
|
-
function findPathToModule(dir, moduleName) {
|
|
32
|
-
try {
|
|
33
|
-
return require.resolve(moduleName, { paths: [dir] });
|
|
34
|
-
}
|
|
35
|
-
catch (_a) {
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
exports.findPathToModule = findPathToModule;
|
|
40
|
-
function findPathToYarnSdk(dir, moduleName) {
|
|
41
|
-
const stat = fs.statSync(dir);
|
|
42
|
-
if (stat.isDirectory()) {
|
|
43
|
-
const candidate = path.resolve(dir, '.yarn', 'sdks', moduleName);
|
|
44
|
-
if (fs.existsSync(candidate)) {
|
|
45
|
-
return candidate;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
const parent = path.resolve(dir, '..');
|
|
49
|
-
if (parent !== dir) {
|
|
50
|
-
return findPathToYarnSdk(parent, moduleName);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.findPathToYarnSdk = findPathToYarnSdk;
|
|
54
|
-
//# sourceMappingURL=modules-resolver.js.map
|
|
@@ -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,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* Copyright (C) 2017, 2018 TypeFox and others.
|
|
4
|
-
*
|
|
5
|
-
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
7
|
-
*/
|
|
8
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
-
if (k2 === undefined) k2 = k;
|
|
10
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
11
|
-
}) : (function(o, m, k, k2) {
|
|
12
|
-
if (k2 === undefined) k2 = k;
|
|
13
|
-
o[k2] = m[k];
|
|
14
|
-
}));
|
|
15
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
16
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17
|
-
}) : function(o, v) {
|
|
18
|
-
o["default"] = v;
|
|
19
|
-
});
|
|
20
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
21
|
-
if (mod && mod.__esModule) return mod;
|
|
22
|
-
var result = {};
|
|
23
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
24
|
-
__setModuleDefault(result, mod);
|
|
25
|
-
return result;
|
|
26
|
-
};
|
|
27
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
-
const chai = __importStar(require("chai"));
|
|
29
|
-
const path = __importStar(require("path"));
|
|
30
|
-
const modules_resolver_1 = require("./modules-resolver");
|
|
31
|
-
describe('findPathToModule', () => {
|
|
32
|
-
it('resolves the local tsserver', () => {
|
|
33
|
-
const tsserverPath = (0, modules_resolver_1.findPathToModule)(__dirname, 'typescript/bin/tsserver');
|
|
34
|
-
chai.assert.equal(path.resolve(__dirname, '../node_modules/typescript/bin/tsserver'), tsserverPath);
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
//# sourceMappingURL=modules-resolver.spec.js.map
|
|
@@ -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"}
|