@artel/artc 0.9.26067-pre-release → 0.9.26069-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 CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CommandLineCompiler
4
- } from "./chunk-CCGMGHVX.js";
5
- import "./chunk-T4HMJ63L.js";
4
+ } from "./chunk-2MYUOUPT.js";
5
+ import "./chunk-UOE6Z7CK.js";
6
6
  import {
7
7
  __async
8
- } from "./chunk-HDKCVHQW.js";
8
+ } from "./chunk-OTDTWBJA.js";
9
9
 
10
10
  // source/Cli.ts
11
11
  function main() {
package/build/api/Api.js CHANGED
@@ -1,7 +1,13 @@
1
1
  import {
2
2
  Compiler,
3
- DiagnosticFormatter
4
- } from "../chunk-T4HMJ63L.js";
3
+ DiagnosticFormatter,
4
+ EmitToMemoryPackage,
5
+ EmitToMemoryResult,
6
+ Emitter,
7
+ EmitterPackage,
8
+ ImportEmitKind,
9
+ SourceMapMode
10
+ } from "../chunk-UOE6Z7CK.js";
5
11
  import {
6
12
  AccessKind,
7
13
  AccessedFunction_entity,
@@ -80,10 +86,6 @@ import {
80
86
  DirectoryEntry,
81
87
  DisplayableArray,
82
88
  DisplayableOrPrimitive,
83
- EmitToMemoryPackage,
84
- EmitToMemoryResult,
85
- Emitter,
86
- EmitterPackage,
87
89
  EndKeywordPart,
88
90
  EntityHidingLevel_file,
89
91
  EntityHidingLevel_package,
@@ -102,7 +104,6 @@ import {
102
104
  GenericCancellationToken,
103
105
  HelperPhraseKind,
104
106
  ImplicitFunctionBlockParameterSpecialVariableEntityInfo,
105
- ImportEmitKind,
106
107
  ImportedPackageNameTree,
107
108
  InMemoryPackageScheme,
108
109
  InterfacePackageEntityInfo,
@@ -195,7 +196,6 @@ import {
195
196
  SourceFileA,
196
197
  SourceFileAnalyzer,
197
198
  SourceFileM,
198
- SourceMapMode,
199
199
  SourcePackageDependencyGraph,
200
200
  SourceTranslationDefinition,
201
201
  StructuredTypeKind,
@@ -326,7 +326,7 @@ import {
326
326
  withoutQuotes,
327
327
  withoutTemplateQuotes,
328
328
  yieldTask
329
- } from "../chunk-HDKCVHQW.js";
329
+ } from "../chunk-OTDTWBJA.js";
330
330
  export {
331
331
  AccessKind,
332
332
  AccessedFunction_entity,
@@ -6,9 +6,9 @@ import {
6
6
  PhysicalFileSystem,
7
7
  PhysicalTypeScriptLibrariesProvider,
8
8
  PrintingDiagnosticAcceptor
9
- } from "../chunk-CCGMGHVX.js";
10
- import "../chunk-T4HMJ63L.js";
11
- import "../chunk-HDKCVHQW.js";
9
+ } from "../chunk-2MYUOUPT.js";
10
+ import "../chunk-UOE6Z7CK.js";
11
+ import "../chunk-OTDTWBJA.js";
12
12
  export {
13
13
  CommandLineCompiler,
14
14
  FileSystemUri,
@@ -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,13 @@ import {
142
140
  modifierKindsInSortOrder,
143
141
  operatorKinds,
144
142
  operatorKinds2,
145
- performanceMeasurementStageNames,
146
- performanceMeasurementStages,
147
143
  setUserLocale,
148
144
  sortModifiers,
149
145
  tokenKindByOperatorKind,
150
146
  traverseTreeAsync,
151
147
  traverseTreeAsync2,
152
148
  yieldTask
153
- } from "../chunk-HDKCVHQW.js";
149
+ } from "../chunk-OTDTWBJA.js";
154
150
 
155
151
  // source/services/common/Types.ts
156
152
  import * as ls from "vscode-languageserver";
@@ -196,7 +192,6 @@ var customRequests = {
196
192
  translateSourceFile: new CustomRequestType("artel/translateSourceFile"),
197
193
  provideEvaluatableExpression: new CustomRequestType("artel/provideEvaluatableExpression"),
198
194
  provideServerOwnedDocumentContent: new CustomRequestType("artel/provideServerOwnedDocumentContent"),
199
- emitCodeToString: new CustomRequestType("artel/emitCodeToString"),
200
195
  displayFileSystemTree: new CustomRequestType("artel/displayFileSystemTree"),
201
196
  createOrUpdateSourceFile: new CustomRequestType("artel/fs.createOrUpdateSourceFile"),
202
197
  deleteSourceFile: new CustomRequestType("artel/fs.deleteSourceFile"),
@@ -20076,8 +20071,6 @@ var _LanguageServer = class _LanguageServer {
20076
20071
  (taskController) => this.onProvideServerOwnedDocumentContent(params, taskController)
20077
20072
  ));
20078
20073
  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
20074
  disposable = this.connection.onRequest(
20082
20075
  customRequests.displayFileSystemTree,
20083
20076
  (params) => this.onDisplayFileSystemTree(params)
@@ -20815,108 +20808,6 @@ var _LanguageServer = class _LanguageServer {
20815
20808
  return getMemoryUsage();
20816
20809
  });
20817
20810
  }
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
20811
  onProvideServerOwnedDocumentContent(params, taskController) {
20921
20812
  return __async(this, null, function* () {
20922
20813
  const vscodeUri = URI.parse(params.uri);
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Compiler,
3
3
  DiagnosticFormatter
4
- } from "./chunk-T4HMJ63L.js";
4
+ } from "./chunk-UOE6Z7CK.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-HDKCVHQW.js";
19
+ } from "./chunk-OTDTWBJA.js";
20
20
 
21
21
  // source/executor/FileSystemUri.ts
22
22
  import { platform } from "os";