feat(gui): Implement @symbol regex parser for on-demand definition lookup

This commit is contained in:
2026-03-07 14:57:52 -05:00
parent 84396dc13a
commit a0a9d00310
4 changed files with 38 additions and 3 deletions

View File

@@ -0,0 +1,27 @@
import pytest
from src.app_controller import parse_symbols
def test_parse_symbols_basic():
text = "Check @MyClass and @my_func."
symbols = parse_symbols(text)
assert symbols == ["MyClass", "my_func"]
def test_parse_symbols_methods():
text = "Calling @MyClass.my_method and @AnotherClass.method_name."
symbols = parse_symbols(text)
assert symbols == ["MyClass.my_method", "AnotherClass.method_name"]
def test_parse_symbols_no_symbols():
text = "This string has no symbols."
symbols = parse_symbols(text)
assert symbols == []
def test_parse_symbols_mixed():
text = "Mixed text: @Class1, @func_2, and some text @MyClass.method."
symbols = parse_symbols(text)
assert symbols == ["Class1", "func_2", "MyClass.method"]
def test_parse_symbols_edge_cases():
text = "@LeadingSymbol and @SymbolAtEnd"
symbols = parse_symbols(text)
assert symbols == ["LeadingSymbol", "SymbolAtEnd"]