@artel/artc 0.9.26067-pre-release → 0.9.26070-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 +13 -9
- package/build/api/ApiNodeJS.js +3 -3
- package/build/api/ApiServices.js +7 -114
- package/build/{chunk-CCGMGHVX.js → chunk-IALHCBEP.js} +2 -2
- package/build/{chunk-HDKCVHQW.js → chunk-KFK63PJX.js} +2049 -20076
- package/build/chunk-YMECMIXH.js +18510 -0
- package/build/types/emitter/Emitter.d.ts +16 -3
- package/build/types/emitter/IrBuilderA.d.ts +5 -4
- package/build/types/emitter/IrBuilderM.d.ts +5 -5
- package/build/types/parser/a/Scanner.d.ts +2 -1
- package/build/types/parser/m/Scanner.d.ts +1 -1
- package/build/types/project/Compilation.d.ts +6 -4
- package/build/types/project/CompilationLoader.d.ts +2 -2
- package/build/types/project/PackageContent.d.ts +6 -0
- package/build/types/project/SourcePackage.d.ts +20 -13
- package/build/types/services/CustomRequests.d.ts +0 -19
- package/build/types/services/LanguageServer.d.ts +2 -4
- package/build/types/services/workspace/CompilationController.d.ts +2 -2
- package/build/types/services/workspace/Workspace.d.ts +2 -2
- package/package.json +2 -2
- package/build/chunk-T4HMJ63L.js +0 -252
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-IALHCBEP.js";
|
|
5
|
+
import "./chunk-YMECMIXH.js";
|
|
6
6
|
import {
|
|
7
7
|
__async
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-KFK63PJX.js";
|
|
9
9
|
|
|
10
10
|
// source/Cli.ts
|
|
11
11
|
function main() {
|
package/build/api/Api.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler,
|
|
3
|
-
DiagnosticFormatter
|
|
4
|
-
|
|
3
|
+
DiagnosticFormatter,
|
|
4
|
+
EmitToMemoryPackage,
|
|
5
|
+
EmitToMemoryResult,
|
|
6
|
+
Emitter,
|
|
7
|
+
EmitterPackage,
|
|
8
|
+
ImportEmitKind,
|
|
9
|
+
NotEmittedPackageInfo,
|
|
10
|
+
SourceMapMode
|
|
11
|
+
} from "../chunk-YMECMIXH.js";
|
|
5
12
|
import {
|
|
6
13
|
AccessKind,
|
|
7
14
|
AccessedFunction_entity,
|
|
@@ -80,10 +87,6 @@ import {
|
|
|
80
87
|
DirectoryEntry,
|
|
81
88
|
DisplayableArray,
|
|
82
89
|
DisplayableOrPrimitive,
|
|
83
|
-
EmitToMemoryPackage,
|
|
84
|
-
EmitToMemoryResult,
|
|
85
|
-
Emitter,
|
|
86
|
-
EmitterPackage,
|
|
87
90
|
EndKeywordPart,
|
|
88
91
|
EntityHidingLevel_file,
|
|
89
92
|
EntityHidingLevel_package,
|
|
@@ -102,7 +105,6 @@ import {
|
|
|
102
105
|
GenericCancellationToken,
|
|
103
106
|
HelperPhraseKind,
|
|
104
107
|
ImplicitFunctionBlockParameterSpecialVariableEntityInfo,
|
|
105
|
-
ImportEmitKind,
|
|
106
108
|
ImportedPackageNameTree,
|
|
107
109
|
InMemoryPackageScheme,
|
|
108
110
|
InterfacePackageEntityInfo,
|
|
@@ -168,6 +170,7 @@ import {
|
|
|
168
170
|
PackageMemberLookup,
|
|
169
171
|
PackageMemberLookupContext,
|
|
170
172
|
PackageName,
|
|
173
|
+
PackageRole,
|
|
171
174
|
Parser,
|
|
172
175
|
PerformanceMeasurement,
|
|
173
176
|
PerformanceMeasurementStage,
|
|
@@ -195,7 +198,6 @@ import {
|
|
|
195
198
|
SourceFileA,
|
|
196
199
|
SourceFileAnalyzer,
|
|
197
200
|
SourceFileM,
|
|
198
|
-
SourceMapMode,
|
|
199
201
|
SourcePackageDependencyGraph,
|
|
200
202
|
SourceTranslationDefinition,
|
|
201
203
|
StructuredTypeKind,
|
|
@@ -326,7 +328,7 @@ import {
|
|
|
326
328
|
withoutQuotes,
|
|
327
329
|
withoutTemplateQuotes,
|
|
328
330
|
yieldTask
|
|
329
|
-
} from "../chunk-
|
|
331
|
+
} from "../chunk-KFK63PJX.js";
|
|
330
332
|
export {
|
|
331
333
|
AccessKind,
|
|
332
334
|
AccessedFunction_entity,
|
|
@@ -472,6 +474,7 @@ export {
|
|
|
472
474
|
NameTranslationPackageConfiguration,
|
|
473
475
|
NameTranslationPackageM,
|
|
474
476
|
NodeModulesDirectoryName,
|
|
477
|
+
NotEmittedPackageInfo,
|
|
475
478
|
OperatorKind,
|
|
476
479
|
Option,
|
|
477
480
|
OriginalAliasedType,
|
|
@@ -491,6 +494,7 @@ export {
|
|
|
491
494
|
PackageMemberLookup,
|
|
492
495
|
PackageMemberLookupContext,
|
|
493
496
|
PackageName,
|
|
497
|
+
PackageRole,
|
|
494
498
|
Parser,
|
|
495
499
|
PerformanceMeasurement,
|
|
496
500
|
PerformanceMeasurementStage,
|
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-IALHCBEP.js";
|
|
10
|
+
import "../chunk-YMECMIXH.js";
|
|
11
|
+
import "../chunk-KFK63PJX.js";
|
|
12
12
|
export {
|
|
13
13
|
CommandLineCompiler,
|
|
14
14
|
FileSystemUri,
|
package/build/api/ApiServices.js
CHANGED
|
@@ -17,7 +17,6 @@ import {
|
|
|
17
17
|
DereferenceOperatorDeclaration_typeMember,
|
|
18
18
|
DisplayService,
|
|
19
19
|
EmitPhaseName,
|
|
20
|
-
Emitter,
|
|
21
20
|
ExpressionAnalysisOptions,
|
|
22
21
|
ExpressionAnalysisOptions2,
|
|
23
22
|
Field,
|
|
@@ -60,7 +59,6 @@ import {
|
|
|
60
59
|
Range,
|
|
61
60
|
ResolvedNameTranslationPackage,
|
|
62
61
|
ResolvedNameTranslationPackage2,
|
|
63
|
-
SourcePackageDependencyGraph,
|
|
64
62
|
Substitutions,
|
|
65
63
|
SyntaxFactory,
|
|
66
64
|
SyntaxFactory2,
|
|
@@ -142,15 +140,14 @@ import {
|
|
|
142
140
|
modifierKindsInSortOrder,
|
|
143
141
|
operatorKinds,
|
|
144
142
|
operatorKinds2,
|
|
145
|
-
|
|
146
|
-
performanceMeasurementStages,
|
|
143
|
+
packageContentsWithRole,
|
|
147
144
|
setUserLocale,
|
|
148
145
|
sortModifiers,
|
|
149
146
|
tokenKindByOperatorKind,
|
|
150
147
|
traverseTreeAsync,
|
|
151
148
|
traverseTreeAsync2,
|
|
152
149
|
yieldTask
|
|
153
|
-
} from "../chunk-
|
|
150
|
+
} from "../chunk-KFK63PJX.js";
|
|
154
151
|
|
|
155
152
|
// source/services/common/Types.ts
|
|
156
153
|
import * as ls from "vscode-languageserver";
|
|
@@ -196,7 +193,6 @@ var customRequests = {
|
|
|
196
193
|
translateSourceFile: new CustomRequestType("artel/translateSourceFile"),
|
|
197
194
|
provideEvaluatableExpression: new CustomRequestType("artel/provideEvaluatableExpression"),
|
|
198
195
|
provideServerOwnedDocumentContent: new CustomRequestType("artel/provideServerOwnedDocumentContent"),
|
|
199
|
-
emitCodeToString: new CustomRequestType("artel/emitCodeToString"),
|
|
200
196
|
displayFileSystemTree: new CustomRequestType("artel/displayFileSystemTree"),
|
|
201
197
|
createOrUpdateSourceFile: new CustomRequestType("artel/fs.createOrUpdateSourceFile"),
|
|
202
198
|
deleteSourceFile: new CustomRequestType("artel/fs.deleteSourceFile"),
|
|
@@ -11921,7 +11917,8 @@ var CompilationController = class extends RxObject2 {
|
|
|
11921
11917
|
}
|
|
11922
11918
|
const taskController = new TaskController(50, new GenericCancellationToken(() => currentTransaction.isCanceled));
|
|
11923
11919
|
try {
|
|
11924
|
-
|
|
11920
|
+
const userPackages = compilationState.analyzer.compilation.getUserPackages();
|
|
11921
|
+
for (const package_ of userPackages) {
|
|
11925
11922
|
for (const sourceFile of package_.sourceFiles) {
|
|
11926
11923
|
if (this.isLastReportedSourceFileDiagnosticsUpToDate(sourceFile.uri, compilationState.version)) {
|
|
11927
11924
|
continue;
|
|
@@ -13399,7 +13396,7 @@ var _Workspace = class _Workspace extends RxObject6 {
|
|
|
13399
13396
|
const pkg = state.analyzer.compilation.getPackageByUri(uri);
|
|
13400
13397
|
if (onlyUserPackages) {
|
|
13401
13398
|
const checkedPackage = sourceFile?.package ?? pkg;
|
|
13402
|
-
if (checkedPackage !== void 0 &&
|
|
13399
|
+
if (checkedPackage !== void 0 && checkedPackage.role !== 0 /* User */) {
|
|
13403
13400
|
continue;
|
|
13404
13401
|
}
|
|
13405
13402
|
}
|
|
@@ -13786,7 +13783,7 @@ var SourceGenerationService = class extends RxObject7 {
|
|
|
13786
13783
|
trackedSourceFiles: this.trackedSourceFiles,
|
|
13787
13784
|
mainPackageConfigurationIfMissing: packageConfiguration,
|
|
13788
13785
|
getTreatRootAsPackageIfConfigIsMissing: () => true,
|
|
13789
|
-
additionalPackageContents: standardPackageContents
|
|
13786
|
+
additionalPackageContents: packageContentsWithRole(standardPackageContents, 2 /* StandardLibrary */)
|
|
13790
13787
|
};
|
|
13791
13788
|
const controller = new CompilationController(controllerConfig);
|
|
13792
13789
|
controller.isConfigurationsProcessingEnabled = true;
|
|
@@ -14408,7 +14405,7 @@ var WorkspaceItemsService = class {
|
|
|
14408
14405
|
const result = new Array();
|
|
14409
14406
|
const packageUris = /* @__PURE__ */ new Set();
|
|
14410
14407
|
for (const compilation of compilations) {
|
|
14411
|
-
for (const pkg of compilation.
|
|
14408
|
+
for (const pkg of compilation.packages) {
|
|
14412
14409
|
if (packageUris.has(pkg.uri.toString())) {
|
|
14413
14410
|
continue;
|
|
14414
14411
|
}
|
|
@@ -20076,8 +20073,6 @@ var _LanguageServer = class _LanguageServer {
|
|
|
20076
20073
|
(taskController) => this.onProvideServerOwnedDocumentContent(params, taskController)
|
|
20077
20074
|
));
|
|
20078
20075
|
this.disposables.push(disposable);
|
|
20079
|
-
disposable = this.connection.onRequest(customRequests.emitCodeToString, (params, token) => this.withTaskController(token, (taskController) => this.onEmitCodeToString(params, taskController)));
|
|
20080
|
-
this.disposables.push(disposable);
|
|
20081
20076
|
disposable = this.connection.onRequest(
|
|
20082
20077
|
customRequests.displayFileSystemTree,
|
|
20083
20078
|
(params) => this.onDisplayFileSystemTree(params)
|
|
@@ -20815,108 +20810,6 @@ var _LanguageServer = class _LanguageServer {
|
|
|
20815
20810
|
return getMemoryUsage();
|
|
20816
20811
|
});
|
|
20817
20812
|
}
|
|
20818
|
-
onEmitCodeToString(params, taskController) {
|
|
20819
|
-
return __async(this, null, function* () {
|
|
20820
|
-
let compilationControllerUri;
|
|
20821
|
-
if (params.workspaceFolderUri !== void 0) {
|
|
20822
|
-
compilationControllerUri = this.convertVscodeUriToUri(URI.parse(params.workspaceFolderUri));
|
|
20823
|
-
} else {
|
|
20824
|
-
if (this.workspace.workspaceFolderUris.length !== 1) {
|
|
20825
|
-
throw new ls3.ResponseError(
|
|
20826
|
-
ls3.ErrorCodes.InvalidParams,
|
|
20827
|
-
"\u041D\u0435 \u0443\u043A\u0430\u0437\u0430\u043D uri \u043F\u0440\u043E\u0435\u043A\u0442\u0430, \u043A\u043E\u0442\u043E\u0440\u044B\u0439 \u043D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u043E \u0441\u043A\u043E\u043C\u043F\u0438\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C."
|
|
20828
|
-
);
|
|
20829
|
-
}
|
|
20830
|
-
compilationControllerUri = this.workspace.workspaceFolderUris[0];
|
|
20831
|
-
}
|
|
20832
|
-
const workspaceElementInfo = yield this.workspace.waitLoadedAndGetWorkspaceElementInfo(
|
|
20833
|
-
compilationControllerUri,
|
|
20834
|
-
taskController
|
|
20835
|
-
);
|
|
20836
|
-
const compilationController = workspaceElementInfo?.compilationController;
|
|
20837
|
-
if (compilationController === void 0) {
|
|
20838
|
-
throw new ls3.ResponseError(
|
|
20839
|
-
ls3.ErrorCodes.InvalidParams,
|
|
20840
|
-
`\u041F\u0440\u043E\u0435\u043A\u0442 \u0441 uri ${compilationControllerUri} \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.`
|
|
20841
|
-
);
|
|
20842
|
-
}
|
|
20843
|
-
if (compilationController.mainCompilationState === void 0) {
|
|
20844
|
-
return { hasErrors: true, filesWithErrors: [] };
|
|
20845
|
-
}
|
|
20846
|
-
let performance2;
|
|
20847
|
-
const compilationState = compilationController.mainCompilationState;
|
|
20848
|
-
if (params.measurePerformance === true) {
|
|
20849
|
-
performance2 = compilationState.analyzer.compilation.performance;
|
|
20850
|
-
performance2?.reset();
|
|
20851
|
-
performance2?.enable();
|
|
20852
|
-
performance2?.markCompilationStart();
|
|
20853
|
-
}
|
|
20854
|
-
const filesWithErrors = new Array();
|
|
20855
|
-
const trackedSourceFiles = this.workspace.trackedSourceFiles.createItemsSnapshot();
|
|
20856
|
-
const packageGraph = new SourcePackageDependencyGraph(compilationState.analyzer);
|
|
20857
|
-
let hasErrors = false;
|
|
20858
|
-
for (const pkg of packageGraph.packagesForTargetPlatform(0 /* JavaScript */)) {
|
|
20859
|
-
if (pkg.kind === "translation") {
|
|
20860
|
-
continue;
|
|
20861
|
-
}
|
|
20862
|
-
for (const sourceFile of pkg.sourceFiles) {
|
|
20863
|
-
const summary = yield compilationState.getDiagnosticsCollectionSummary(sourceFile, taskController);
|
|
20864
|
-
hasErrors ||= summary.hasErrors;
|
|
20865
|
-
if (summary.hasErrors) {
|
|
20866
|
-
const uri = this.convertUriToVscodeUri(sourceFile.uri).toString();
|
|
20867
|
-
const version = trackedSourceFiles.get(sourceFile.uri.toString())?.version;
|
|
20868
|
-
filesWithErrors.push({ uri, version });
|
|
20869
|
-
}
|
|
20870
|
-
}
|
|
20871
|
-
}
|
|
20872
|
-
if (hasErrors) {
|
|
20873
|
-
performance2?.disable();
|
|
20874
|
-
return { hasErrors, filesWithErrors };
|
|
20875
|
-
}
|
|
20876
|
-
const options7 = {
|
|
20877
|
-
importEmitKind: 2 /* Custom */,
|
|
20878
|
-
isCustomImportSynchronous: true,
|
|
20879
|
-
embedSyntaxNodePaths: true
|
|
20880
|
-
};
|
|
20881
|
-
let result;
|
|
20882
|
-
try {
|
|
20883
|
-
const emitter = new Emitter(compilationController.mainCompilationState.analyzer, options7);
|
|
20884
|
-
const code = yield emitter.emitToString(taskController);
|
|
20885
|
-
result = { hasErrors: false, code };
|
|
20886
|
-
} catch (e) {
|
|
20887
|
-
Logger.error(`\u0412\u043E \u0432\u0440\u0435\u043C\u044F \u0433\u0435\u043D\u0435\u0440\u0430\u0446\u0438\u0438 \u043A\u043E\u0434\u0430 \u043F\u0440\u043E\u0435\u043A\u0442\u0430 ${compilationController.uri} \u0432\u043E\u0437\u043D\u0438\u043A\u043B\u0430 \u043E\u0448\u0438\u0431\u043A\u0430
|
|
20888
|
-
${e}`);
|
|
20889
|
-
result = { hasErrors: true, filesWithErrors: [] };
|
|
20890
|
-
}
|
|
20891
|
-
if (params.measurePerformance === true) {
|
|
20892
|
-
performance2?.markCompilationEnd();
|
|
20893
|
-
performance2?.disable();
|
|
20894
|
-
if (performance2 !== void 0) {
|
|
20895
|
-
const message = this.getPerformanceMeasurementResultMessage(performance2);
|
|
20896
|
-
Logger.info("\n" + message);
|
|
20897
|
-
}
|
|
20898
|
-
}
|
|
20899
|
-
return result;
|
|
20900
|
-
});
|
|
20901
|
-
}
|
|
20902
|
-
getPerformanceMeasurementResultMessage(performance2) {
|
|
20903
|
-
let result = "";
|
|
20904
|
-
for (const stage of performanceMeasurementStages) {
|
|
20905
|
-
if (result !== "") {
|
|
20906
|
-
result += "\n";
|
|
20907
|
-
}
|
|
20908
|
-
const duration = performance2.getDurationMs(stage);
|
|
20909
|
-
result += `${performanceMeasurementStageNames[stage]}: ${duration.toFixed(2)}ms`;
|
|
20910
|
-
}
|
|
20911
|
-
const total = performance2.getTotalCompilationTimeMs();
|
|
20912
|
-
if (total !== -1) {
|
|
20913
|
-
if (result !== "") {
|
|
20914
|
-
result += "\n";
|
|
20915
|
-
}
|
|
20916
|
-
result += `Total: ${total.toFixed(2)}ms`;
|
|
20917
|
-
}
|
|
20918
|
-
return result;
|
|
20919
|
-
}
|
|
20920
20813
|
onProvideServerOwnedDocumentContent(params, taskController) {
|
|
20921
20814
|
return __async(this, null, function* () {
|
|
20922
20815
|
const vscodeUri = URI.parse(params.uri);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Compiler,
|
|
3
3
|
DiagnosticFormatter
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-YMECMIXH.js";
|
|
5
5
|
import {
|
|
6
6
|
ArtelVersion,
|
|
7
7
|
Cached,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
__async,
|
|
17
17
|
performanceMeasurementStageNames,
|
|
18
18
|
performanceMeasurementStages
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-KFK63PJX.js";
|
|
20
20
|
|
|
21
21
|
// source/executor/FileSystemUri.ts
|
|
22
22
|
import { platform } from "os";
|