implements PLN-0027 frontend semantic presentation contract and lsp descriptor

This commit is contained in:
2026-04-02 15:11:40 +01:00
parent 78758c1023
commit de9782c16e
14 changed files with 253 additions and 32 deletions
@@ -0,0 +1,33 @@
package p.studio.compiler.pbs;
import org.junit.jupiter.api.Test;
import p.studio.compiler.PBSDefinitions;
import java.net.URL;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
final class PbsSemanticPresentationContractTest {
@Test
void shouldPublishSemanticPresentationContractThroughFrontendSpec() {
final var presentation = PBSDefinitions.PBS.getSemanticPresentation();
assertFalse(presentation.semanticKeys().isEmpty());
assertEquals(PbsSemanticKind.semanticKeys(), presentation.semanticKeys());
assertEquals(1, presentation.resources().size());
assertEquals("/themes/pbs/semantic-highlighting.css", presentation.resources().getFirst());
}
@Test
void shouldPublishResolvableSemanticPresentationResources() {
final var resourcePath = PBSDefinitions.PBS.getSemanticPresentation().resources().getFirst();
final URL resource = PBSDefinitions.class.getResource(resourcePath);
assertNotNull(resource, resourcePath);
assertTrue(resource.toExternalForm().endsWith("themes/pbs/semantic-highlighting.css"));
}
}