Frontend Visual Theme Spec and Retirement of Host-Consumed Semantic CSS
This commit is contained in:
-2
@@ -2,7 +2,6 @@ package p.studio.compiler;
|
||||
|
||||
import p.studio.compiler.models.FrontendSemanticPresentationSpec;
|
||||
import p.studio.compiler.models.FrontendSpec;
|
||||
import p.studio.compiler.pbs.PbsSemanticKind;
|
||||
import p.studio.utilities.structures.ReadOnlySet;
|
||||
|
||||
import java.util.List;
|
||||
@@ -15,7 +14,6 @@ public class PBSDefinitions {
|
||||
.sourceRoots(ReadOnlySet.from("src"))
|
||||
.stdlibVersions(List.of(FrontendSpec.Stdlib.asDefault(1)))
|
||||
.semanticPresentation(new FrontendSemanticPresentationSpec(
|
||||
PbsSemanticKind.semanticKeys(),
|
||||
List.of(PBSFrontendThemes.DEFAULT_PBS),
|
||||
"pbs-default",
|
||||
List.of(PBSFrontendHostProjections.VSCODE)))
|
||||
|
||||
+9
-29
@@ -2,46 +2,26 @@ package p.studio.compiler;
|
||||
|
||||
import p.studio.compiler.models.FrontendHostProjectionEntrySpec;
|
||||
import p.studio.compiler.models.FrontendHostProjectionSpec;
|
||||
import p.studio.compiler.pbs.PbsSemanticKind;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.BUILTIN_TYPE;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.CALLBACK;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.COMMENT;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.CONST;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.CONSTRUCTOR;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.CONTRACT;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.ENUM;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.ERROR;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.FUNCTION;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.GLOBAL;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.HOST;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.IDENTIFIER;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.IMPLEMENTS;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.KEYWORD;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.LIFECYCLE;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.LITERAL;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.METHOD;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.NUMBER;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.OPERATOR;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.PUNCTUATION;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.SERVICE;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.STRING;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.STRUCT;
|
||||
import static p.studio.compiler.pbs.PbsSemanticKind.*;
|
||||
|
||||
public final class PBSFrontendHostProjections {
|
||||
public static final String VSCODE_HOST_ID = "vscode";
|
||||
|
||||
public static final FrontendHostProjectionSpec VSCODE = new FrontendHostProjectionSpec(
|
||||
VSCODE_HOST_ID,
|
||||
Arrays.stream(p.studio.compiler.pbs.PbsSemanticKind.values())
|
||||
Arrays.stream(PbsSemanticKind.values())
|
||||
.map(PBSFrontendHostProjections::mapVscodeProjection)
|
||||
.toList());
|
||||
|
||||
private PBSFrontendHostProjections() {
|
||||
}
|
||||
|
||||
private static FrontendHostProjectionEntrySpec mapVscodeProjection(final p.studio.compiler.pbs.PbsSemanticKind kind) {
|
||||
private static FrontendHostProjectionEntrySpec mapVscodeProjection(final PbsSemanticKind kind) {
|
||||
return switch (kind) {
|
||||
case COMMENT -> projection(COMMENT.semanticKey(), "comment");
|
||||
case STRING -> projection(STRING.semanticKey(), "string");
|
||||
@@ -72,14 +52,14 @@ public final class PBSFrontendHostProjections {
|
||||
private static FrontendHostProjectionEntrySpec projection(
|
||||
final String semanticKey,
|
||||
final String hostTokenType) {
|
||||
return new FrontendHostProjectionEntrySpec(semanticKey, hostTokenType, java.util.List.of(), hostTokenType, java.util.List.of());
|
||||
return new FrontendHostProjectionEntrySpec(semanticKey, hostTokenType, List.of(), hostTokenType, List.of());
|
||||
}
|
||||
|
||||
private static FrontendHostProjectionEntrySpec projection(
|
||||
final String semanticKey,
|
||||
final String hostTokenType,
|
||||
final String fallbackTokenType) {
|
||||
return new FrontendHostProjectionEntrySpec(semanticKey, hostTokenType, java.util.List.of(), fallbackTokenType, java.util.List.of());
|
||||
return new FrontendHostProjectionEntrySpec(semanticKey, hostTokenType, List.of(), fallbackTokenType, List.of());
|
||||
}
|
||||
|
||||
private static FrontendHostProjectionEntrySpec projection(
|
||||
@@ -90,8 +70,8 @@ public final class PBSFrontendHostProjections {
|
||||
return new FrontendHostProjectionEntrySpec(
|
||||
semanticKey,
|
||||
hostTokenType,
|
||||
java.util.List.of(modifier),
|
||||
List.of(modifier),
|
||||
fallbackTokenType,
|
||||
java.util.List.of(modifier));
|
||||
List.of(modifier));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user