@artel/artc 0.6.25222 → 0.6.25223

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 CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CommandLineCompiler
4
- } from "./chunk-MBMOAUK7.js";
5
- import "./chunk-UZK7JCND.js";
4
+ } from "./chunk-AX3LQ2CF.js";
5
+ import "./chunk-LG4Z4SWO.js";
6
6
  import {
7
7
  __async
8
- } from "./chunk-ODWG5ZXF.js";
8
+ } from "./chunk-DZNNWICP.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-UZK7JCND.js";
3
+ } from "../chunk-LG4Z4SWO.js";
4
4
  import {
5
5
  AccessKind,
6
6
  AccessedMethodValueParameter,
@@ -238,6 +238,7 @@ import {
238
238
  TypeIndexerParameterDeclarationEntity,
239
239
  TypeMemberEntityContainer,
240
240
  TypeMemberLookup,
241
+ TypeMemberLookupOptions,
241
242
  TypeMethodDeclarationEntity,
242
243
  TypeOrTypeExtension,
243
244
  TypeParameterConstraint,
@@ -245,6 +246,7 @@ import {
245
246
  TypeVariableDeclarationEntity,
246
247
  TypeVariableGetterDeclarationEntity,
247
248
  TypeVariableSetterDeclarationEntity,
249
+ TypeVariableWithInitializerSemanticContext,
248
250
  UnfinishedIntrinsicAnonymousMethodTypeEntity,
249
251
  UnfinishedIntrinsicAnonymousStructuredTypeEntity,
250
252
  UnfinishedIntrinsicPackageMethodTypeEntity,
@@ -296,6 +298,7 @@ import {
296
298
  isTypeEntity,
297
299
  isTypeEntityWithMembers,
298
300
  isTypeMemberEntity,
301
+ isTypeWithMembersOrExtensionEntity,
299
302
  isUnaryOperator,
300
303
  javaScriptIdentifierRegExp,
301
304
  kebabCaseToCamelCase,
@@ -329,7 +332,7 @@ import {
329
332
  withoutQuotes,
330
333
  withoutTemplateQuotes,
331
334
  yieldExecution
332
- } from "../chunk-ODWG5ZXF.js";
335
+ } from "../chunk-DZNNWICP.js";
333
336
  export {
334
337
  AccessKind,
335
338
  AccessedMethodValueParameter,
@@ -564,6 +567,7 @@ export {
564
567
  TypeIndexerParameterDeclarationEntity,
565
568
  TypeMemberEntityContainer,
566
569
  TypeMemberLookup,
570
+ TypeMemberLookupOptions,
567
571
  TypeMethodDeclarationEntity,
568
572
  TypeOrTypeExtension,
569
573
  TypeParameterConstraint,
@@ -571,6 +575,7 @@ export {
571
575
  TypeVariableDeclarationEntity,
572
576
  TypeVariableGetterDeclarationEntity,
573
577
  TypeVariableSetterDeclarationEntity,
578
+ TypeVariableWithInitializerSemanticContext,
574
579
  UnfinishedIntrinsicAnonymousMethodTypeEntity,
575
580
  UnfinishedIntrinsicAnonymousStructuredTypeEntity,
576
581
  UnfinishedIntrinsicPackageMethodTypeEntity,
@@ -625,6 +630,7 @@ export {
625
630
  isTypeEntity,
626
631
  isTypeEntityWithMembers,
627
632
  isTypeMemberEntity,
633
+ isTypeWithMembersOrExtensionEntity,
628
634
  isUnaryOperator,
629
635
  javaScriptIdentifierRegExp,
630
636
  kebabCaseToCamelCase,
@@ -6,9 +6,9 @@ import {
6
6
  PhysicalFileSystem,
7
7
  PhysicalTypeScriptLibrariesProvider,
8
8
  PrintingDiagnosticAcceptor
9
- } from "../chunk-MBMOAUK7.js";
10
- import "../chunk-UZK7JCND.js";
11
- import "../chunk-ODWG5ZXF.js";
9
+ } from "../chunk-AX3LQ2CF.js";
10
+ import "../chunk-LG4Z4SWO.js";
11
+ import "../chunk-DZNNWICP.js";
12
12
  export {
13
13
  CommandLineCompiler,
14
14
  FileSystemUri,
@@ -182,7 +182,7 @@ import {
182
182
  unwrapParenthesizedExpressions,
183
183
  visitChildren,
184
184
  yieldExecution
185
- } from "../chunk-ODWG5ZXF.js";
185
+ } from "../chunk-DZNNWICP.js";
186
186
 
187
187
  // source/services/CustomCommand.ts
188
188
  import * as ls from "vscode-languageserver";
@@ -319,7 +319,7 @@ var AddPropertyAssignmentService = class {
319
319
  const reassignmentText = `${leftValueText} = ${value}`;
320
320
  const subprogramBody = this.ifShouldBeAssignedAtTheEndOfSubprogramThenBody(assignmentNode);
321
321
  if (subprogramBody !== void 0) {
322
- const lastStatement = subprogramBody.expression ?? subprogramBody.statementList?.statements.last();
322
+ const lastStatement = subprogramBody.expressionOrStatementList.kind === 92 /* StatementList */ ? subprogramBody.expressionOrStatementList?.statements.last() : subprogramBody.expressionOrStatementList;
323
323
  let editRangeStart;
324
324
  let indentationText;
325
325
  if (lastStatement !== void 0) {
@@ -349,39 +349,12 @@ var AddPropertyAssignmentService = class {
349
349
  * расположить сразу после. Иначе присваивание необходимо расположить в конце подпрограммы (после всех ветвлений).
350
350
  */
351
351
  ifShouldBeAssignedAtTheEndOfSubprogramThenBody(node) {
352
- const parent = node.parent.parent.parent;
352
+ const parent = node.parent.parent;
353
353
  switch (parent.kind) {
354
- case 25 /* PackageConstructorDeclaration */:
355
- case 26 /* PackageEntryPointDeclaration */:
356
- case 27 /* PackageMethodDeclaration */:
357
- case 36 /* PackageVariableGetterDeclaration */:
358
- case 37 /* PackageVariableSetterDeclaration */:
359
- case 45 /* TypeConstructorDeclaration */:
360
- case 46 /* TypeDestructorDeclaration */:
361
- case 47 /* TypeIndexedGetterDeclaration */:
362
- case 48 /* TypeIndexedSetterDeclaration */:
363
- case 50 /* TypeDereferencedVariableGetterDeclaration */:
364
- case 51 /* TypeDereferencedVariableSetterDeclaration */:
365
- case 52 /* TypeMethodDeclaration */:
366
- case 55 /* TypeVariableGetterDeclaration */:
367
- case 56 /* TypeVariableSetterDeclaration */:
368
- case 58 /* NestedMethodDeclaration */:
369
- case 67 /* MethodBlockLiteral */:
370
- case 74 /* MethodLiteral */:
371
- case 53 /* OperatorDeclaration */:
372
- return void 0;
373
- case 98 /* RunStatement */:
374
- case 99 /* TryStatement */:
375
- case 100 /* CatchClause */:
376
- case 102 /* FinallyClause */:
377
- case 108 /* ForStatement */:
378
- case 109 /* IfStatement */:
379
- case 111 /* ElseIfClause */:
380
- case 112 /* ElseClause */:
381
- case 116 /* LoopStatement */:
382
- case 121 /* CaseClause */:
383
- case 122 /* WhileStatement */:
354
+ case 93 /* StatementBlock */:
384
355
  return this.getContainingSubprogram(parent)?.block;
356
+ case 94 /* FunctionBlock */:
357
+ return void 0;
385
358
  default:
386
359
  Debug.never(parent);
387
360
  }
@@ -859,13 +832,13 @@ var SyntaxFactory = class {
859
832
  static functionExpressionBlock(expression) {
860
833
  const openBraceToken = this.token(43 /* OpenBrace */);
861
834
  const closeBraceToken = this.token(20 /* CloseBrace */);
862
- return new FunctionBlock(openBraceToken, expression, void 0, closeBraceToken);
835
+ return new FunctionBlock(openBraceToken, expression, closeBraceToken);
863
836
  }
864
837
  static functionStatementBlock(statements) {
865
838
  const openBraceToken = this.token(43 /* OpenBrace */);
866
839
  const statementList = new StatementList(statements);
867
840
  const closeBraceToken = this.token(20 /* CloseBrace */);
868
- return new FunctionBlock(openBraceToken, void 0, statementList, closeBraceToken);
841
+ return new FunctionBlock(openBraceToken, statementList, closeBraceToken);
869
842
  }
870
843
  static noneLiteral() {
871
844
  return new KeywordExpression(this.keyword(57 /* None */));
@@ -1672,7 +1645,7 @@ var SyntaxToCode = class _SyntaxToCode {
1672
1645
  this.writeNodeDefault(node);
1673
1646
  }
1674
1647
  writeDeclarationBody(node, addLeadingNewLineOrWhitespace = true) {
1675
- if (node.statementList === void 0 || node.statementList.elements.length === 0) {
1648
+ if (node.expressionOrStatementList.kind !== 92 /* StatementList */ || node.expressionOrStatementList.elements.length === 0) {
1676
1649
  this.writeWhitespace();
1677
1650
  this.writeFunctionBlock(node, false);
1678
1651
  } else {
@@ -4049,8 +4022,9 @@ var CompletionService = class {
4049
4022
  }
4050
4023
  getTypeMemberCompletionItemInfos(ctx) {
4051
4024
  const type = this._analyzer.excludeNoneFromType(ctx.type);
4052
- const memberLookup = new TypeMemberLookup(this._analyzer, type, ctx.localizationContext);
4053
- return memberLookup.getNamedMembers(ctx.hidingMatcher, ctx.typeExtensionsLookup).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((m) => {
4025
+ const memberLookup = TypeMemberLookup.ofType(this._analyzer, type, ctx.localizationContext);
4026
+ const options6 = ctx.isStaticAccess ? 2 /* OnlyStaticMembers */ : 0 /* None */;
4027
+ return memberLookup.getNamedMembers(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((m) => {
4054
4028
  switch (m.value.kind) {
4055
4029
  case "method":
4056
4030
  return new TypeMethodCompletionItemInfo(
@@ -4069,7 +4043,7 @@ var CompletionService = class {
4069
4043
  default:
4070
4044
  Debug.never(m.value);
4071
4045
  }
4072
- }).concat(memberLookup.getOperators(ctx.hidingMatcher, ctx.typeExtensionsLookup).filter((m) => m.value.isStatic() === ctx.isStaticAccess).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
4046
+ }).concat(memberLookup.getOperators(options6, ctx.hidingMatcher, ctx.typeExtensionsLookup).map((o) => new OperatorCompletionItemInfo(this.completionItemInfoContext, o.value, o.localization)));
4073
4047
  }
4074
4048
  getPackageImportCompletionItemInfos(ctx) {
4075
4049
  const result = this._analyzer.packageImports.getPackagesAvailableForImport(this._sourceFile.package).map((p) => p.getImportName()).filter((n) => {
@@ -5319,7 +5293,7 @@ var SyntaxContextFactory = class {
5319
5293
  }
5320
5294
  if (tokenOrKeyword.isToken(43 /* OpenBrace */) && tokenOrKeyword.parent.kind === 94 /* FunctionBlock */) {
5321
5295
  const block = tokenOrKeyword.parent;
5322
- if (block.expression !== void 0 || block.statementList?.statements.count() === 0) {
5296
+ if (block.expressionOrStatementList.kind !== 92 /* StatementList */ || block.expressionOrStatementList.statements.count() === 0) {
5323
5297
  return {
5324
5298
  isExpressionContext: { expressionRole: new ExpressionRole_functionBlockExpression(block) },
5325
5299
  isStatementContext: true
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Compiler
3
- } from "./chunk-UZK7JCND.js";
3
+ } from "./chunk-LG4Z4SWO.js";
4
4
  import {
5
5
  ArtelVersion,
6
6
  Cached,
@@ -14,7 +14,7 @@ import {
14
14
  __async,
15
15
  performanceMeasurementStageNames,
16
16
  performanceMeasurementStages
17
- } from "./chunk-ODWG5ZXF.js";
17
+ } from "./chunk-DZNNWICP.js";
18
18
 
19
19
  // source/executor/FileSystemUri.ts
20
20
  import { platform } from "os";