Skip to content

Commit 852f65b

Browse files
authored
Merge pull request #27 from BrunoV21/typescrit-beta-2
Typescrit beta 2
2 parents 4b3470e + dd8197a commit 852f65b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

codetide/agents/tide/agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from codetide import CodeTide
2-
from codetide.search.code_search import SmartCodeSearch
32
from ...mcp.tools.patch_code import file_exists, open_file, process_patch, remove_file, write_file, parse_patch_blocks
43
from ...core.defaults import DEFAULT_ENCODING, DEFAULT_STORAGE_PATH
4+
from ...search.code_search import SmartCodeSearch
55
from ...parsers import SUPPORTED_LANGUAGES
66
from ...autocomplete import AutoComplete
77
from .models import Steps

codetide/parsers/typescript_parser.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,16 +396,22 @@ def _process_variable_declarator(cls, node: Node, code: bytes, codeFile: CodeFil
396396
value = None
397397
next_is_value = False
398398
raw = cls._get_content(code, node)
399+
previous_child = None
399400
for child in node.children:
400401
if child.type == "identifier" and name is None:
401402
name = cls._get_content(code, child)
402403
elif child.type == "type_annotation":
403404
type_hint = cls._get_content(code, child)
404405
elif child.type == "=":
405406
next_is_value = True
407+
if previous_child is not None and name is None:
408+
name = cls._get_content(code, previous_child)
406409
elif next_is_value:
407410
value = cls._get_content(code, child)
408411
next_is_value = False
412+
413+
previous_child = child
414+
409415
codeFile.add_variable(VariableDeclaration(
410416
name=name,
411417
type_hint=type_hint,

0 commit comments

Comments
 (0)