@gi-tcg/gts-language-server 0.4.1 → 0.4.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/dist/browser.d.ts +72 -61
- package/dist/browser.js +3 -3
- package/dist/node.js +3 -2
- package/package.json +3 -3
- package/src/node.ts +7 -2
- package/src/zen_fs_provider.ts +6 -6
package/dist/browser.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GtsConfig } from "@gi-tcg/gts-transpiler";
|
|
2
2
|
|
|
3
|
-
//#region ../../node_modules/typescript/lib/typescript.d.ts
|
|
3
|
+
//#region ../../node_modules/typescript/node_modules/typescript/lib/typescript.d.ts
|
|
4
4
|
/*! *****************************************************************************
|
|
5
5
|
Copyright (c) Microsoft Corporation. All rights reserved.
|
|
6
6
|
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
@@ -10,7 +10,7 @@ License at http://www.apache.org/licenses/LICENSE-2.0
|
|
|
10
10
|
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
11
11
|
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
12
12
|
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
13
|
-
|
|
13
|
+
MERCHANTABILITY OR NON-INFRINGEMENT.
|
|
14
14
|
|
|
15
15
|
See the Apache Version 2.0 License for specific language governing permissions
|
|
16
16
|
and limitations under the License.
|
|
@@ -2509,6 +2509,7 @@ declare namespace ts {
|
|
|
2509
2509
|
Node = "node",
|
|
2510
2510
|
/** @deprecated Renamed to `Node10` */
|
|
2511
2511
|
NodeJs = "node",
|
|
2512
|
+
/** @deprecated */
|
|
2512
2513
|
Node10 = "node10",
|
|
2513
2514
|
Node16 = "node16",
|
|
2514
2515
|
NodeNext = "nodenext",
|
|
@@ -2521,6 +2522,7 @@ declare namespace ts {
|
|
|
2521
2522
|
export enum ScriptTarget {
|
|
2522
2523
|
/** @deprecated */
|
|
2523
2524
|
ES3 = "es3",
|
|
2525
|
+
/** @deprecated */
|
|
2524
2526
|
ES5 = "es5",
|
|
2525
2527
|
ES6 = "es6",
|
|
2526
2528
|
ES2015 = "es2015",
|
|
@@ -2533,9 +2535,11 @@ declare namespace ts {
|
|
|
2533
2535
|
ES2022 = "es2022",
|
|
2534
2536
|
ES2023 = "es2023",
|
|
2535
2537
|
ES2024 = "es2024",
|
|
2538
|
+
ES2025 = "es2025",
|
|
2536
2539
|
ESNext = "esnext",
|
|
2537
2540
|
JSON = "json",
|
|
2538
|
-
Latest = "esnext"
|
|
2541
|
+
Latest = "esnext",
|
|
2542
|
+
LatestStandard = "es2025"
|
|
2539
2543
|
}
|
|
2540
2544
|
}
|
|
2541
2545
|
namespace typingsInstaller {
|
|
@@ -3619,7 +3623,7 @@ declare namespace ts {
|
|
|
3619
3623
|
readDirectory(rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[] | undefined, depth?: number): string[];
|
|
3620
3624
|
}
|
|
3621
3625
|
}
|
|
3622
|
-
const versionMajorMinor = "
|
|
3626
|
+
const versionMajorMinor = "6.0";
|
|
3623
3627
|
/** The version of the TypeScript compiler release */
|
|
3624
3628
|
const version: string;
|
|
3625
3629
|
/**
|
|
@@ -5682,14 +5686,7 @@ declare namespace ts {
|
|
|
5682
5686
|
libReferenceDirectives: readonly FileReference[];
|
|
5683
5687
|
languageVariant: LanguageVariant;
|
|
5684
5688
|
isDeclarationFile: boolean;
|
|
5685
|
-
/**
|
|
5686
|
-
* lib.d.ts should have a reference comment like
|
|
5687
|
-
*
|
|
5688
|
-
* /// <reference no-default-lib="true"/>
|
|
5689
|
-
*
|
|
5690
|
-
* If any other file has this comment, it signals not to include lib.d.ts
|
|
5691
|
-
* because this containing file is intended to act as a default library.
|
|
5692
|
-
*/
|
|
5689
|
+
/** @deprecated Always false. Use a Program to determine if a file is a lib file. */
|
|
5693
5690
|
hasNoDefaultLib: boolean;
|
|
5694
5691
|
languageVersion: ScriptTarget;
|
|
5695
5692
|
/**
|
|
@@ -6347,53 +6344,53 @@ declare namespace ts {
|
|
|
6347
6344
|
enum TypeFlags {
|
|
6348
6345
|
Any = 1,
|
|
6349
6346
|
Unknown = 2,
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6356
|
-
|
|
6357
|
-
|
|
6358
|
-
|
|
6359
|
-
|
|
6360
|
-
|
|
6361
|
-
|
|
6362
|
-
|
|
6363
|
-
|
|
6364
|
-
|
|
6365
|
-
|
|
6366
|
-
|
|
6367
|
-
|
|
6368
|
-
|
|
6369
|
-
|
|
6370
|
-
|
|
6371
|
-
|
|
6372
|
-
|
|
6373
|
-
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
Literal =
|
|
6378
|
-
Unit =
|
|
6379
|
-
Freshable =
|
|
6380
|
-
StringOrNumberLiteral =
|
|
6381
|
-
PossiblyFalsy =
|
|
6382
|
-
StringLike =
|
|
6383
|
-
NumberLike =
|
|
6384
|
-
BigIntLike =
|
|
6385
|
-
BooleanLike =
|
|
6386
|
-
EnumLike =
|
|
6387
|
-
ESSymbolLike =
|
|
6388
|
-
VoidLike =
|
|
6389
|
-
UnionOrIntersection =
|
|
6390
|
-
StructuredType =
|
|
6391
|
-
TypeVariable =
|
|
6392
|
-
InstantiableNonPrimitive =
|
|
6393
|
-
InstantiablePrimitive =
|
|
6394
|
-
Instantiable =
|
|
6395
|
-
StructuredOrInstantiable =
|
|
6396
|
-
Narrowable =
|
|
6347
|
+
Undefined = 4,
|
|
6348
|
+
Null = 8,
|
|
6349
|
+
Void = 16,
|
|
6350
|
+
String = 32,
|
|
6351
|
+
Number = 64,
|
|
6352
|
+
BigInt = 128,
|
|
6353
|
+
Boolean = 256,
|
|
6354
|
+
ESSymbol = 512,
|
|
6355
|
+
StringLiteral = 1024,
|
|
6356
|
+
NumberLiteral = 2048,
|
|
6357
|
+
BigIntLiteral = 4096,
|
|
6358
|
+
BooleanLiteral = 8192,
|
|
6359
|
+
UniqueESSymbol = 16384,
|
|
6360
|
+
EnumLiteral = 32768,
|
|
6361
|
+
Enum = 65536,
|
|
6362
|
+
NonPrimitive = 131072,
|
|
6363
|
+
Never = 262144,
|
|
6364
|
+
TypeParameter = 524288,
|
|
6365
|
+
Object = 1048576,
|
|
6366
|
+
Index = 2097152,
|
|
6367
|
+
TemplateLiteral = 4194304,
|
|
6368
|
+
StringMapping = 8388608,
|
|
6369
|
+
Substitution = 16777216,
|
|
6370
|
+
IndexedAccess = 33554432,
|
|
6371
|
+
Conditional = 67108864,
|
|
6372
|
+
Union = 134217728,
|
|
6373
|
+
Intersection = 268435456,
|
|
6374
|
+
Literal = 15360,
|
|
6375
|
+
Unit = 97292,
|
|
6376
|
+
Freshable = 80896,
|
|
6377
|
+
StringOrNumberLiteral = 3072,
|
|
6378
|
+
PossiblyFalsy = 15868,
|
|
6379
|
+
StringLike = 12583968,
|
|
6380
|
+
NumberLike = 67648,
|
|
6381
|
+
BigIntLike = 4224,
|
|
6382
|
+
BooleanLike = 8448,
|
|
6383
|
+
EnumLike = 98304,
|
|
6384
|
+
ESSymbolLike = 16896,
|
|
6385
|
+
VoidLike = 20,
|
|
6386
|
+
UnionOrIntersection = 402653184,
|
|
6387
|
+
StructuredType = 403701760,
|
|
6388
|
+
TypeVariable = 34078720,
|
|
6389
|
+
InstantiableNonPrimitive = 117964800,
|
|
6390
|
+
InstantiablePrimitive = 14680064,
|
|
6391
|
+
Instantiable = 132644864,
|
|
6392
|
+
StructuredOrInstantiable = 536346624,
|
|
6393
|
+
Narrowable = 536575971
|
|
6397
6394
|
}
|
|
6398
6395
|
type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression;
|
|
6399
6396
|
interface Type {
|
|
@@ -6693,6 +6690,7 @@ declare namespace ts {
|
|
|
6693
6690
|
Message = 3
|
|
6694
6691
|
}
|
|
6695
6692
|
enum ModuleResolutionKind {
|
|
6693
|
+
/** @deprecated */
|
|
6696
6694
|
Classic = 1,
|
|
6697
6695
|
/**
|
|
6698
6696
|
* @deprecated
|
|
@@ -6700,6 +6698,9 @@ declare namespace ts {
|
|
|
6700
6698
|
* Use the new name or consider switching to a modern module resolution target.
|
|
6701
6699
|
*/
|
|
6702
6700
|
NodeJs = 2,
|
|
6701
|
+
/**
|
|
6702
|
+
* @deprecated
|
|
6703
|
+
*/
|
|
6703
6704
|
Node10 = 2,
|
|
6704
6705
|
Node16 = 3,
|
|
6705
6706
|
NodeNext = 99,
|
|
@@ -6762,6 +6763,7 @@ declare namespace ts {
|
|
|
6762
6763
|
allowUnreachableCode?: boolean;
|
|
6763
6764
|
allowUnusedLabels?: boolean;
|
|
6764
6765
|
alwaysStrict?: boolean;
|
|
6766
|
+
/** @deprecated */
|
|
6765
6767
|
baseUrl?: string;
|
|
6766
6768
|
/** @deprecated */
|
|
6767
6769
|
charset?: string;
|
|
@@ -6775,6 +6777,7 @@ declare namespace ts {
|
|
|
6775
6777
|
disableSourceOfProjectReferenceRedirect?: boolean;
|
|
6776
6778
|
disableSolutionSearching?: boolean;
|
|
6777
6779
|
disableReferencedProjectLoad?: boolean;
|
|
6780
|
+
/** @deprecated */
|
|
6778
6781
|
downlevelIteration?: boolean;
|
|
6779
6782
|
emitBOM?: boolean;
|
|
6780
6783
|
emitDecoratorMetadata?: boolean;
|
|
@@ -6892,10 +6895,14 @@ declare namespace ts {
|
|
|
6892
6895
|
[option: string]: CompilerOptionsValue | undefined;
|
|
6893
6896
|
}
|
|
6894
6897
|
enum ModuleKind {
|
|
6898
|
+
/** @deprecated */
|
|
6895
6899
|
None = 0,
|
|
6896
6900
|
CommonJS = 1,
|
|
6901
|
+
/** @deprecated */
|
|
6897
6902
|
AMD = 2,
|
|
6903
|
+
/** @deprecated */
|
|
6898
6904
|
UMD = 3,
|
|
6905
|
+
/** @deprecated */
|
|
6899
6906
|
System = 4,
|
|
6900
6907
|
ES2015 = 5,
|
|
6901
6908
|
ES2020 = 6,
|
|
@@ -6947,6 +6954,7 @@ declare namespace ts {
|
|
|
6947
6954
|
enum ScriptTarget {
|
|
6948
6955
|
/** @deprecated */
|
|
6949
6956
|
ES3 = 0,
|
|
6957
|
+
/** @deprecated */
|
|
6950
6958
|
ES5 = 1,
|
|
6951
6959
|
ES2015 = 2,
|
|
6952
6960
|
ES2016 = 3,
|
|
@@ -6958,9 +6966,11 @@ declare namespace ts {
|
|
|
6958
6966
|
ES2022 = 9,
|
|
6959
6967
|
ES2023 = 10,
|
|
6960
6968
|
ES2024 = 11,
|
|
6969
|
+
ES2025 = 12,
|
|
6961
6970
|
ESNext = 99,
|
|
6962
6971
|
JSON = 100,
|
|
6963
|
-
Latest = 99
|
|
6972
|
+
Latest = 99,
|
|
6973
|
+
LatestStandard = 12
|
|
6964
6974
|
}
|
|
6965
6975
|
enum LanguageVariant {
|
|
6966
6976
|
Standard = 0,
|
|
@@ -9071,7 +9081,7 @@ declare namespace ts {
|
|
|
9071
9081
|
* Given a set of options, returns the set of type directive names
|
|
9072
9082
|
* that should be included for this program automatically.
|
|
9073
9083
|
* This list could either come from the config file,
|
|
9074
|
-
* or from enumerating the types root + initial secondary types lookup location.
|
|
9084
|
+
* and/or from enumerating the types root + initial secondary types lookup location given "*" compat wildcard.
|
|
9075
9085
|
* More type directives might appear in the program later as a result of loading actual source files;
|
|
9076
9086
|
* this list is only the set of defaults that are implicitly included.
|
|
9077
9087
|
*/
|
|
@@ -9794,6 +9804,7 @@ declare namespace ts {
|
|
|
9794
9804
|
libReferenceDirectives: FileReference[];
|
|
9795
9805
|
importedFiles: FileReference[];
|
|
9796
9806
|
ambientExternalModules?: string[];
|
|
9807
|
+
/** @deprecated Always false. Use a Program to determine if a file is a lib file. */
|
|
9797
9808
|
isLibFile: boolean;
|
|
9798
9809
|
}
|
|
9799
9810
|
interface HostCancellationToken {
|
package/dist/browser.js
CHANGED
|
@@ -11,7 +11,7 @@ function zenFsProvider(fs) {
|
|
|
11
11
|
return {
|
|
12
12
|
stat(uri) {
|
|
13
13
|
try {
|
|
14
|
-
const stats = fs.statSync(uri.
|
|
14
|
+
const stats = fs.statSync(uri.fsPath);
|
|
15
15
|
return {
|
|
16
16
|
type: stats.isFile() ? 1 : stats.isDirectory() ? 2 : stats.isSymbolicLink() ? 64 : 0,
|
|
17
17
|
ctime: stats.ctimeMs,
|
|
@@ -24,14 +24,14 @@ function zenFsProvider(fs) {
|
|
|
24
24
|
},
|
|
25
25
|
readFile(uri, encoding) {
|
|
26
26
|
try {
|
|
27
|
-
return fs.readFileSync(uri.
|
|
27
|
+
return fs.readFileSync(uri.fsPath, { encoding: encoding ?? "utf-8" });
|
|
28
28
|
} catch {
|
|
29
29
|
return;
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
readDirectory(uri) {
|
|
33
33
|
try {
|
|
34
|
-
return fs.readdirSync(uri.
|
|
34
|
+
return fs.readdirSync(uri.fsPath, { withFileTypes: true }).map((file) => {
|
|
35
35
|
return [file.name, file.isFile() ? 1 : file.isDirectory() ? 2 : file.isSymbolicLink() ? 64 : 0];
|
|
36
36
|
});
|
|
37
37
|
} catch {
|
package/dist/node.js
CHANGED
|
@@ -3,6 +3,7 @@ import { GtsVirtualCode, createGtsLanguagePlugin } from "@gi-tcg/gts-language-pl
|
|
|
3
3
|
import { DiagnosticSeverity } from "@volar/language-server";
|
|
4
4
|
import { URI } from "vscode-uri";
|
|
5
5
|
import { create } from "volar-service-typescript";
|
|
6
|
+
import path from "node:path";
|
|
6
7
|
//#region src/utils.ts
|
|
7
8
|
/**
|
|
8
9
|
* Get virtual code from the encoded document URI
|
|
@@ -230,10 +231,10 @@ function createLanguageServicePlugins(ts) {
|
|
|
230
231
|
const connection = createConnection();
|
|
231
232
|
const server = createServer(connection);
|
|
232
233
|
connection.listen();
|
|
233
|
-
connection.onInitialize((params) => {
|
|
234
|
+
connection.onInitialize(async (params) => {
|
|
234
235
|
const tsdk = loadTsdkByPath(params.initializationOptions.typescript.tsdk, params.locale);
|
|
235
236
|
return server.initialize(params, createTypeScriptProject(tsdk.typescript, tsdk.diagnosticMessages, () => {
|
|
236
|
-
return { languagePlugins: [createGtsLanguagePlugin(tsdk.typescript)] };
|
|
237
|
+
return { languagePlugins: [createGtsLanguagePlugin(tsdk.typescript, { pathModule: path })] };
|
|
237
238
|
}), createLanguageServicePlugins(tsdk.typescript));
|
|
238
239
|
});
|
|
239
240
|
connection.onInitialized(server.initialized);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gi-tcg/gts-language-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/piovium/gts.git"
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"path-browserify-esm": "^1.0.6",
|
|
32
32
|
"volar-service-typescript": "volar-2.4",
|
|
33
33
|
"vscode-uri": "^3.0.8",
|
|
34
|
-
"@gi-tcg/gts-
|
|
35
|
-
"@gi-tcg/gts-
|
|
34
|
+
"@gi-tcg/gts-language-plugin": "0.4.3",
|
|
35
|
+
"@gi-tcg/gts-transpiler": "0.4.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"vscode-languageserver-textdocument": "^1.0.12"
|
package/src/node.ts
CHANGED
|
@@ -7,13 +7,14 @@ import {
|
|
|
7
7
|
} from "@volar/language-server/node.js";
|
|
8
8
|
import { createGtsLanguagePlugin } from "@gi-tcg/gts-language-plugin";
|
|
9
9
|
import { createLanguageServicePlugins } from "./services/index.ts";
|
|
10
|
+
import path from "node:path";
|
|
10
11
|
|
|
11
12
|
const connection = createConnection();
|
|
12
13
|
const server = createServer(connection);
|
|
13
14
|
|
|
14
15
|
connection.listen();
|
|
15
16
|
|
|
16
|
-
connection.onInitialize((params) => {
|
|
17
|
+
connection.onInitialize(async (params) => {
|
|
17
18
|
const tsdk = loadTsdkByPath(
|
|
18
19
|
params.initializationOptions.typescript.tsdk,
|
|
19
20
|
params.locale,
|
|
@@ -22,7 +23,11 @@ connection.onInitialize((params) => {
|
|
|
22
23
|
params,
|
|
23
24
|
createTypeScriptProject(tsdk.typescript, tsdk.diagnosticMessages, () => {
|
|
24
25
|
return {
|
|
25
|
-
languagePlugins: [
|
|
26
|
+
languagePlugins: [
|
|
27
|
+
createGtsLanguagePlugin(tsdk.typescript, {
|
|
28
|
+
pathModule: path,
|
|
29
|
+
}),
|
|
30
|
+
],
|
|
26
31
|
};
|
|
27
32
|
}),
|
|
28
33
|
createLanguageServicePlugins(tsdk.typescript),
|
package/src/zen_fs_provider.ts
CHANGED
|
@@ -6,8 +6,8 @@ export default function zenFsProvider(
|
|
|
6
6
|
return {
|
|
7
7
|
stat(uri) {
|
|
8
8
|
try {
|
|
9
|
-
const stats = fs.statSync(uri.
|
|
10
|
-
// console.log("stat", uri.
|
|
9
|
+
const stats = fs.statSync(uri.fsPath);
|
|
10
|
+
// console.log("stat", uri.fsPath, stats);
|
|
11
11
|
return {
|
|
12
12
|
type: stats.isFile()
|
|
13
13
|
? (1 satisfies FileType.File)
|
|
@@ -26,8 +26,8 @@ export default function zenFsProvider(
|
|
|
26
26
|
},
|
|
27
27
|
readFile(uri, encoding) {
|
|
28
28
|
try {
|
|
29
|
-
// console.log("readFile", uri.
|
|
30
|
-
return fs.readFileSync(uri.
|
|
29
|
+
// console.log("readFile", uri.fsPath);
|
|
30
|
+
return fs.readFileSync(uri.fsPath, {
|
|
31
31
|
encoding: (encoding as "utf-8") ?? "utf-8",
|
|
32
32
|
});
|
|
33
33
|
} catch {
|
|
@@ -36,8 +36,8 @@ export default function zenFsProvider(
|
|
|
36
36
|
},
|
|
37
37
|
readDirectory(uri) {
|
|
38
38
|
try {
|
|
39
|
-
const files = fs.readdirSync(uri.
|
|
40
|
-
// console.log("readDirectory", uri.
|
|
39
|
+
const files = fs.readdirSync(uri.fsPath, { withFileTypes: true });
|
|
40
|
+
// console.log("readDirectory", uri.fsPath, files.map((f) => f.name));
|
|
41
41
|
return files.map<[string, FileType]>((file) => {
|
|
42
42
|
return [
|
|
43
43
|
file.name,
|