feat(studio): show executed source diagnostics in UI2
Capture bounded compiler inputs by revision and PBX identity, consume Play v2 faults and retain static diagnostic excerpts across failed preparation. Integrate the UI2 panel, qualification evidence and regression tests without adding an editor.
This commit is contained in:
+3
@@ -83,6 +83,9 @@ public final class InterfaceModuleLoader {
|
||||
utf8.length,
|
||||
0,
|
||||
ignored -> () -> utf8);
|
||||
// Synthetic inputs are consumed directly by the parser, so record the
|
||||
// same immutable provider bytes before publishing their file identity.
|
||||
sourceHandle.readBytes().orElseThrow();
|
||||
return fileTable.register(sourceHandle);
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -226,11 +226,13 @@ final class PbsModuleAssemblyService {
|
||||
var unit=new MutableModuleUnit();var module=moduleId(table,coordinates);
|
||||
byte[] utf8=generated.source().getBytes(StandardCharsets.UTF_8);
|
||||
var file=files.register(new SourceHandle(owner,Path.of("@generated/animations").resolve(generated.moduleName()).resolve("main.pbs"),generated.path(),utf8.length,0,ignored->()->utf8));
|
||||
files.get(file).readBytes().orElseThrow();
|
||||
var ast=parseSourceFile(file,generated.source(),diagnostics,SourceKind.PROJECT);
|
||||
unit.sources.add(new PbsModuleVisibilityValidator.SourceFile(file,ast));moduleByFile.put(file,module);
|
||||
parsed.add(new PbsParsedSourceFile(file,ast,module,SourceKind.PROJECT));
|
||||
byte[] barrel=generated.barrel().getBytes(StandardCharsets.UTF_8);
|
||||
var barrelId=files.register(new SourceHandle(owner,Path.of("@generated/animations").resolve(generated.moduleName()).resolve("mod.barrel"),generated.path().resolveSibling("mod.barrel"),barrel.length,0,ignored->()->barrel));
|
||||
files.get(barrelId).readBytes().orElseThrow();
|
||||
unit.barrels.add(new PbsModuleVisibilityValidator.BarrelFile(barrelId,parseBarrelFile(barrelId,generated.barrel(),diagnostics)));
|
||||
moduleByFile.put(barrelId,module);modules.put(coordinates,unit);
|
||||
}
|
||||
|
||||
+4
@@ -39,6 +39,10 @@ class InterfaceModuleLoaderTest {
|
||||
assertEquals(1, module.barrelFiles().size());
|
||||
assertFalse(module.sourceFiles().getFirst().fileId().isNone());
|
||||
assertFalse(module.barrelFiles().getFirst().fileId().isNone());
|
||||
// Capture must already exist after parsing; these assertions precede any test read.
|
||||
var consumed=p.studio.compiler.source.diagnostics.ConsumedSources.capture(fileTable,4096,10,16384);
|
||||
assertEquals(2,consumed.size());assertTrue(consumed.stream().allMatch(s->s.kind().equals("sdk")));
|
||||
assertTrue(consumed.stream().anyMatch(s->s.text().equals("declare host Gfx { fn draw() -> void; }")));
|
||||
assertTrue(fileTable.get(module.sourceFiles().getFirst().fileId()).readUtf8().isPresent());
|
||||
assertTrue(fileTable.get(module.barrelFiles().getFirst().fileId()).readUtf8().isPresent());
|
||||
assertEquals(
|
||||
|
||||
Reference in New Issue
Block a user