Skip to content

Commit c1fe46f

Browse files
authored
Merge pull request #46 from IBM/release-patch-to-fix-captures-issue
Fix captures issue
2 parents 0020e55 + b4ae881 commit c1fe46f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

cldk/models/treesitter/models.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from dataclasses import dataclass
2-
from typing import List, Tuple
3-
2+
from typing import Dict, List, Tuple
3+
from ipdb import set_trace
44
from tree_sitter import Node
55

66

@@ -27,8 +27,9 @@ class Capture:
2727
node: Node
2828
name: str
2929

30-
def __init__(self, captures: List[Tuple[Node, str]]):
31-
self.captures = [self.Capture(node=node, name=text) for node, text in captures]
30+
def __init__(self, captures: Dict[str, List[Node]]):
31+
for capture_name, captures in captures.items():
32+
self.captures = [self.Capture(node=node, name=capture_name) for node in captures]
3233

3334
def __getitem__(self, index: int) -> Capture:
3435
"""Get the capture at the specified index.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "cldk"
3-
version = "0.1.0"
3+
version = "0.1.1"
44
description = "codellm-devkit: A python library for seamless integration with LLMs."
55
authors = ["Rahul Krishna <[email protected]>", "Rangeet Pan <[email protected]>", "Saurabh Sinhas <[email protected]>",
66
"Raju Pavuluri <[email protected]>"]

0 commit comments

Comments
 (0)