Frontend Visual Theme Spec and Retirement of Host-Consumed Semantic CSS
This commit is contained in:
+23
@@ -3,6 +3,9 @@ package p.studio.compiler.pbs;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import p.studio.compiler.PBSFrontendHostProjections;
|
||||
import p.studio.compiler.PBSDefinitions;
|
||||
import p.studio.compiler.models.FrontendSemanticToken;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
@@ -50,4 +53,24 @@ final class PbsSemanticPresentationContractTest {
|
||||
java.util.List.of("readonly"),
|
||||
vscodeProjection.requireProjection(PbsSemanticKind.GLOBAL.semanticKey()).hostTokenModifiers());
|
||||
}
|
||||
|
||||
@Test
|
||||
void shouldPublishPbsOwnedSemanticTokenProvider() {
|
||||
final List<FrontendSemanticToken> semanticTokens = PBSDefinitions.PBS.getSemanticTokenProvider().tokenize("""
|
||||
struct Vec2 {}
|
||||
|
||||
fn main() -> void {
|
||||
const answer: int = 42;
|
||||
let value = new Vec2();
|
||||
value.length();
|
||||
}
|
||||
""");
|
||||
|
||||
assertTrue(semanticTokens.stream().anyMatch(token -> token.semanticKey().equals(PbsSemanticKind.STRUCT.semanticKey())));
|
||||
assertTrue(semanticTokens.stream().anyMatch(token -> token.semanticKey().equals(PbsSemanticKind.FUNCTION.semanticKey())));
|
||||
assertTrue(semanticTokens.stream().anyMatch(token -> token.semanticKey().equals(PbsSemanticKind.CONST.semanticKey())));
|
||||
assertTrue(semanticTokens.stream().anyMatch(token -> token.semanticKey().equals(PbsSemanticKind.BUILTIN_TYPE.semanticKey())));
|
||||
assertTrue(semanticTokens.stream().anyMatch(token -> token.semanticKey().equals(PbsSemanticKind.CONSTRUCTOR.semanticKey())));
|
||||
assertTrue(semanticTokens.stream().anyMatch(token -> token.semanticKey().equals(PbsSemanticKind.METHOD.semanticKey())));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user