@distrohelena/canton-typescript-sdk 0.1.26 → 0.1.27
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.
|
@@ -189,8 +189,8 @@ class AnalyzedDamlTypeBuilder {
|
|
|
189
189
|
try {
|
|
190
190
|
dataType = this.semanticModel.getDataTypeOrThrow(reference);
|
|
191
191
|
}
|
|
192
|
-
catch
|
|
193
|
-
throw this.unsupported(context, `could not resolve named type '${reference.name}'`);
|
|
192
|
+
catch {
|
|
193
|
+
throw this.unsupported(context, `could not resolve named type '${reference.packageId}:${reference.moduleName}:${reference.name}'`);
|
|
194
194
|
}
|
|
195
195
|
if (dataType.definition.kind === "record") {
|
|
196
196
|
return Object.freeze({
|
|
@@ -29,14 +29,14 @@ export class DamlInterfaceGenerator {
|
|
|
29
29
|
/** Generates an in-memory project from compiled DAML-LF archive bytes. */
|
|
30
30
|
async generateFromDalfOrThrowAsync(archiveBytes) {
|
|
31
31
|
const pkg = this.packageLoader.loadPackageOrThrow(archiveBytes);
|
|
32
|
-
const compilation = DamlLfCompilation.
|
|
32
|
+
const compilation = DamlLfCompilation.createForTemplateGeneration(new DamlLfWorkspace([pkg]));
|
|
33
33
|
return this.projectEmitter.emitProject(this.analyzeOrThrow(compilation));
|
|
34
34
|
}
|
|
35
35
|
/** Generates an in-memory project from DAR bytes. */
|
|
36
36
|
async generateFromDarOrThrowAsync(archiveBytes) {
|
|
37
37
|
const archive = await this.darArchiveLoader.loadDarOrThrowAsync(archiveBytes);
|
|
38
38
|
const packages = archive.packageEntries.map((entry) => this.packageLoader.loadPackageOrThrow(entry.bytes));
|
|
39
|
-
const compilation = DamlLfCompilation.
|
|
39
|
+
const compilation = DamlLfCompilation.createForTemplateGeneration(new DamlLfWorkspace(packages));
|
|
40
40
|
return this.projectEmitter.emitProject(this.analyzeOrThrow(compilation));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -18,6 +18,7 @@ export declare class DamlLfCompilation {
|
|
|
18
18
|
private readonly valueDefinitionIdentities;
|
|
19
19
|
private constructor();
|
|
20
20
|
static createOrThrow(workspace: DamlLfWorkspace): DamlLfCompilation;
|
|
21
|
+
static createForTemplateGeneration(workspace: DamlLfWorkspace): DamlLfCompilation;
|
|
21
22
|
getModuleSymbolOrThrow(reference: ModuleReference): ModuleSymbol;
|
|
22
23
|
getTypeSymbolOrThrow(reference: TypeConReference): TypeSymbol;
|
|
23
24
|
createSemanticModel(): DamlLfSemanticModel;
|
|
@@ -25,6 +25,11 @@ export class DamlLfCompilation {
|
|
|
25
25
|
compilation.validateReferencesOrThrow();
|
|
26
26
|
return compilation;
|
|
27
27
|
}
|
|
28
|
+
static createForTemplateGeneration(workspace) {
|
|
29
|
+
const compilation = new DamlLfCompilation(workspace);
|
|
30
|
+
compilation.buildIndexes();
|
|
31
|
+
return compilation;
|
|
32
|
+
}
|
|
28
33
|
getModuleSymbolOrThrow(reference) {
|
|
29
34
|
const symbol = this.moduleSymbols.get(DamlLfCompilation.createModuleKey(reference.packageId, reference.moduleName));
|
|
30
35
|
if (symbol === undefined) {
|