8000 Update treesitter analysis to use global declerations of parser and l… · codellm-devkit/python-sdk@3bd115d · GitHub
[go: up one dir, main page]

Skip to content

Commit 3bd115d

Browse files
committed
Update treesitter analysis to use global declerations of parser and language
Signed-off-by: Rahul Krishna <i.m.ralk@gmail.com>
1 parent fab8f84 commit 3bd115d

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

cldk/analysis/python/python_analysis.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,11 @@ class PythonAnalysis:
3030

3131
def __init__(
3232
self,
33-
eager_analysis: bool,
3433
project_dir: str | Path | None,
3534
source_code: str | None,
36-
analysis_backend_path: str | None,
37-
analysis_json_path: str | Path | None,
3835
) -> None:
3936
self.project_dir = project_dir
4037
self.source_code = source_code
41 8000 -
self.analysis_json_path = analysis_json_path
42-
self.analysis_backend_path = analysis_backend_path
43-
self.eager_analysis = eager_analysis
4438
self.analysis_backend: TreesitterPython = TreesitterPython()
4539

4640
def get_methods(self) -> List[PyMethod]:

cldk/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
from cldk.analysis.c import CAnalysis
2828
from cldk.analysis.java import JavaAnalysis
2929
from cldk.analysis.commons.treesitter import TreesitterJava
30+
from cldk.analysis.python.python_analysis import PythonAnalysis
3031
from cldk.utils.exceptions import CldkInitializationException
3132
from cldk.utils.sanitization.java import TreesitterSanitizer
3233

@@ -118,6 +119,14 @@ def analysis(
118119
target_files=target_files,
119120
eager_analysis=eager,
120121
)
122+
elif self.language == "python":
123+
return PythonAnalysis(
124+
project_dir=project_path,
125+
source_code=source_code,
126+
analysis_backend_path=analysis_backend_path,
127+
analysis_json_path=analysis_json_path,
128+
eager_analysis=eager,
129+
)
121130
elif self.language == "c":
122131
return CAnalysis(project_dir=project_path)
123132
else:

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 = "1.0.0"
3+
version = "1.0.1"
44
description = "The official Python SDK for Codellm-Devkit."
55
authors = ["Rahul Krishna <i.m.ralk@gmail.com>", "Rangeet Pan <rangeet.pan@ibm.com>", "Saurabh Sinhas <sinhas@us.ibm.com>",
66
"Raju Pavuluri <pavuluri@us.ibm.com>"]

0 commit comments

Comments
 (0)
0