From c59dee87eb2643e28501624ea95b6415683d5fec Mon Sep 17 00:00:00 2001 From: Tom Longhurst <30480171+thomhurst@users.noreply.github.com> Date: Mon, 2 Feb 2026 14:05:10 +0000 Subject: [PATCH] Remove startswith() workaround from SymbolUtils Now that C# language server normalizes symbol names at the source, the utility function can use simple exact matching. This is cleaner and follows the principle of fixing root causes rather than patching callsites. All 24 C# tests still pass. --- src/solidlsp/ls_utils.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/solidlsp/ls_utils.py b/src/solidlsp/ls_utils.py index adafe13c..ae0363fd 100644 --- a/src/solidlsp/ls_utils.py +++ b/src/solidlsp/ls_utils.py @@ -416,13 +416,9 @@ class SymbolUtils: def symbol_tree_contains_name(roots: list[UnifiedSymbolInformation], name: str) -> bool: """ Check if any symbol in the tree has a name matching the given name. - Supports both old format (exact match) and new Roslyn format with type annotations - (e.g., "Add(int, int) : int" matches "Add"). """ for symbol in roots: - symbol_name = symbol["name"] - # Check for exact match (old format) or prefix match (new format with type annotations) - if symbol_name == name or symbol_name.startswith((name + "(", name + " :")): + if symbol["name"] == name: return True if SymbolUtils.symbol_tree_contains_name(symbol["children"], name): return True