@artel/artc 0.6.25254 → 0.6.25256
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 +18 -8
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +607 -389
- package/build/{chunk-JTDPRR7O.js → chunk-CTEZ5IHI.js} +2 -2
- package/build/{chunk-3JS4YG6N.js → chunk-ER3TEZSN.js} +14316 -16033
- package/build/{chunk-JV2EK6MS.js → chunk-IHZZGWNS.js} +1 -1
- package/build/types/analysis/AccessedFunction.d.ts +19 -6
- package/build/types/analysis/AnalyzedTranslationPackage.d.ts +2 -1
- package/build/types/analysis/Analyzer.d.ts +119 -47
- package/build/types/analysis/ArgumentToParameterMatchResult.d.ts +1 -4
- package/build/types/analysis/ArgumentsToParametersMatcher.d.ts +9 -15
- package/build/types/analysis/AutotypeCallExpressionMeaning.d.ts +13 -7
- package/build/types/analysis/BaseExpressionMeaning.d.ts +43 -15
- package/build/types/analysis/CallExpressionMeaning.d.ts +41 -22
- package/build/types/analysis/ConstructorCallResolver.d.ts +22 -0
- package/build/types/analysis/DiagnosticArgumentFactory.d.ts +3 -1
- package/build/types/analysis/DiagnosticCollector.d.ts +5 -9
- package/build/types/analysis/DisplayableEntity.d.ts +12 -6
- package/build/types/analysis/FunctionAccessResolver.d.ts +15 -0
- package/build/types/analysis/IdentifierExpressionMeaning.d.ts +56 -22
- package/build/types/analysis/IndexedAccessExpressionMeaning.d.ts +3 -2
- package/build/types/analysis/MemberAccessExpressionMeaning.d.ts +76 -27
- package/build/types/analysis/NamedTypeSpecifierResolver.d.ts +0 -1
- package/build/types/analysis/NodeTypeUtils.d.ts +1 -0
- package/build/types/analysis/ObjectExpressionMeaning.d.ts +1 -0
- package/build/types/analysis/OperatorAccessResolver.d.ts +9 -0
- package/build/types/analysis/OverloadResolver.d.ts +91 -5
- package/build/types/analysis/ReturnTypeInferrer.d.ts +13 -0
- package/build/types/analysis/SourceFileMembers.d.ts +2 -0
- package/build/types/analysis/SubstitutedFunction.d.ts +22 -20
- package/build/types/analysis/TagMeaning.d.ts +16 -15
- package/build/types/analysis/TypeArgumentInferrer.d.ts +49 -0
- package/build/types/analysis/TypeNarrower.d.ts +6 -4
- package/build/types/analysis/TypeOverloadResolver.d.ts +4 -2
- package/build/types/analysis/UserDefinableBinaryOperatorResolver.d.ts +2 -6
- package/build/types/analysis/UserDefinableUnaryOperatorResolver.d.ts +2 -2
- package/build/types/analysis/Utils.d.ts +2 -0
- package/build/types/analysis/Visitor.d.ts +2 -2
- package/build/types/analysis/index.d.ts +0 -2
- package/build/types/analysis/semantic-context/Declarations.d.ts +4 -4
- package/build/types/analysis/semantic-context/SemanticContextBase.d.ts +4 -0
- package/build/types/analysis/semantic-context/SemanticContextBuilder.d.ts +1 -0
- package/build/types/api/Api.d.ts +0 -2
- package/build/types/common/ArrayUtils.d.ts +5 -2
- package/build/types/common/Cached.d.ts +4 -0
- package/build/types/common/Lazy.d.ts +2 -0
- package/build/types/common/Query.d.ts +1 -1
- package/build/types/common/TreeQuery.d.ts +14 -48
- package/build/types/common/TreeTraversal.d.ts +1 -1
- package/build/types/common/index.d.ts +0 -1
- package/build/types/diagnostic/Diagnostic.d.ts +7 -0
- package/build/types/diagnostic/DiagnosticCode.d.ts +180 -173
- package/build/types/entities/AliasTypeEntity.d.ts +1 -0
- package/build/types/entities/AliasedType.d.ts +2 -2
- package/build/types/entities/FunctionEntity.d.ts +6 -3
- package/build/types/entities/FunctionTypeEntity.d.ts +2 -1
- package/build/types/entities/PackageAliasEntity.d.ts +2 -2
- package/build/types/entities/PackageMembers.d.ts +1 -0
- package/build/types/entities/StructuredTypeEntity.d.ts +1 -0
- package/build/types/entities/TypeEntityMembers.d.ts +2 -0
- package/build/types/entities/TypeParameterEntity.d.ts +1 -0
- package/build/types/entities/VariableEntity.d.ts +23 -11
- package/build/types/entities/VariantTypeEntity.d.ts +1 -0
- package/build/types/entities/index.d.ts +3 -2
- package/build/types/parser/CharacterCodes.d.ts +0 -8
- package/build/types/parser/Parser.d.ts +2 -2
- package/build/types/parser/TriviaInterner.d.ts +8 -0
- package/build/types/services/AddPropertyAssignmentService.d.ts +0 -7
- package/build/types/services/DisplayService.d.ts +16 -10
- package/build/types/services/NodeSemanticInfo.d.ts +3 -1
- package/build/types/services/TreeUtils.d.ts +1 -1
- package/build/types/services/signature-help/SignatureWithValueParameters.d.ts +9 -1
- package/build/types/services/signature-help/TypeParameterSignatureHelpProvider.d.ts +1 -1
- package/build/types/services/source-generation/EntityToSyntax.d.ts +1 -1
- package/build/types/tree/BaseNode.d.ts +32 -0
- package/build/types/tree/{green/Nodes.d.ts → Nodes.d.ts} +411 -359
- package/build/types/tree/{green/SyntaxToCode.d.ts → SyntaxToCode.d.ts} +1 -1
- package/build/types/tree/{green/Token.d.ts → Token.d.ts} +26 -10
- package/build/types/tree/{red/Utils.d.ts → Utils.d.ts} +4 -3
- package/build/types/tree/index.d.ts +10 -1
- package/build/types/ts-interop/Entities.d.ts +14 -0
- package/build/types/types/AliasType.d.ts +2 -2
- package/build/types/types/FunctionType.d.ts +2 -2
- package/build/types/types/IntersectionType.d.ts +3 -3
- package/build/types/types/ParameterType.d.ts +2 -2
- package/build/types/types/StructuredType.d.ts +2 -2
- package/build/types/types/Substitutions.d.ts +18 -6
- package/build/types/types/Type.d.ts +3 -3
- package/build/types/types/TypeMembers.d.ts +2 -1
- package/build/types/types/UnionType.d.ts +3 -3
- package/build/types/types/UnresolvedType.d.ts +2 -2
- package/build/types/types/VariantType.d.ts +2 -2
- package/package.json +7 -1
- package/build/types/analysis/ConstructorOverloadResolver.d.ts +0 -31
- package/build/types/analysis/FunctionOverloadResolver.d.ts +0 -21
- package/build/types/analysis/TargetTypeHint.d.ts +0 -5
- package/build/types/common/Errors.d.ts +0 -2
- package/build/types/tree/green/BaseNode.d.ts +0 -14
- package/build/types/tree/green/Utils.d.ts +0 -2
- package/build/types/tree/green/index.d.ts +0 -8
- package/build/types/tree/red/BaseNode.d.ts +0 -16
- package/build/types/tree/red/Internal.d.ts +0 -2
- package/build/types/tree/red/Nodes.d.ts +0 -2271
- package/build/types/tree/red/Token.d.ts +0 -30
- package/build/types/tree/red/index.d.ts +0 -10
- /package/build/types/tree/{red/NodePath.d.ts → NodePath.d.ts} +0 -0
- /package/build/types/tree/{green/SyntaxFactory.d.ts → SyntaxFactory.d.ts} +0 -0
|
@@ -1,21 +1,13 @@
|
|
|
1
1
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
2
|
import * as tree from '../tree/index.js';
|
|
3
3
|
import * as types from '../types/index.js';
|
|
4
|
+
import { AccessedFunction } from './AccessedFunction.js';
|
|
4
5
|
import { Analyzer } from './Analyzer.js';
|
|
5
|
-
|
|
6
|
-
* "основа" не является самостоятельным выражением и может использоваться только в следующих конструкциях:
|
|
7
|
-
* 1. `основа()` - в конструкторе для вызова базового конструктора или в методе для вызова базового метода.
|
|
8
|
-
* 2. `основа.поле` (`основа.метод`) - в любом выражении в контексте типа, имеющего базовый тип.
|
|
9
|
-
* 3. `основа[]` - аналогично п. 2.
|
|
10
|
-
* 4. `основа^` - аналогично п. 2.
|
|
11
|
-
* 5. `(основа как БазовыйАспект).поле`, `(основа как БазовыйАспект)[]`, `(основа как БазовыйАспект)^` - для доступа к
|
|
12
|
-
* реализации по умолчанию члена базового аспекта.
|
|
13
|
-
*/
|
|
14
|
-
export declare class Resolver {
|
|
6
|
+
export declare class FirstStageResolver {
|
|
15
7
|
private readonly _analyzer;
|
|
16
8
|
private readonly _node;
|
|
17
9
|
constructor(analyzer: Analyzer, node: tree.BaseExpression);
|
|
18
|
-
resolve():
|
|
10
|
+
resolve(): FirstStageResolutionsResult;
|
|
19
11
|
private resolveBaseConstructorOrMethodAccess;
|
|
20
12
|
private resolveBaseConstructorAccess;
|
|
21
13
|
private resolveBaseMethodAccess;
|
|
@@ -25,11 +17,29 @@ export declare class Resolver {
|
|
|
25
17
|
private getBaseOrAliasedType;
|
|
26
18
|
private getContainingTypeMemberDeclaration;
|
|
27
19
|
}
|
|
28
|
-
|
|
20
|
+
/**
|
|
21
|
+
* "основа" не является самостоятельным выражением и может использоваться только в следующих конструкциях:
|
|
22
|
+
* 1. `основа()` - в конструкторе для вызова базового конструктора или в методе для вызова базового метода.
|
|
23
|
+
* 2. `основа.поле` (`основа.метод`) - в любом выражении в контексте типа, имеющего базовый тип.
|
|
24
|
+
* 3. `основа[]` - аналогично п. 2.
|
|
25
|
+
* 4. `основа^` - аналогично п. 2.
|
|
26
|
+
* 5. `(основа как БазовыйАспект).поле`, `(основа как БазовыйАспект)[]`, `(основа как БазовыйАспект)^` - для доступа к
|
|
27
|
+
* реализации по умолчанию члена базового аспекта.
|
|
28
|
+
*/
|
|
29
|
+
export declare class SecondStageResolver {
|
|
30
|
+
private readonly _analyzer;
|
|
31
|
+
private readonly _node;
|
|
32
|
+
private readonly _firstStageResolutionResult;
|
|
33
|
+
constructor(analyzer: Analyzer, node: tree.BaseExpression, firstStageResolutionResult: FirstStageResolutionsResult);
|
|
34
|
+
resolve(): ResolutionResult;
|
|
35
|
+
private resolveOverriddenMethodAccess;
|
|
36
|
+
private resolveOverriddenOperatorAccess;
|
|
37
|
+
}
|
|
38
|
+
export declare class ResolutionResult {
|
|
29
39
|
readonly meaning: Meaning;
|
|
30
40
|
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
31
41
|
constructor(meaning: Meaning, diagnostics?: readonly Diagnostic[] | undefined);
|
|
32
|
-
static unresolved(diagnostics?: readonly Diagnostic[]):
|
|
42
|
+
static unresolved(diagnostics?: readonly Diagnostic[]): ResolutionResult;
|
|
33
43
|
}
|
|
34
44
|
export type Meaning = Meaning_baseObjectAccess | Meaning_baseConstructorAccess | Meaning_overriddenMethodAccess | Meaning_overriddenOperatorAccess | Meaning_unresolved;
|
|
35
45
|
declare class Meaning_baseObjectAccess {
|
|
@@ -50,6 +60,7 @@ declare class Meaning_baseConstructorAccess {
|
|
|
50
60
|
readonly suitableConstructors: readonly types.Constructor[];
|
|
51
61
|
readonly kind = "base-constructor-access";
|
|
52
62
|
get singleSuitableConstructor(): types.Constructor | undefined;
|
|
63
|
+
get singleConstructor(): types.Constructor | undefined;
|
|
53
64
|
constructor(
|
|
54
65
|
/**
|
|
55
66
|
* Тип объекта, получаемого в результате вызова конструктора.
|
|
@@ -61,9 +72,9 @@ declare class Meaning_baseConstructorAccess {
|
|
|
61
72
|
type: types.Type, candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[]);
|
|
62
73
|
}
|
|
63
74
|
declare class Meaning_overriddenMethodAccess {
|
|
64
|
-
readonly method:
|
|
75
|
+
readonly method: AccessedFunction;
|
|
65
76
|
readonly kind = "overridden-method-access";
|
|
66
|
-
constructor(method:
|
|
77
|
+
constructor(method: AccessedFunction);
|
|
67
78
|
}
|
|
68
79
|
declare class Meaning_overriddenOperatorAccess {
|
|
69
80
|
readonly operator: types.Operator;
|
|
@@ -73,4 +84,21 @@ declare class Meaning_overriddenOperatorAccess {
|
|
|
73
84
|
declare class Meaning_unresolved {
|
|
74
85
|
readonly kind = "unresolved";
|
|
75
86
|
}
|
|
87
|
+
export declare class FirstStageResolutionsResult {
|
|
88
|
+
readonly meaning: MeaningStage1;
|
|
89
|
+
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
90
|
+
constructor(meaning: MeaningStage1, diagnostics?: readonly Diagnostic[] | undefined);
|
|
91
|
+
static unresolved(diagnostics?: readonly Diagnostic[]): FirstStageResolutionsResult;
|
|
92
|
+
}
|
|
93
|
+
export type MeaningStage1 = Meaning_baseObjectAccess | Meaning_baseConstructorAccess | MeaningStage1_overriddenMethodAccess | MeaningStage1_overriddenOperatorAccess | Meaning_unresolved;
|
|
94
|
+
declare class MeaningStage1_overriddenMethodAccess {
|
|
95
|
+
readonly method: types.Method;
|
|
96
|
+
readonly kind = "overridden-method-access";
|
|
97
|
+
constructor(method: types.Method);
|
|
98
|
+
}
|
|
99
|
+
declare class MeaningStage1_overriddenOperatorAccess {
|
|
100
|
+
readonly operator: types.Operator;
|
|
101
|
+
readonly kind = "overridden-operator-access";
|
|
102
|
+
constructor(operator: types.Operator);
|
|
103
|
+
}
|
|
76
104
|
export {};
|
|
@@ -1,36 +1,55 @@
|
|
|
1
1
|
import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
2
|
-
import {
|
|
2
|
+
import { NamedTypeEntity } from '../entities/index.js';
|
|
3
|
+
import * as tree from '../tree/index.js';
|
|
3
4
|
import * as types from '../types/index.js';
|
|
4
|
-
import { AccessedFunction } from './AccessedFunction.js';
|
|
5
|
-
import { Analyzer } from './index.js';
|
|
5
|
+
import { AccessedFunction, NotSubstitutedAccessedFunction } from './AccessedFunction.js';
|
|
6
|
+
import { Analyzer, ExpressionAnalysisOptions } from './index.js';
|
|
6
7
|
export declare class Resolver {
|
|
7
8
|
private readonly _analyzer;
|
|
8
9
|
private readonly _node;
|
|
9
|
-
|
|
10
|
+
private readonly _analysisOptions;
|
|
11
|
+
constructor(_analyzer: Analyzer, _node: tree.CallExpression, _analysisOptions: ExpressionAnalysisOptions | undefined);
|
|
10
12
|
private get callee();
|
|
11
|
-
resolve():
|
|
12
|
-
|
|
13
|
-
private
|
|
13
|
+
resolve(): ResolutionResult;
|
|
14
|
+
private checkExpressionDenotesType;
|
|
15
|
+
private checkExpressionDenotesFunction;
|
|
16
|
+
private checkExpressionDenotesOperator;
|
|
17
|
+
private resolveFunctionCallExpression;
|
|
18
|
+
private resolveOperatorCallExpression;
|
|
19
|
+
private resolveConstructorCallExpression;
|
|
20
|
+
private resolveObjectFunctionCallExpression;
|
|
14
21
|
private getNodeForDiagnostics;
|
|
15
|
-
|
|
22
|
+
}
|
|
23
|
+
export declare class ResolutionResult {
|
|
24
|
+
readonly meaning: Meaning;
|
|
25
|
+
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
26
|
+
constructor(meaning: Meaning, diagnostics?: readonly Diagnostic[] | undefined);
|
|
27
|
+
static unresolved(diagnostics: readonly Diagnostic[] | undefined): ResolutionResult;
|
|
16
28
|
}
|
|
17
29
|
export type Meaning = Meaning_functionCall | Meaning_operatorCall | Meaning_objectFunctionCall | Meaning_constructorCall | Meaning_unresolved;
|
|
18
|
-
declare class Meaning_functionCall {
|
|
19
|
-
readonly
|
|
30
|
+
export declare class Meaning_functionCall {
|
|
31
|
+
readonly candidates: readonly NotSubstitutedAccessedFunction[];
|
|
32
|
+
readonly suitableFunctions: readonly AccessedFunction[];
|
|
33
|
+
readonly singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined;
|
|
20
34
|
readonly kind = "function-call";
|
|
21
|
-
|
|
35
|
+
get singleSuitableFunction(): AccessedFunction | undefined;
|
|
36
|
+
get singleFunction(): AccessedFunction | undefined;
|
|
37
|
+
constructor(candidates: readonly NotSubstitutedAccessedFunction[], suitableFunctions: readonly AccessedFunction[], singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined);
|
|
22
38
|
}
|
|
23
|
-
declare class Meaning_operatorCall {
|
|
24
|
-
readonly
|
|
39
|
+
export declare class Meaning_operatorCall {
|
|
40
|
+
readonly candidates: readonly types.Operator[];
|
|
41
|
+
readonly suitableOperators: readonly types.Operator[];
|
|
25
42
|
readonly kind = "operator-call";
|
|
26
|
-
|
|
43
|
+
get singleSuitableOperator(): types.Operator | undefined;
|
|
44
|
+
get singleOperator(): types.Operator | undefined;
|
|
45
|
+
constructor(candidates: readonly types.Operator[], suitableOperators: readonly types.Operator[]);
|
|
27
46
|
}
|
|
28
|
-
declare class Meaning_objectFunctionCall {
|
|
47
|
+
export declare class Meaning_objectFunctionCall {
|
|
29
48
|
readonly type: types.FunctionType;
|
|
30
49
|
readonly kind = "object-function-call";
|
|
31
50
|
constructor(type: types.FunctionType);
|
|
32
51
|
}
|
|
33
|
-
declare class Meaning_constructorCall {
|
|
52
|
+
export declare class Meaning_constructorCall {
|
|
34
53
|
/**
|
|
35
54
|
* Тип объекта, получаемого в результате вызова конструктора.
|
|
36
55
|
*
|
|
@@ -38,11 +57,14 @@ declare class Meaning_constructorCall {
|
|
|
38
57
|
* создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
|
|
39
58
|
* с ним совместим.
|
|
40
59
|
*/
|
|
41
|
-
readonly type: types.Type;
|
|
60
|
+
readonly type: types.Type | undefined;
|
|
61
|
+
readonly typeEntity: NamedTypeEntity | undefined;
|
|
42
62
|
readonly candidates: readonly types.Constructor[];
|
|
43
63
|
readonly suitableConstructors: readonly types.Constructor[];
|
|
64
|
+
readonly singleNotSuitableSubstitutedCandidate: types.Constructor | undefined;
|
|
44
65
|
readonly kind = "constructor-call";
|
|
45
66
|
get singleSuitableConstructor(): types.Constructor | undefined;
|
|
67
|
+
get singleConstructor(): types.Constructor | undefined;
|
|
46
68
|
constructor(
|
|
47
69
|
/**
|
|
48
70
|
* Тип объекта, получаемого в результате вызова конструктора.
|
|
@@ -51,11 +73,8 @@ declare class Meaning_constructorCall {
|
|
|
51
73
|
* создаваемый найденным конструктором, будет отличаться от результирующего типа, хранимого в этом поле, но будет
|
|
52
74
|
* с ним совместим.
|
|
53
75
|
*/
|
|
54
|
-
type: types.Type, candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[]);
|
|
76
|
+
type: types.Type | undefined, typeEntity: NamedTypeEntity | undefined, candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[], singleNotSuitableSubstitutedCandidate: types.Constructor | undefined);
|
|
55
77
|
}
|
|
56
|
-
declare class Meaning_unresolved {
|
|
57
|
-
readonly diagnostics: readonly Diagnostic[];
|
|
78
|
+
export declare class Meaning_unresolved {
|
|
58
79
|
readonly kind = "unresolved";
|
|
59
|
-
constructor(diagnostics: readonly Diagnostic[]);
|
|
60
80
|
}
|
|
61
|
-
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { PackageLocale } from '../common/index.js';
|
|
2
|
+
import { DiagnosticAcceptorWithArgumentFactory } from '../diagnostic/Diagnostic.js';
|
|
3
|
+
import { IEntityHidingMatcher, NamedTypeEntity } from '../entities/index.js';
|
|
4
|
+
import * as tree from '../tree/index.js';
|
|
5
|
+
import * as types from '../types/index.js';
|
|
6
|
+
import { Analyzer, ExpressionAnalysisOptions } from './Analyzer.js';
|
|
7
|
+
import { SemanticContext } from './semantic-context/SemanticContext.js';
|
|
8
|
+
export declare class Resolver {
|
|
9
|
+
static resolve(analyzer: Analyzer, candidates: readonly types.Constructor[], argumentList: tree.ArgumentList | undefined, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodeForDiagnostic: tree.Node | undefined): readonly types.Constructor[];
|
|
10
|
+
static resolveByNamedTypes(analyzer: Analyzer, typeEntities: readonly NamedTypeEntity[], argumentList: tree.ArgumentList | undefined, typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions, locale: PackageLocale, hidingMatcher: IEntityHidingMatcher | undefined, typeExtensionLookup: SemanticContext | undefined, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodeForDiagnostic: tree.Node | undefined): ResolutionResult;
|
|
11
|
+
private static typeCanBeConstructed;
|
|
12
|
+
}
|
|
13
|
+
export declare class ResolutionResult {
|
|
14
|
+
readonly candidates: readonly types.Constructor[];
|
|
15
|
+
readonly suitableConstructors: readonly types.Constructor[];
|
|
16
|
+
readonly typeEntity: NamedTypeEntity | undefined;
|
|
17
|
+
readonly type: types.Type | undefined;
|
|
18
|
+
readonly singleNotSuitableSubstitutedCandidate: types.Constructor | undefined;
|
|
19
|
+
private static _empty;
|
|
20
|
+
static get empty(): ResolutionResult;
|
|
21
|
+
constructor(candidates: readonly types.Constructor[], suitableConstructors: readonly types.Constructor[], typeEntity: NamedTypeEntity | undefined, type: types.Type | undefined, singleNotSuitableSubstitutedCandidate: types.Constructor | undefined);
|
|
22
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PackageDialect, PackageLocale } from '../common/index.js';
|
|
2
2
|
import { Entity } from '../entities/index.js';
|
|
3
|
+
import { SourceFile } from '../project/index.js';
|
|
3
4
|
import * as types from '../types/index.js';
|
|
4
5
|
import { AccessedFunction } from './AccessedFunction.js';
|
|
5
6
|
import { Analyzer } from './Analyzer.js';
|
|
@@ -9,7 +10,8 @@ export declare class DiagnosticArgumentFactory {
|
|
|
9
10
|
readonly locale: PackageLocale;
|
|
10
11
|
readonly dialect: PackageDialect;
|
|
11
12
|
private readonly _analyzer;
|
|
12
|
-
|
|
13
|
+
private readonly _contextualSourceFile;
|
|
14
|
+
constructor(analyzer: Analyzer, locale: PackageLocale, dialect: PackageDialect, sourceFile: SourceFile | undefined);
|
|
13
15
|
createDisplayableEntity(entity: Entity): DisplayableEntity;
|
|
14
16
|
createDisplayableAccessedFunction(accessedFunction: AccessedFunction): DisplayableAccessedFunction;
|
|
15
17
|
createDisplayableTypeMember(member: types.TypeMember): DisplayableTypeMember;
|
|
@@ -12,8 +12,10 @@ export declare class DiagnosticCollector {
|
|
|
12
12
|
private readonly _diagnosticAcceptor;
|
|
13
13
|
private _namedDeclarationsUsageMap;
|
|
14
14
|
private readonly _modifierValidator;
|
|
15
|
+
private readonly _standardTypes;
|
|
15
16
|
private get translationPackage();
|
|
16
17
|
private get isInterfacePackageFile();
|
|
18
|
+
private get standardTypes();
|
|
17
19
|
constructor(analyzer: Analyzer, sourceFile: project.SourceFile);
|
|
18
20
|
collect(cancellationToken?: CancellationToken | undefined): Promise<Diagnostic[]>;
|
|
19
21
|
private collectNodeDiagnostics;
|
|
@@ -29,6 +31,7 @@ export declare class DiagnosticCollector {
|
|
|
29
31
|
private isNotTranslatedEntity;
|
|
30
32
|
private createNotTranslatedEntitiesDiagnostic;
|
|
31
33
|
private checkAllDefaultConstructorArgumentsAreNamed;
|
|
34
|
+
private checkPackageVariableDeclaration;
|
|
32
35
|
private checkPackageFunctionDeclaration;
|
|
33
36
|
private checkPackageVariableGetterDeclaration;
|
|
34
37
|
private checkPackageVariableSetterDeclaration;
|
|
@@ -52,8 +55,7 @@ export declare class DiagnosticCollector {
|
|
|
52
55
|
private checkLocalVariableUsedBeforeDeclaration;
|
|
53
56
|
private checkLocalVariableIsUsedBeforeBeingAssigned;
|
|
54
57
|
private checkMemberAccessExpression;
|
|
55
|
-
private
|
|
56
|
-
private checkExpressionTypeAssignableToTargetType;
|
|
58
|
+
private checkExpressionTypeIsAssignableToTargetType;
|
|
57
59
|
private addTypeAssignabilityDiagnosticIfBothTypesResolved;
|
|
58
60
|
private checkAssignmentIsValid;
|
|
59
61
|
private checkAssignmentToIdentifierExpression;
|
|
@@ -66,13 +68,7 @@ export declare class DiagnosticCollector {
|
|
|
66
68
|
private checkAssignmentToIndexedAccessExpression;
|
|
67
69
|
private checkOptionalChainingIsUsedOnTheLeftSideOfAssignment;
|
|
68
70
|
private checkGenericSpecializationExpression;
|
|
69
|
-
private
|
|
70
|
-
private checkTypeSpecialization;
|
|
71
|
-
private checkSpecializationOfDeclarationWithParameters;
|
|
72
|
-
/**
|
|
73
|
-
* @returns `true` если не было ошибки, иначе `false`.
|
|
74
|
-
*/
|
|
75
|
-
private checkTypeArgumentCount;
|
|
71
|
+
private checkTypeArgumentTypesAreAssignableToConstraints;
|
|
76
72
|
private checkParameterDeclaration;
|
|
77
73
|
private checkIfVariableIsUnused;
|
|
78
74
|
private checkIfNestedFunctionIsUnused;
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { Displayable, PackageDialect, PackageLocale } from '../common/index.js';
|
|
2
2
|
import { Entity } from '../entities/index.js';
|
|
3
|
+
import { SourceFile } from '../project/index.js';
|
|
4
|
+
import * as types from '../types/index.js';
|
|
3
5
|
import { AccessedFunction } from './AccessedFunction.js';
|
|
4
6
|
import { Analyzer } from './Analyzer.js';
|
|
5
|
-
import * as types from '../types/index.js';
|
|
6
7
|
import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
|
7
8
|
export declare class DisplayableEntity implements Displayable {
|
|
8
9
|
private readonly _analyzer;
|
|
9
10
|
private readonly _entity;
|
|
10
11
|
private readonly _locale;
|
|
11
12
|
private readonly _dialect;
|
|
12
|
-
|
|
13
|
+
private readonly _contextualSourceFile;
|
|
14
|
+
constructor(_analyzer: Analyzer, _entity: Entity, _locale: PackageLocale, _dialect: PackageDialect, _contextualSourceFile: SourceFile | undefined);
|
|
13
15
|
getDisplayText(): string;
|
|
14
16
|
}
|
|
15
17
|
export declare class DisplayableAccessedFunction implements Displayable {
|
|
@@ -17,7 +19,8 @@ export declare class DisplayableAccessedFunction implements Displayable {
|
|
|
17
19
|
private readonly _accessedFunction;
|
|
18
20
|
private readonly _locale;
|
|
19
21
|
private readonly _dialect;
|
|
20
|
-
|
|
22
|
+
private readonly _contextualSourceFile;
|
|
23
|
+
constructor(_analyzer: Analyzer, _accessedFunction: AccessedFunction, _locale: PackageLocale, _dialect: PackageDialect, _contextualSourceFile: SourceFile | undefined);
|
|
21
24
|
getDisplayText(): string;
|
|
22
25
|
}
|
|
23
26
|
export declare class DisplayableTypeMember implements Displayable {
|
|
@@ -25,7 +28,8 @@ export declare class DisplayableTypeMember implements Displayable {
|
|
|
25
28
|
private readonly _member;
|
|
26
29
|
private readonly _locale;
|
|
27
30
|
private readonly _dialect;
|
|
28
|
-
|
|
31
|
+
private readonly _contextualSourceFile;
|
|
32
|
+
constructor(_analyzer: Analyzer, _member: types.TypeMember, _locale: PackageLocale, _dialect: PackageDialect, _contextualSourceFile: SourceFile | undefined);
|
|
29
33
|
getDisplayText(): string;
|
|
30
34
|
}
|
|
31
35
|
export declare class DisplayablePackageNameTreeNode implements Displayable {
|
|
@@ -33,7 +37,8 @@ export declare class DisplayablePackageNameTreeNode implements Displayable {
|
|
|
33
37
|
private readonly _node;
|
|
34
38
|
private readonly _locale;
|
|
35
39
|
private readonly _dialect;
|
|
36
|
-
|
|
40
|
+
private readonly _contextualSourceFile;
|
|
41
|
+
constructor(_analyzer: Analyzer, _node: PackageNameTreeNode, _locale: PackageLocale, _dialect: PackageDialect, _contextualSourceFile: SourceFile | undefined);
|
|
37
42
|
getDisplayText(): string;
|
|
38
43
|
}
|
|
39
44
|
export declare class DisplayableType implements Displayable {
|
|
@@ -41,6 +46,7 @@ export declare class DisplayableType implements Displayable {
|
|
|
41
46
|
private readonly _type;
|
|
42
47
|
private readonly _locale;
|
|
43
48
|
private readonly _dialect;
|
|
44
|
-
|
|
49
|
+
private readonly _contextualSourceFile;
|
|
50
|
+
constructor(_analyzer: Analyzer, _type: types.Type, _locale: PackageLocale, _dialect: PackageDialect, _contextualSourceFile: SourceFile | undefined);
|
|
45
51
|
getDisplayText(): string;
|
|
46
52
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DiagnosticAcceptorWithArgumentFactory } from '../diagnostic/Diagnostic.js';
|
|
2
|
+
import * as tree from '../tree/index.js';
|
|
3
|
+
import { AccessedFunction, NotSubstitutedAccessedFunction } from './AccessedFunction.js';
|
|
4
|
+
import { Analyzer, ExpressionAnalysisOptions } from './Analyzer.js';
|
|
5
|
+
export declare class Resolver {
|
|
6
|
+
static resolveByCallExpression(analyzer: Analyzer, candidates: readonly NotSubstitutedAccessedFunction[], node: tree.CallExpression, analysisOptions: ExpressionAnalysisOptions, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined): ResolutionResult;
|
|
7
|
+
static resolveByCallExpressionParts(analyzer: Analyzer, candidates: readonly NotSubstitutedAccessedFunction[], argumentList: tree.ArgumentList | undefined, typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodeForDiagnostic: tree.Node | undefined): ResolutionResult;
|
|
8
|
+
static resolveByTargetType(analyzer: Analyzer, candidates: readonly NotSubstitutedAccessedFunction[], typeArgumentClause: tree.TypeArgumentClause | undefined, analysisOptions: ExpressionAnalysisOptions, diagnostics: DiagnosticAcceptorWithArgumentFactory | undefined, nodeForDiagnostic: tree.Node | undefined): ResolutionResult;
|
|
9
|
+
private static convertProcessedSignature;
|
|
10
|
+
private static reportAmbiguousAccessDiagnostic;
|
|
11
|
+
}
|
|
12
|
+
export interface ResolutionResult {
|
|
13
|
+
suitableFunctions: readonly AccessedFunction[];
|
|
14
|
+
singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined;
|
|
15
|
+
}
|
|
@@ -3,37 +3,41 @@ import { Diagnostic } from '../diagnostic/Diagnostic.js';
|
|
|
3
3
|
import { NamedTypeEntity, PackageAliasEntity, VariableEntity } from '../entities/index.js';
|
|
4
4
|
import * as tree from '../tree/index.js';
|
|
5
5
|
import * as types from '../types/index.js';
|
|
6
|
-
import { AccessedFunction } from './AccessedFunction.js';
|
|
6
|
+
import { AccessedFunction, NotSubstitutedAccessedFunction } from './AccessedFunction.js';
|
|
7
|
+
import * as callExpressionMeaning from './CallExpressionMeaning.js';
|
|
7
8
|
import { PackageNameTreeNode } from './ImportedPackageNameTree.js';
|
|
8
|
-
import { Analyzer,
|
|
9
|
+
import { Analyzer, ExpressionAnalysisOptions } from './index.js';
|
|
9
10
|
import { NamedDeclaration } from './semantic-context/index.js';
|
|
10
|
-
export declare class
|
|
11
|
+
export declare class FirstStageResolver {
|
|
11
12
|
private readonly _semanticContext;
|
|
12
13
|
private readonly _analyzer;
|
|
13
14
|
private readonly _node;
|
|
14
|
-
private readonly _targetTypeHint;
|
|
15
15
|
private get semanticContext();
|
|
16
|
-
constructor(analyzer: Analyzer, node: tree.IdentifierExpression
|
|
17
|
-
resolve():
|
|
16
|
+
constructor(analyzer: Analyzer, node: tree.IdentifierExpression);
|
|
17
|
+
resolve(): FirstStageResolutionResult;
|
|
18
18
|
private tryResolveOperatorAccessMeaning;
|
|
19
|
-
private
|
|
20
|
-
private
|
|
19
|
+
private resolveTypeAccess;
|
|
20
|
+
private createNotSubstitutedAccessedFunction;
|
|
21
21
|
private convertSyntacticAccessKind;
|
|
22
22
|
}
|
|
23
|
+
export declare class SecondStageResolver {
|
|
24
|
+
private readonly _analyzer;
|
|
25
|
+
private readonly _node;
|
|
26
|
+
private readonly _firstStageResolutionResult;
|
|
27
|
+
private readonly _analysisOptions;
|
|
28
|
+
constructor(analyzer: Analyzer, node: tree.IdentifierExpression, firstStageResolutionResult: FirstStageResolutionResult, analysisOptions: ExpressionAnalysisOptions | undefined);
|
|
29
|
+
resolve(): ResolutionResult;
|
|
30
|
+
private resolveTypeAccessAtCalleePosition;
|
|
31
|
+
private resolveFunctionAccess;
|
|
32
|
+
private resolveOperatorAccess;
|
|
33
|
+
private resolveNotCalledFunctionsAccess;
|
|
34
|
+
}
|
|
23
35
|
export declare class ResolutionResult {
|
|
24
36
|
readonly meaning: Meaning;
|
|
25
|
-
readonly
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
readonly dependsOnTargetType: boolean;
|
|
30
|
-
constructor(meaning: Meaning, diagnostic?: Diagnostic | undefined,
|
|
31
|
-
/**
|
|
32
|
-
* Может ли измениться результат, если посчитать его с другим целевым типом?
|
|
33
|
-
*/
|
|
34
|
-
dependsOnTargetType?: boolean);
|
|
35
|
-
}
|
|
36
|
-
export type Meaning = Meaning_variableAccess | Meaning_functionAccess | Meaning_operatorAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | Meaning_typeAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
37
|
+
readonly diagnostics: readonly Diagnostic[] | undefined;
|
|
38
|
+
constructor(meaning: Meaning, diagnostics?: Diagnostic | readonly Diagnostic[]);
|
|
39
|
+
}
|
|
40
|
+
export type Meaning = Meaning_variableAccess | Meaning_functionAccess | Meaning_operatorAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | Meaning_typeAccess | Meaning_constructorAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
37
41
|
declare class Meaning_variableAccess {
|
|
38
42
|
readonly variable: AccessedVariable;
|
|
39
43
|
readonly accessKind: AccessKind;
|
|
@@ -41,17 +45,20 @@ declare class Meaning_variableAccess {
|
|
|
41
45
|
constructor(variable: AccessedVariable, accessKind: AccessKind);
|
|
42
46
|
}
|
|
43
47
|
declare class Meaning_functionAccess {
|
|
44
|
-
readonly candidates: readonly
|
|
48
|
+
readonly candidates: readonly NotSubstitutedAccessedFunction[];
|
|
45
49
|
readonly suitableFunctions: readonly AccessedFunction[];
|
|
50
|
+
readonly singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined;
|
|
46
51
|
readonly kind = "function-access";
|
|
47
52
|
get singleSuitableFunction(): AccessedFunction | undefined;
|
|
48
|
-
|
|
53
|
+
get singleFunction(): AccessedFunction | undefined;
|
|
54
|
+
constructor(candidates: readonly NotSubstitutedAccessedFunction[], suitableFunctions: readonly AccessedFunction[], singleNotSuitableSubstitutedCandidate: AccessedFunction | undefined);
|
|
49
55
|
}
|
|
50
56
|
declare class Meaning_operatorAccess {
|
|
51
57
|
readonly candidates: readonly types.Operator[];
|
|
52
58
|
readonly suitableOperators: readonly types.Operator[];
|
|
53
59
|
readonly kind = "operator-access";
|
|
54
60
|
get singleSuitableOperator(): types.Operator | undefined;
|
|
61
|
+
get singleOperator(): types.Operator | undefined;
|
|
55
62
|
constructor(candidates: readonly types.Operator[], suitableOperators: readonly types.Operator[]);
|
|
56
63
|
}
|
|
57
64
|
declare class Meaning_packageAliasAccess {
|
|
@@ -71,6 +78,12 @@ declare class Meaning_typeAccess {
|
|
|
71
78
|
get singleSuitableType(): types.Type | undefined;
|
|
72
79
|
constructor(candidates: readonly NamedTypeEntity[], suitableTypes: readonly types.Type[]);
|
|
73
80
|
}
|
|
81
|
+
declare class Meaning_constructorAccess {
|
|
82
|
+
readonly typeCandidates: readonly NamedTypeEntity[];
|
|
83
|
+
readonly callExpressionMeaning: callExpressionMeaning.Meaning_constructorCall;
|
|
84
|
+
readonly kind = "constructor-access";
|
|
85
|
+
constructor(typeCandidates: readonly NamedTypeEntity[], callExpressionMeaning: callExpressionMeaning.Meaning_constructorCall);
|
|
86
|
+
}
|
|
74
87
|
declare class Meaning_mixedAmbiguousAccess {
|
|
75
88
|
readonly declarations: readonly NamedDeclaration[];
|
|
76
89
|
readonly kind = "mixed-ambiguous-access";
|
|
@@ -79,6 +92,27 @@ declare class Meaning_mixedAmbiguousAccess {
|
|
|
79
92
|
declare class Meaning_unresolved {
|
|
80
93
|
readonly kind = "unresolved";
|
|
81
94
|
}
|
|
95
|
+
export declare class FirstStageResolutionResult {
|
|
96
|
+
readonly meaning: MeaningStage1;
|
|
97
|
+
readonly diagnostics: readonly Diagnostic[] | undefined;
|
|
98
|
+
constructor(meaning: MeaningStage1, diagnostics?: Diagnostic | readonly Diagnostic[]);
|
|
99
|
+
}
|
|
100
|
+
export type MeaningStage1 = Meaning_variableAccess | MeaningStage1_functionAccess | MeaningStage1_operatorAccess | Meaning_packageNameSegmentAccess | Meaning_packageAliasAccess | MeaningStage1_typeAccessAtCalleePosition | Meaning_typeAccess | Meaning_mixedAmbiguousAccess | Meaning_unresolved;
|
|
101
|
+
declare class MeaningStage1_typeAccessAtCalleePosition {
|
|
102
|
+
readonly types: readonly NamedTypeEntity[];
|
|
103
|
+
readonly kind = "type-access-at-callee-position";
|
|
104
|
+
constructor(types: readonly NamedTypeEntity[]);
|
|
105
|
+
}
|
|
106
|
+
declare class MeaningStage1_functionAccess {
|
|
107
|
+
readonly functions: readonly NotSubstitutedAccessedFunction[];
|
|
108
|
+
readonly kind = "function-access";
|
|
109
|
+
constructor(functions: readonly NotSubstitutedAccessedFunction[]);
|
|
110
|
+
}
|
|
111
|
+
declare class MeaningStage1_operatorAccess {
|
|
112
|
+
readonly operators: readonly types.Operator[];
|
|
113
|
+
readonly kind = "operator-access";
|
|
114
|
+
constructor(operators: readonly types.Operator[]);
|
|
115
|
+
}
|
|
82
116
|
export type AccessedVariable = AccessedVariable_entity | AccessedVariable_typeMember;
|
|
83
117
|
export declare class AccessedVariable_entity implements IAccessedVariable {
|
|
84
118
|
readonly value: VariableEntity;
|
|
@@ -15,8 +15,8 @@ export declare class Resolver {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class ResolutionResult {
|
|
17
17
|
readonly meaning: Meaning;
|
|
18
|
-
readonly
|
|
19
|
-
constructor(meaning: Meaning,
|
|
18
|
+
readonly diagnostics?: readonly Diagnostic[] | undefined;
|
|
19
|
+
constructor(meaning: Meaning, diagnostics?: readonly Diagnostic[] | undefined);
|
|
20
20
|
}
|
|
21
21
|
export type Meaning = Meaning_resolved | Meaning_unresolved;
|
|
22
22
|
declare class Meaning_resolved {
|
|
@@ -25,6 +25,7 @@ declare class Meaning_resolved {
|
|
|
25
25
|
readonly accessKind: AccessKind;
|
|
26
26
|
readonly kind = "resolved";
|
|
27
27
|
get singleSuitableIndexer(): types.Indexer | undefined;
|
|
28
|
+
get singleIndexer(): types.Indexer | undefined;
|
|
28
29
|
constructor(candidates: readonly types.Indexer[], suitableIndexers: readonly types.Indexer[], accessKind: AccessKind);
|
|
29
30
|
}
|
|
30
31
|
declare class Meaning_unresolved {
|