From e93b2a5b7778f1dd8ee2a5ab1f4f6d95d9d072ab Mon Sep 17 00:00:00 2001 From: BrunoV21 Date: Sun, 7 Sep 2025 23:31:35 +0100 Subject: [PATCH 1/2] added protection for variable handling in typescritp parser --- codetide/parsers/typescript_parser.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/codetide/parsers/typescript_parser.py b/codetide/parsers/typescript_parser.py index a362689..4d81be2 100644 --- a/codetide/parsers/typescript_parser.py +++ b/codetide/parsers/typescript_parser.py @@ -396,6 +396,7 @@ def _process_variable_declarator(cls, node: Node, code: bytes, codeFile: CodeFil value = None next_is_value = False raw = cls._get_content(code, node) + previous_child = None for child in node.children: if child.type == "identifier" and name is None: name = cls._get_content(code, child) @@ -403,9 +404,14 @@ def _process_variable_declarator(cls, node: Node, code: bytes, codeFile: CodeFil type_hint = cls._get_content(code, child) elif child.type == "=": next_is_value = True + if previous_child is not None and name is None: + name = cls._get_content(code, previous_child) elif next_is_value: value = cls._get_content(code, child) next_is_value = False + + previous_child = child + codeFile.add_variable(VariableDeclaration( name=name, type_hint=type_hint, From dd8197a6918971453bdaf695b220fa9afb6b6762 Mon Sep 17 00:00:00 2001 From: BrunoV21 Date: Sun, 7 Sep 2025 23:34:39 +0100 Subject: [PATCH 2/2] changed to relative import --- codetide/agents/tide/agent.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codetide/agents/tide/agent.py b/codetide/agents/tide/agent.py index cf39e99..13e69b1 100644 --- a/codetide/agents/tide/agent.py +++ b/codetide/agents/tide/agent.py @@ -1,7 +1,7 @@ from codetide import CodeTide -from codetide.search.code_search import SmartCodeSearch from ...mcp.tools.patch_code import file_exists, open_file, process_patch, remove_file, write_file, parse_patch_blocks from ...core.defaults import DEFAULT_ENCODING, DEFAULT_STORAGE_PATH +from ...search.code_search import SmartCodeSearch from ...parsers import SUPPORTED_LANGUAGES from ...autocomplete import AutoComplete from .models import Steps