fix(cli): update highlighter
This commit is contained in:
@@ -232,15 +232,14 @@ class MidasHighlighter(
|
|||||||
self.wrap(LocatableToken(stmt.name), "type-name")
|
self.wrap(LocatableToken(stmt.name), "type-name")
|
||||||
stmt.type.accept(self)
|
stmt.type.accept(self)
|
||||||
|
|
||||||
def visit_property_stmt(self, stmt: m.PropertyStmt) -> None:
|
def visit_member_stmt(self, stmt: m.MemberStmt) -> None:
|
||||||
self.wrap(stmt, "property")
|
self.wrap(stmt, "member")
|
||||||
stmt.type.accept(self)
|
stmt.type.accept(self)
|
||||||
|
|
||||||
def visit_extend_stmt(self, stmt: m.ExtendStmt) -> None:
|
def visit_extend_stmt(self, stmt: m.ExtendStmt) -> None:
|
||||||
self.wrap(stmt, "extend")
|
self.wrap(stmt, "extend")
|
||||||
stmt.type.accept(self)
|
for member in stmt.members:
|
||||||
for op in stmt.operations:
|
member.accept(self)
|
||||||
op.accept(self)
|
|
||||||
|
|
||||||
def visit_op_stmt(self, stmt: m.OpStmt) -> None:
|
def visit_op_stmt(self, stmt: m.OpStmt) -> None:
|
||||||
self.wrap(stmt, "op")
|
self.wrap(stmt, "op")
|
||||||
@@ -298,8 +297,8 @@ class MidasHighlighter(
|
|||||||
|
|
||||||
def visit_complex_type(self, type: m.ComplexType) -> None:
|
def visit_complex_type(self, type: m.ComplexType) -> None:
|
||||||
self.wrap(type, "complex-type")
|
self.wrap(type, "complex-type")
|
||||||
for prop in type.properties:
|
for member in type.members:
|
||||||
prop.accept(self)
|
member.accept(self)
|
||||||
|
|
||||||
def visit_function_type(self, type: m.FunctionType) -> None:
|
def visit_function_type(self, type: m.FunctionType) -> None:
|
||||||
self.wrap(type, "function")
|
self.wrap(type, "function")
|
||||||
@@ -307,6 +306,11 @@ class MidasHighlighter(
|
|||||||
arg.type.accept(self)
|
arg.type.accept(self)
|
||||||
type.returns.accept(self)
|
type.returns.accept(self)
|
||||||
|
|
||||||
|
def visit_extension_type(self, type: m.ExtensionType) -> None:
|
||||||
|
self.wrap(type, "extension")
|
||||||
|
type.base.accept(self)
|
||||||
|
type.extension.accept(self)
|
||||||
|
|
||||||
|
|
||||||
class DiagnosticsHighlighter(Highlighter):
|
class DiagnosticsHighlighter(Highlighter):
|
||||||
EXTRA_CSS_PATH: Optional[Path] = Path(__file__).parent / "hl_diagnostic.css"
|
EXTRA_CSS_PATH: Optional[Path] = Path(__file__).parent / "hl_diagnostic.css"
|
||||||
|
|||||||
Reference in New Issue
Block a user