@artel/artc 0.9.26035-pre-release → 0.9.26037-pre-release
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/build/Cli.js +3 -3
- package/build/api/Api.js +6 -4
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +184 -4
- package/build/{chunk-J5DRCNWW.js → chunk-HOYH73XP.js} +1328 -473
- package/build/{chunk-YJXY57IJ.js → chunk-QH5QQEEL.js} +1 -1
- package/build/{chunk-OYME3VHI.js → chunk-U6LB6G47.js} +2 -2
- package/build/types/analysis/WellKnownDeclarations.d.ts +11 -1
- package/build/types/analysis/a/Analyzer.d.ts +1 -0
- package/build/types/analysis/m/Analyzer.d.ts +2 -1
- package/build/types/diagnostic/DiagnosticCode.d.ts +24 -23
- package/build/types/emitter/Entities.d.ts +6 -2
- package/build/types/emitter/EntityMap.d.ts +1 -0
- package/build/types/entities/IEntity.d.ts +1 -0
- package/build/types/entities/Tag.d.ts +11 -4
- package/build/types/entities/interfaces/FunctionEntity.d.ts +1 -0
- package/build/types/entities/source/a/SourceAliasTypeEntity.d.ts +2 -0
- package/build/types/entities/source/a/SourceFunctionEntity.d.ts +4 -0
- package/build/types/entities/source/a/SourceFunctionTypeEntity.d.ts +2 -0
- package/build/types/entities/source/a/SourceGetterEntity.d.ts +8 -0
- package/build/types/entities/source/a/SourceSetterEntity.d.ts +8 -0
- package/build/types/entities/source/a/SourceStructuredTypeEntity.d.ts +6 -0
- package/build/types/entities/source/a/SourceVariableEntity.d.ts +4 -0
- package/build/types/entities/source/a/SourceVariantTypeEntity.d.ts +2 -0
- package/build/types/entities/source/m/SourceFunctionEntity.d.ts +2 -0
- package/build/types/entities/source/m/SourceFunctionTypeEntity.d.ts +2 -0
- package/build/types/entities/source/m/SourceGetterEntity.d.ts +8 -0
- package/build/types/entities/source/m/SourceSetterEntity.d.ts +8 -0
- package/build/types/entities/source/m/SourceStructuredTypeEntity.d.ts +5 -0
- package/build/types/entities/source/m/SourceVariableEntity.d.ts +2 -0
- package/build/types/entities/source/m/SourceVariantTypeEntity.d.ts +2 -0
- package/build/types/services/a/source-generation/EntityToSyntax.d.ts +1 -0
- package/build/types/services/m/source-generation/EntityToSyntax.d.ts +2 -1
- package/build/types/tree/a/SyntaxFactory.d.ts +7 -0
- package/build/types/tree/m/SyntaxFactory.d.ts +7 -0
- package/build/types/ts-interop/Entities.d.ts +6 -3
- package/build/types/ts-interop/TsInteropContext.d.ts +3 -0
- package/package.json +1 -1
package/build/Cli.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
CommandLineCompiler
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-U6LB6G47.js";
|
|
5
|
+
import "./chunk-QH5QQEEL.js";
|
|
6
6
|
import {
|
|
7
7
|
__async
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HOYH73XP.js";
|
|
9
9
|
|
|
10
10
|
// source/Cli.ts
|
|
11
11
|
function main() {
|
package/build/api/Api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-QH5QQEEL.js";
|
|
4
4
|
import {
|
|
5
5
|
AccessKind,
|
|
6
6
|
AccessedFunction_entity,
|
|
@@ -197,7 +197,8 @@ import {
|
|
|
197
197
|
TagArgument_boolean,
|
|
198
198
|
TagArgument_invalid,
|
|
199
199
|
TagArgument_numeric,
|
|
200
|
-
|
|
200
|
+
TagArgument_text,
|
|
201
|
+
TagArgument_variableExpression,
|
|
201
202
|
TagFunction,
|
|
202
203
|
TagType,
|
|
203
204
|
TargetPlatformConfig,
|
|
@@ -310,7 +311,7 @@ import {
|
|
|
310
311
|
withoutQuotes,
|
|
311
312
|
withoutTemplateQuotes,
|
|
312
313
|
yieldTask
|
|
313
|
-
} from "../chunk-
|
|
314
|
+
} from "../chunk-HOYH73XP.js";
|
|
314
315
|
export {
|
|
315
316
|
AccessKind,
|
|
316
317
|
AccessedFunction_entity,
|
|
@@ -505,7 +506,8 @@ export {
|
|
|
505
506
|
TagArgument_boolean,
|
|
506
507
|
TagArgument_invalid,
|
|
507
508
|
TagArgument_numeric,
|
|
508
|
-
|
|
509
|
+
TagArgument_text,
|
|
510
|
+
TagArgument_variableExpression,
|
|
509
511
|
TagFunction,
|
|
510
512
|
TagType,
|
|
511
513
|
TargetPlatformConfig,
|
package/build/api/ApiNodeJS.js
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
PhysicalFileSystem,
|
|
7
7
|
PhysicalTypeScriptLibrariesProvider,
|
|
8
8
|
PrintingDiagnosticAcceptor
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
9
|
+
} from "../chunk-U6LB6G47.js";
|
|
10
|
+
import "../chunk-QH5QQEEL.js";
|
|
11
|
+
import "../chunk-HOYH73XP.js";
|
|
12
12
|
export {
|
|
13
13
|
CommandLineCompiler,
|
|
14
14
|
FileSystemUri,
|
package/build/api/ApiServices.js
CHANGED
|
@@ -102,6 +102,7 @@ import {
|
|
|
102
102
|
isIdentifier2,
|
|
103
103
|
isKeyword,
|
|
104
104
|
isKeyword2,
|
|
105
|
+
isNamedFunctionEntity,
|
|
105
106
|
isNamedTypeEntity,
|
|
106
107
|
isNarrowableReferenceExpression,
|
|
107
108
|
isNarrowableReferenceExpression2,
|
|
@@ -140,7 +141,7 @@ import {
|
|
|
140
141
|
traverseTreeAsync,
|
|
141
142
|
traverseTreeAsync2,
|
|
142
143
|
yieldTask
|
|
143
|
-
} from "../chunk-
|
|
144
|
+
} from "../chunk-HOYH73XP.js";
|
|
144
145
|
|
|
145
146
|
// source/services/common/Types.ts
|
|
146
147
|
import * as ls from "vscode-languageserver";
|
|
@@ -9870,7 +9871,89 @@ var EntityToSyntax = class {
|
|
|
9870
9871
|
return SyntaxFactory.modifier(41 /* Hidden */, levelKeyword);
|
|
9871
9872
|
}
|
|
9872
9873
|
convertTags(entityTags) {
|
|
9873
|
-
return
|
|
9874
|
+
return entityTags.map((t) => this.convertTag(t)).filter((t) => t !== void 0);
|
|
9875
|
+
}
|
|
9876
|
+
convertTag(tag) {
|
|
9877
|
+
let name;
|
|
9878
|
+
let typeArguments;
|
|
9879
|
+
let parameterEntities;
|
|
9880
|
+
switch (tag.kind) {
|
|
9881
|
+
case "function": {
|
|
9882
|
+
const func = tag.func;
|
|
9883
|
+
if (!isNamedFunctionEntity(func.entity)) {
|
|
9884
|
+
return void 0;
|
|
9885
|
+
}
|
|
9886
|
+
name = this.getEntityName(func.entity);
|
|
9887
|
+
typeArguments = func.kind === "substituted-function" ? Query.from(func.value.getSubstitutions().getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
|
|
9888
|
+
parameterEntities = func.entity.getParameters();
|
|
9889
|
+
break;
|
|
9890
|
+
}
|
|
9891
|
+
case "type": {
|
|
9892
|
+
const typeEntity = tag.typeEntity;
|
|
9893
|
+
if (!isNamedTypeEntity(typeEntity)) {
|
|
9894
|
+
return void 0;
|
|
9895
|
+
}
|
|
9896
|
+
name = this.getEntityName(typeEntity);
|
|
9897
|
+
const substitutions = tag.constructor_.substitutions;
|
|
9898
|
+
typeArguments = substitutions.size > 0 ? Query.from(substitutions.getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
|
|
9899
|
+
parameterEntities = tag.constructor_.entity.getParameters();
|
|
9900
|
+
break;
|
|
9901
|
+
}
|
|
9902
|
+
default:
|
|
9903
|
+
Debug.never(tag);
|
|
9904
|
+
}
|
|
9905
|
+
let args;
|
|
9906
|
+
if (tag.argumentByOriginalParameter.size > 0) {
|
|
9907
|
+
args = [];
|
|
9908
|
+
for (const parameterEntity of parameterEntities) {
|
|
9909
|
+
const argument = tag.argumentByOriginalParameter.get(parameterEntity.originalEntity);
|
|
9910
|
+
if (argument !== void 0) {
|
|
9911
|
+
let argumentExpression;
|
|
9912
|
+
switch (argument.kind) {
|
|
9913
|
+
case "text":
|
|
9914
|
+
argumentExpression = SyntaxFactory.textLiteral(argument.value);
|
|
9915
|
+
break;
|
|
9916
|
+
case "boolean":
|
|
9917
|
+
argumentExpression = SyntaxFactory.booleanLiteral(argument.value);
|
|
9918
|
+
break;
|
|
9919
|
+
case "numeric":
|
|
9920
|
+
argumentExpression = SyntaxFactory.numericLiteral(argument.value);
|
|
9921
|
+
break;
|
|
9922
|
+
case "variable-expression": {
|
|
9923
|
+
const firstSegmentEntity = argument.segments[0];
|
|
9924
|
+
if (firstSegmentEntity.subkind === "field") {
|
|
9925
|
+
const containingType = firstSegmentEntity.getContainingType();
|
|
9926
|
+
if (!isNamedTypeEntity(containingType)) {
|
|
9927
|
+
return void 0;
|
|
9928
|
+
}
|
|
9929
|
+
argumentExpression = SyntaxFactory.memberAccessExpression(
|
|
9930
|
+
SyntaxFactory.identifierExpression(this.getEntityName(containingType)),
|
|
9931
|
+
this.getEntityName(firstSegmentEntity)
|
|
9932
|
+
);
|
|
9933
|
+
} else {
|
|
9934
|
+
argumentExpression = SyntaxFactory.identifierExpression(this.getEntityName(firstSegmentEntity));
|
|
9935
|
+
}
|
|
9936
|
+
for (let i = 1; i < argument.segments.length; i++) {
|
|
9937
|
+
argumentExpression = SyntaxFactory.memberAccessExpression(
|
|
9938
|
+
argumentExpression,
|
|
9939
|
+
this.getEntityName(argument.segments[i])
|
|
9940
|
+
);
|
|
9941
|
+
}
|
|
9942
|
+
break;
|
|
9943
|
+
}
|
|
9944
|
+
case "invalid":
|
|
9945
|
+
argumentExpression = SyntaxFactory.missingExpression();
|
|
9946
|
+
break;
|
|
9947
|
+
default:
|
|
9948
|
+
Debug.never(argument);
|
|
9949
|
+
}
|
|
9950
|
+
args.push(SyntaxFactory.argument(argumentExpression));
|
|
9951
|
+
} else {
|
|
9952
|
+
args.push(SyntaxFactory.argument(SyntaxFactory.missingExpression()));
|
|
9953
|
+
}
|
|
9954
|
+
}
|
|
9955
|
+
}
|
|
9956
|
+
return SyntaxFactory.tag(name, typeArguments, args);
|
|
9874
9957
|
}
|
|
9875
9958
|
getEntityName(entity) {
|
|
9876
9959
|
return entity.getName().unescapedOriginal;
|
|
@@ -10436,11 +10519,96 @@ var EntityToSyntax2 = class {
|
|
|
10436
10519
|
break;
|
|
10437
10520
|
}
|
|
10438
10521
|
}
|
|
10439
|
-
|
|
10522
|
+
const result = Array.from(wkTagFlags).map((it) => {
|
|
10440
10523
|
const name = getWellKnownTagFlagName(it, entity.locale);
|
|
10441
10524
|
Debug.assert(name !== void 0);
|
|
10442
10525
|
return SyntaxFactory2.tag(name.unescapedOriginal);
|
|
10443
10526
|
});
|
|
10527
|
+
const entityTags = entity.getTags();
|
|
10528
|
+
result.push(...entityTags.filter((t) => !(t.kind === "type" && isPackageTypeEntity(t.typeEntity) && this.analyzer.tags.getWellKnownTagFlagByTagEntity(t.typeEntity) !== void 0)).map((t) => this.convertUserTag(t)).filter((t) => t !== void 0));
|
|
10529
|
+
return result;
|
|
10530
|
+
}
|
|
10531
|
+
convertUserTag(tag) {
|
|
10532
|
+
let name;
|
|
10533
|
+
let typeArguments;
|
|
10534
|
+
let parameterEntities;
|
|
10535
|
+
switch (tag.kind) {
|
|
10536
|
+
case "function": {
|
|
10537
|
+
const func = tag.func;
|
|
10538
|
+
if (!isNamedFunctionEntity(func.entity)) {
|
|
10539
|
+
return void 0;
|
|
10540
|
+
}
|
|
10541
|
+
name = this.getEntityName(func.entity);
|
|
10542
|
+
typeArguments = func.kind === "substituted-function" ? Query.from(func.value.getSubstitutions().getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
|
|
10543
|
+
parameterEntities = func.entity.getParameters();
|
|
10544
|
+
break;
|
|
10545
|
+
}
|
|
10546
|
+
case "type": {
|
|
10547
|
+
const typeEntity = tag.typeEntity;
|
|
10548
|
+
if (!isNamedTypeEntity(typeEntity)) {
|
|
10549
|
+
return void 0;
|
|
10550
|
+
}
|
|
10551
|
+
name = this.getEntityName(typeEntity);
|
|
10552
|
+
const substitutions = tag.constructor_.substitutions;
|
|
10553
|
+
typeArguments = substitutions.size > 0 ? Query.from(substitutions.getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
|
|
10554
|
+
parameterEntities = tag.constructor_.entity.getParameters();
|
|
10555
|
+
break;
|
|
10556
|
+
}
|
|
10557
|
+
default:
|
|
10558
|
+
Debug.never(tag);
|
|
10559
|
+
}
|
|
10560
|
+
let args;
|
|
10561
|
+
if (tag.argumentByOriginalParameter.size > 0) {
|
|
10562
|
+
args = [];
|
|
10563
|
+
for (const parameterEntity of parameterEntities) {
|
|
10564
|
+
const argument = tag.argumentByOriginalParameter.get(parameterEntity.originalEntity);
|
|
10565
|
+
if (argument !== void 0) {
|
|
10566
|
+
let argumentExpression;
|
|
10567
|
+
switch (argument.kind) {
|
|
10568
|
+
case "text":
|
|
10569
|
+
argumentExpression = SyntaxFactory2.textLiteral(argument.value);
|
|
10570
|
+
break;
|
|
10571
|
+
case "boolean":
|
|
10572
|
+
argumentExpression = SyntaxFactory2.booleanLiteral(argument.value);
|
|
10573
|
+
break;
|
|
10574
|
+
case "numeric":
|
|
10575
|
+
argumentExpression = SyntaxFactory2.numericLiteral(argument.value);
|
|
10576
|
+
break;
|
|
10577
|
+
case "variable-expression": {
|
|
10578
|
+
const firstSegmentEntity = argument.segments[0];
|
|
10579
|
+
if (firstSegmentEntity.subkind === "field") {
|
|
10580
|
+
const containingType = firstSegmentEntity.getContainingType();
|
|
10581
|
+
if (!isNamedTypeEntity(containingType)) {
|
|
10582
|
+
return void 0;
|
|
10583
|
+
}
|
|
10584
|
+
argumentExpression = SyntaxFactory2.memberAccessExpression(
|
|
10585
|
+
SyntaxFactory2.identifierExpression(this.getEntityName(containingType)),
|
|
10586
|
+
this.getEntityName(firstSegmentEntity)
|
|
10587
|
+
);
|
|
10588
|
+
} else {
|
|
10589
|
+
argumentExpression = SyntaxFactory2.identifierExpression(this.getEntityName(firstSegmentEntity));
|
|
10590
|
+
}
|
|
10591
|
+
for (let i = 1; i < argument.segments.length; i++) {
|
|
10592
|
+
argumentExpression = SyntaxFactory2.memberAccessExpression(
|
|
10593
|
+
argumentExpression,
|
|
10594
|
+
this.getEntityName(argument.segments[i])
|
|
10595
|
+
);
|
|
10596
|
+
}
|
|
10597
|
+
break;
|
|
10598
|
+
}
|
|
10599
|
+
case "invalid":
|
|
10600
|
+
argumentExpression = SyntaxFactory2.missingExpression();
|
|
10601
|
+
break;
|
|
10602
|
+
default:
|
|
10603
|
+
Debug.never(argument);
|
|
10604
|
+
}
|
|
10605
|
+
args.push(SyntaxFactory2.argument(argumentExpression));
|
|
10606
|
+
} else {
|
|
10607
|
+
args.push(SyntaxFactory2.argument(SyntaxFactory2.missingExpression()));
|
|
10608
|
+
}
|
|
10609
|
+
}
|
|
10610
|
+
}
|
|
10611
|
+
return SyntaxFactory2.tag(name, typeArguments, args);
|
|
10444
10612
|
}
|
|
10445
10613
|
getEntityName(entity) {
|
|
10446
10614
|
return entity.getName().unescapedOriginal;
|
|
@@ -10787,6 +10955,18 @@ var CompilationController = class extends RxObject2 {
|
|
|
10787
10955
|
reloadMainCompilation() {
|
|
10788
10956
|
return __async(this, null, function* () {
|
|
10789
10957
|
subscribeToFileSystemRecursively(this.rootDirectory);
|
|
10958
|
+
if (this.config.standardPackagesUri !== void 0 && this.config.standardPackagesUri.checkIfRelativeTo(this.rootDirectory.uri) === 2 /* NotRelativeOrEqual */) {
|
|
10959
|
+
const standardPackagesDirectory = this.fileSystemTree.getDirectory(this.config.standardPackagesUri);
|
|
10960
|
+
if (standardPackagesDirectory !== void 0) {
|
|
10961
|
+
subscribeToFileSystemRecursively(standardPackagesDirectory);
|
|
10962
|
+
}
|
|
10963
|
+
}
|
|
10964
|
+
if (this.config.builtInStandardPackagesUri !== void 0 && this.config.builtInStandardPackagesUri.checkIfRelativeTo(this.rootDirectory.uri) === 2 /* NotRelativeOrEqual */) {
|
|
10965
|
+
const standardPackagesDirectory = this.fileSystemTree.getDirectory(this.config.builtInStandardPackagesUri);
|
|
10966
|
+
if (standardPackagesDirectory !== void 0) {
|
|
10967
|
+
subscribeToFileSystemRecursively(standardPackagesDirectory);
|
|
10968
|
+
}
|
|
10969
|
+
}
|
|
10790
10970
|
const configurationByPackageOrGroupUri = /* @__PURE__ */ new Map();
|
|
10791
10971
|
for (const [packageUri, controller] of this.configurationControllerByPackageUri_) {
|
|
10792
10972
|
if (!controller.hasConvertedConfiguration) {
|
|
@@ -12865,7 +13045,7 @@ var SourceGenerationService = class extends RxObject7 {
|
|
|
12865
13045
|
break;
|
|
12866
13046
|
}
|
|
12867
13047
|
case 1 /* ArtelM */: {
|
|
12868
|
-
const node = new EntityToSyntax2(analyzer, packageEntity).convert();
|
|
13048
|
+
const node = new EntityToSyntax2(analyzer.dialectM, packageEntity).convert();
|
|
12869
13049
|
code = new SyntaxToCode2(node, { keywordsLocale: packageLocale }).convert();
|
|
12870
13050
|
break;
|
|
12871
13051
|
}
|