Skip to content

Fix captures issue #46

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cldk/models/treesitter/models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from dataclasses import dataclass
from typing import List, Tuple

from typing import Dict, List, Tuple
from ipdb import set_trace
from tree_sitter import Node


Expand All @@ -27,8 +27,9 @@ class Capture:
node: Node
name: str

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

def __getitem__(self, index: int) -> Capture:
"""Get the capture at the specified index.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cldk"
version = "0.1.0"
version = "0.1.1"
description = "codellm-devkit: A python library for seamless integration with LLMs."
authors = ["Rahul Krishna <i.m.ralk@gmail.com>", "Rangeet Pan <rangeet.pan@ibm.com>", "Saurabh Sinhas <sinhas@us.ibm.com>",
"Raju Pavuluri <pavuluri@us.ibm.com>"]
Expand Down