Added syntax colorization. Remove all references to deprecated lark_to_lezer module.

This commit is contained in:
2026-02-07 11:08:34 +01:00
parent 1c1ced2a9f
commit ab4f251f0c
7 changed files with 106 additions and 461 deletions

View File

@@ -34,13 +34,13 @@ class MockProvider:
Provides predefined data for columns, values, and presets.
"""
def get_tables(self) -> list[str]:
def list_tables(self) -> list[str]:
return ["app.orders"]
def get_columns(self, table: str) -> list[str]:
def list_columns(self, table: str) -> list[str]:
return ["id", "amount", "status"]
def get_column_values(self, column: str) -> list[Any]:
def list_column_values(self, table: str, column: str) -> list[Any]:
if column == "status":
return ["draft", "pending", "approved"]
if column == "amount":
@@ -50,10 +50,10 @@ class MockProvider:
def get_row_count(self, table: str) -> int:
return 150
def get_style_presets(self) -> list[str]:
def list_style_presets(self) -> list[str]:
return ["custom_highlight"]
def get_format_presets(self) -> list[str]:
def list_format_presets(self) -> list[str]:
return ["CHF"]

View File

@@ -84,14 +84,14 @@ class TestFormattingDSL:
assert completions1 is completions2
def test_i_can_get_lezer_grammar_is_cached(self):
"""Test that lezer_grammar property is cached (same object returned)."""
def test_i_can_get_simple_mode_config_is_cached(self):
"""Test that simple_mode_config property is cached (same object returned)."""
dsl = FormattingDSL()
lezer1 = dsl.lezer_grammar
lezer2 = dsl.lezer_grammar
config1 = dsl.simple_mode_config
config2 = dsl.simple_mode_config
assert lezer1 is lezer2
assert config1 is config2
def test_i_can_get_editor_config(self):
"""Test that get_editor_config() returns expected structure."""
@@ -100,6 +100,7 @@ class TestFormattingDSL:
config = dsl.get_editor_config()
assert "name" in config
assert "lezerGrammar" in config
assert "simpleModeConfig" in config
assert "completions" in config
assert config["name"] == "Formatting DSL"
assert "start" in config["simpleModeConfig"] # Simple Mode structure