@artel/artc 0.6.25249 → 0.6.25250
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 +2 -2
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +40 -24
- package/build/{chunk-G4UMALLG.js → chunk-DJEEXP7U.js} +621 -419
- package/build/{chunk-CBYKP5SE.js → chunk-VYUD26HA.js} +2 -2
- package/build/{chunk-6OPBY3SK.js → chunk-ZZKHAAAX.js} +1 -1
- package/build/types/analysis/Analyzer.d.ts +11 -10
- package/build/types/analysis/NodeTypeUtils.d.ts +1 -1
- package/build/types/analysis/TypeNarrower.d.ts +1 -1
- package/build/types/analysis/WellKnownDeclarations.d.ts +3 -3
- package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +1 -1
- package/build/types/analysis/semantic-context/TranslationTextTemplateSemanticContext.d.ts +2 -2
- package/build/types/diagnostic/DiagnosticCode.d.ts +1 -1
- package/build/types/emitter/EmitterContext.d.ts +2 -2
- package/build/types/emitter/Entities.d.ts +1 -0
- package/build/types/emitter/EntityMap.d.ts +1 -0
- package/build/types/emitter/IrBuilder.d.ts +4 -1
- package/build/types/emitter/IrToJs.d.ts +1 -1
- package/build/types/emitter/Transformer.d.ts +4 -2
- package/build/types/emitter/ir/Nodes.d.ts +26 -5
- package/build/types/emitter/ir/types.d.ts +4 -4
- package/build/types/entities/VariableEntity.d.ts +2 -2
- package/build/types/services/DisplayService.d.ts +3 -3
- package/build/types/tree/KeywordKind.d.ts +1 -1
- package/build/types/tree/NodeKind.d.ts +5 -5
- package/build/types/tree/green/Nodes.d.ts +28 -28
- package/build/types/tree/green/SyntaxFactory.d.ts +1 -1
- package/build/types/tree/red/Nodes.d.ts +42 -42
- package/build/types/ts-interop/Entities.d.ts +0 -1
- package/build/types/ts-interop/TsInteropContext.d.ts +1 -1
- package/build/types/types/ParameterType.d.ts +3 -3
- package/build/types/types/StandardTypes.d.ts +2 -2
- 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-VYUD26HA.js";
|
|
5
|
+
import "./chunk-ZZKHAAAX.js";
|
|
6
6
|
import {
|
|
7
7
|
__async
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-DJEEXP7U.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-ZZKHAAAX.js";
|
|
4
4
|
import {
|
|
5
5
|
AccessKind,
|
|
6
6
|
AccessedFunctionValueParameter,
|
|
@@ -332,7 +332,7 @@ import {
|
|
|
332
332
|
withoutQuotes,
|
|
333
333
|
withoutTemplateQuotes,
|
|
334
334
|
yieldExecution
|
|
335
|
-
} from "../chunk-
|
|
335
|
+
} from "../chunk-DJEEXP7U.js";
|
|
336
336
|
export {
|
|
337
337
|
AccessKind,
|
|
338
338
|
AccessedFunctionValueParameter,
|
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-VYUD26HA.js";
|
|
10
|
+
import "../chunk-ZZKHAAAX.js";
|
|
11
|
+
import "../chunk-DJEEXP7U.js";
|
|
12
12
|
export {
|
|
13
13
|
CommandLineCompiler,
|
|
14
14
|
FileSystemUri,
|
package/build/api/ApiServices.js
CHANGED
|
@@ -178,7 +178,7 @@ import {
|
|
|
178
178
|
unwrapParenthesizedExpressions,
|
|
179
179
|
visitChildren,
|
|
180
180
|
yieldExecution
|
|
181
|
-
} from "../chunk-
|
|
181
|
+
} from "../chunk-DJEEXP7U.js";
|
|
182
182
|
|
|
183
183
|
// source/services/CustomCommand.ts
|
|
184
184
|
import * as ls from "vscode-languageserver";
|
|
@@ -840,8 +840,8 @@ var SyntaxFactory = class {
|
|
|
840
840
|
const closeBraceToken = this.token(21 /* CloseBrace */);
|
|
841
841
|
return new FunctionBlock(openBraceToken, statementList, closeBraceToken);
|
|
842
842
|
}
|
|
843
|
-
static
|
|
844
|
-
return new KeywordExpression(this.keyword(57 /*
|
|
843
|
+
static nullLiteral() {
|
|
844
|
+
return new KeywordExpression(this.keyword(57 /* Null */));
|
|
845
845
|
}
|
|
846
846
|
static integerLiteral(value) {
|
|
847
847
|
return new TokenExpression(this.token(2 /* IntegerLiteral */, value.toString()));
|
|
@@ -2142,16 +2142,16 @@ var SyntaxToCode = class _SyntaxToCode {
|
|
|
2142
2142
|
[137 /* FieldOrVariantTranslation */]: this.prototype.writeFieldOrVariantTranslation,
|
|
2143
2143
|
[138 /* TypeMemberTranslationList */]: this.prototype.writeNodeDefault,
|
|
2144
2144
|
[139 /* TypeTranslation */]: this.prototype.writeTypeTranslation,
|
|
2145
|
-
[140 /*
|
|
2145
|
+
[140 /* TextTranslationDeclaration */]: this.prototype.writeNodeDefault,
|
|
2146
2146
|
[149 /* TagList */]: this.prototype.writeNodeDefault,
|
|
2147
2147
|
[151 /* ModifierList */]: this.prototype.writeNodeDefault,
|
|
2148
2148
|
[156 /* TypeArgumentList */]: this.prototype.writeNodeDefault,
|
|
2149
2149
|
[158 /* TypeParameterList */]: this.prototype.writeNodeDefault,
|
|
2150
2150
|
[159 /* TypeAnnotation */]: this.prototype.writeNodeDefault,
|
|
2151
|
-
[141 /*
|
|
2152
|
-
[142 /*
|
|
2153
|
-
[143 /*
|
|
2154
|
-
[144 /*
|
|
2151
|
+
[141 /* TextTemplateDeclaration */]: this.prototype.writeNodeDefault,
|
|
2152
|
+
[142 /* TextTemplateDeclarationSpanList */]: this.prototype.writeNodeDefault,
|
|
2153
|
+
[143 /* TextTemplateDeclarationSpan */]: this.prototype.writeNodeDefault,
|
|
2154
|
+
[144 /* TextTemplateParameterDeclaration */]: this.prototype.writeNodeDefault
|
|
2155
2155
|
};
|
|
2156
2156
|
return writeFunctions;
|
|
2157
2157
|
}
|
|
@@ -3454,7 +3454,7 @@ var CompletionService = class {
|
|
|
3454
3454
|
}
|
|
3455
3455
|
if (role.kind === "array-element") {
|
|
3456
3456
|
let type = this._analyzer.type.ofExpression(role.array);
|
|
3457
|
-
type = this._analyzer.
|
|
3457
|
+
type = this._analyzer.excludeNullFromType(type);
|
|
3458
3458
|
const isArrayCheck = this._analyzer.isTypeArrayOrReadonlyArray(type);
|
|
3459
3459
|
if (isArrayCheck !== void 0) {
|
|
3460
3460
|
return { targetTypes: [isArrayCheck.elementType], targetSignaturesParameters: void 0 };
|
|
@@ -3480,7 +3480,7 @@ var CompletionService = class {
|
|
|
3480
3480
|
}
|
|
3481
3481
|
if (role.kind === "function-block-expression") {
|
|
3482
3482
|
const targetType = semanticContext.getContainingSubprogram()?.getReturnType();
|
|
3483
|
-
if (targetType !== void 0 && !targetType.equals(this._analyzer.originalStandardTypes.
|
|
3483
|
+
if (targetType !== void 0 && !targetType.equals(this._analyzer.originalStandardTypes.nullType)) {
|
|
3484
3484
|
return { targetTypes: [targetType], targetSignaturesParameters: void 0 };
|
|
3485
3485
|
}
|
|
3486
3486
|
return { targetTypes: void 0, targetSignaturesParameters: void 0 };
|
|
@@ -3589,7 +3589,7 @@ var CompletionService = class {
|
|
|
3589
3589
|
kinds.add(9 /* From */);
|
|
3590
3590
|
}
|
|
3591
3591
|
if (syntaxContext.isExpressionContext !== void 0) {
|
|
3592
|
-
kinds.add(43 /* Not */).add(52 /* Yes */).add(53 /* No */).add(57 /*
|
|
3592
|
+
kinds.add(43 /* Not */).add(52 /* Yes */).add(53 /* No */).add(57 /* Null */).add(40 /* Async */).add(12 /* Function */).add(54 /* Reference */).add(2 /* Autotype */).add(30 /* Cond */);
|
|
3593
3593
|
if (positionDescription.kind === "after-token-or-keyword") {
|
|
3594
3594
|
const container = semanticContext.getContainingTypeOrTypeExtension();
|
|
3595
3595
|
if (container !== void 0) {
|
|
@@ -3900,7 +3900,7 @@ var CompletionService = class {
|
|
|
3900
3900
|
return new NamedTypeCompletionItemInfo(this.completionItemInfoContext, entity, prefix, sortText);
|
|
3901
3901
|
}
|
|
3902
3902
|
getTypeMemberCompletionItemInfos(ctx) {
|
|
3903
|
-
const type = this._analyzer.
|
|
3903
|
+
const type = this._analyzer.excludeNullFromType(ctx.type);
|
|
3904
3904
|
const memberLookup = TypeMemberLookup.ofType(this._analyzer, type, this._locale);
|
|
3905
3905
|
const options6 = ctx.isStaticAccess ? 2 /* OnlyStaticMembers */ : 1 /* OnlyInstanceMembers */;
|
|
3906
3906
|
return memberLookup.getNamedMembers(options6, ctx.hidingMatcher, ctx.typeExtensionLookup).map((m) => {
|
|
@@ -6742,20 +6742,30 @@ var DefinitionService = class {
|
|
|
6742
6742
|
default:
|
|
6743
6743
|
Debug.never(semanticInfo);
|
|
6744
6744
|
}
|
|
6745
|
-
if (
|
|
6746
|
-
const sourceLocations =
|
|
6747
|
-
|
|
6745
|
+
if (this._sourceGenerationService !== void 0 && semanticInfo.kind === "reference") {
|
|
6746
|
+
const sourceLocations = new Array();
|
|
6747
|
+
for (const referenceTarget of semanticInfo.betterTargets ?? semanticInfo.targets) {
|
|
6748
|
+
const referencedEntity = this.getReferenceTargetEntity(referenceTarget);
|
|
6748
6749
|
if (referencedEntity !== void 0 && this._sourceGenerationService.entityDefinitionRequiresSourceGeneration(referencedEntity)) {
|
|
6749
|
-
|
|
6750
|
+
const locations = yield this._sourceGenerationService.getDefinitionInGeneratedCode(
|
|
6750
6751
|
analyzer,
|
|
6751
6752
|
referencedEntity,
|
|
6752
6753
|
cancellationToken
|
|
6753
6754
|
);
|
|
6755
|
+
if (locations !== void 0) {
|
|
6756
|
+
sourceLocations.push(...locations);
|
|
6757
|
+
}
|
|
6754
6758
|
}
|
|
6755
|
-
|
|
6756
|
-
}).toArray())).filter((l) => l !== void 0).flatMap((l) => l);
|
|
6759
|
+
}
|
|
6757
6760
|
if (sourceLocations.length > 0) {
|
|
6758
|
-
result
|
|
6761
|
+
if (result === void 0) {
|
|
6762
|
+
result = new DefinitionsAndReferenceInfo(sourceLocations, tokenOrKeyword.value.rangeWithoutTrivia);
|
|
6763
|
+
} else {
|
|
6764
|
+
result = new DefinitionsAndReferenceInfo(
|
|
6765
|
+
result.definitionLocations.concat(sourceLocations),
|
|
6766
|
+
result.referenceRange
|
|
6767
|
+
);
|
|
6768
|
+
}
|
|
6759
6769
|
}
|
|
6760
6770
|
}
|
|
6761
6771
|
return result;
|
|
@@ -11531,6 +11541,12 @@ var EntityToSyntax = class {
|
|
|
11531
11541
|
if (isHidden !== void 0) {
|
|
11532
11542
|
modifiers.push(this.createHidingModifier(isHidden));
|
|
11533
11543
|
}
|
|
11544
|
+
if (entity.markedBasic()) {
|
|
11545
|
+
modifiers.push(SyntaxFactory.modifier(17 /* Basic */));
|
|
11546
|
+
}
|
|
11547
|
+
if (entity.isAbstract()) {
|
|
11548
|
+
modifiers.push(SyntaxFactory.modifier(38 /* Abstract */));
|
|
11549
|
+
}
|
|
11534
11550
|
const name = this.getEntityName(entity);
|
|
11535
11551
|
const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
|
|
11536
11552
|
const body = this.createStructuredTypeDeclarationBody(entity);
|
|
@@ -11802,7 +11818,7 @@ var EntityToSyntax = class {
|
|
|
11802
11818
|
const type = this.convertType(entity.getType());
|
|
11803
11819
|
let defaultValue;
|
|
11804
11820
|
if (entity.isOptional()) {
|
|
11805
|
-
defaultValue = SyntaxFactory.
|
|
11821
|
+
defaultValue = SyntaxFactory.nullLiteral();
|
|
11806
11822
|
}
|
|
11807
11823
|
return SyntaxFactory.parameterDeclaration(tags, name, type, defaultValue);
|
|
11808
11824
|
}
|
|
@@ -11894,10 +11910,10 @@ var EntityToSyntax = class {
|
|
|
11894
11910
|
}
|
|
11895
11911
|
convertUnionType(type) {
|
|
11896
11912
|
if (type.originalTypes.length === 2) {
|
|
11897
|
-
const
|
|
11898
|
-
if (
|
|
11899
|
-
const
|
|
11900
|
-
const result = SyntaxFactory.nullableTypeSpecifier(this.convertType(
|
|
11913
|
+
const nullTypeIndex = type.originalTypes.findIndex((t) => t.equals(this._analyzer.originalStandardTypes.nullType));
|
|
11914
|
+
if (nullTypeIndex >= 0) {
|
|
11915
|
+
const nonNullType = nullTypeIndex === 0 ? type.originalTypes[1] : type.originalTypes[0];
|
|
11916
|
+
const result = SyntaxFactory.nullableTypeSpecifier(this.convertType(nonNullType));
|
|
11901
11917
|
return result;
|
|
11902
11918
|
}
|
|
11903
11919
|
}
|