Frontend Visual Theme Spec and Retirement of Host-Consumed Semantic CSS

This commit is contained in:
2026-05-06 15:46:46 +01:00
parent fb13e166f1
commit 10fd7f6111
7 changed files with 241 additions and 86 deletions
@@ -46,14 +46,28 @@ class CompilerLanguageServiceBridgeTest {
new LspProjectContext("main", "pbs", Path.of(".")),
Path.of("demo.pbs").toUri().toString(),
"""
struct Vec2 {
fn length() -> int {
return 0;
}
}
fn main() -> void {
const answer = 42;
const answer: int = 42;
let value = new Vec2();
value.length();
}
""");
assertTrue(semanticTokens.legend().contains("pbs-keyword"));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-keyword")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-number")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-struct")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-function")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-method")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-const")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-builtin-type")));
assertTrue(semanticTokens.tokens().stream().anyMatch(token -> token.semanticKey().equals("pbs-constructor")));
}
@Test
@@ -74,7 +88,7 @@ class CompilerLanguageServiceBridgeTest {
assertEquals("#d9e2ec", description.visualThemes().getFirst().editorPalette().baseForeground());
assertTrue(description.visualThemes().getFirst().tokenStyles().stream()
.anyMatch(tokenStyle -> tokenStyle.semanticKey().equals("pbs-keyword")
&& tokenStyle.foreground().equals("#569cd6")));
&& tokenStyle.foreground().equals("#d2a8ff")));
}
private Path findRepoRoot(final Path start) {