tree-sitter-analyzer 1.3.2__py3-none-any.whl → 1.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of tree-sitter-analyzer might be problematic. Click here for more details.
- tree_sitter_analyzer/__init__.py +1 -1
- tree_sitter_analyzer/mcp/tools/fd_rg_utils.py +1 -1
- tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py +26 -2
- {tree_sitter_analyzer-1.3.2.dist-info → tree_sitter_analyzer-1.3.4.dist-info}/METADATA +13 -13
- {tree_sitter_analyzer-1.3.2.dist-info → tree_sitter_analyzer-1.3.4.dist-info}/RECORD +7 -7
- {tree_sitter_analyzer-1.3.2.dist-info → tree_sitter_analyzer-1.3.4.dist-info}/WHEEL +0 -0
- {tree_sitter_analyzer-1.3.2.dist-info → tree_sitter_analyzer-1.3.4.dist-info}/entry_points.txt +0 -0
tree_sitter_analyzer/__init__.py
CHANGED
|
@@ -148,7 +148,7 @@ def build_fd_command(
|
|
|
148
148
|
cmd += ["--max-results", str(limit)]
|
|
149
149
|
|
|
150
150
|
# Pattern goes before roots if present
|
|
151
|
-
# If no pattern is specified, use '.' to match all files
|
|
151
|
+
# If no pattern is specified, use '.' to match all files (required to prevent roots being interpreted as pattern)
|
|
152
152
|
if pattern:
|
|
153
153
|
cmd.append(pattern)
|
|
154
154
|
else:
|
|
@@ -7,13 +7,17 @@ First narrow files with fd, then search contents with ripgrep, with caps & meta.
|
|
|
7
7
|
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
|
+
import logging
|
|
10
11
|
import time
|
|
11
12
|
from typing import Any
|
|
12
13
|
|
|
13
14
|
from ..utils.error_handler import handle_mcp_errors
|
|
15
|
+
from ..utils.gitignore_detector import get_default_detector
|
|
14
16
|
from . import fd_rg_utils
|
|
15
17
|
from .base_tool import BaseMCPTool
|
|
16
18
|
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
20
|
+
|
|
17
21
|
|
|
18
22
|
class FindAndGrepTool(BaseMCPTool):
|
|
19
23
|
"""MCP tool that composes fd and ripgrep with safety limits and metadata."""
|
|
@@ -228,6 +232,26 @@ class FindAndGrepTool(BaseMCPTool):
|
|
|
228
232
|
fd_rg_utils.DEFAULT_RESULTS_LIMIT,
|
|
229
233
|
fd_rg_utils.MAX_RESULTS_HARD_CAP,
|
|
230
234
|
)
|
|
235
|
+
|
|
236
|
+
# Smart .gitignore detection for fd stage
|
|
237
|
+
no_ignore = bool(arguments.get("no_ignore", False))
|
|
238
|
+
if not no_ignore:
|
|
239
|
+
# Auto-detect if we should use --no-ignore
|
|
240
|
+
detector = get_default_detector()
|
|
241
|
+
original_roots = arguments.get("roots", [])
|
|
242
|
+
should_ignore = detector.should_use_no_ignore(
|
|
243
|
+
original_roots, self.project_root
|
|
244
|
+
)
|
|
245
|
+
if should_ignore:
|
|
246
|
+
no_ignore = True
|
|
247
|
+
# Log the auto-detection for debugging
|
|
248
|
+
detection_info = detector.get_detection_info(
|
|
249
|
+
original_roots, self.project_root
|
|
250
|
+
)
|
|
251
|
+
logger.info(
|
|
252
|
+
f"Auto-enabled --no-ignore due to .gitignore interference: {detection_info['reason']}"
|
|
253
|
+
)
|
|
254
|
+
|
|
231
255
|
fd_cmd = fd_rg_utils.build_fd_command(
|
|
232
256
|
pattern=arguments.get("pattern"),
|
|
233
257
|
glob=bool(arguments.get("glob", False)),
|
|
@@ -237,7 +261,7 @@ class FindAndGrepTool(BaseMCPTool):
|
|
|
237
261
|
depth=arguments.get("depth"),
|
|
238
262
|
follow_symlinks=bool(arguments.get("follow_symlinks", False)),
|
|
239
263
|
hidden=bool(arguments.get("hidden", False)),
|
|
240
|
-
no_ignore=
|
|
264
|
+
no_ignore=no_ignore,
|
|
241
265
|
size=arguments.get("size"),
|
|
242
266
|
changed_within=arguments.get("changed_within"),
|
|
243
267
|
changed_before=arguments.get("changed_before"),
|
|
@@ -328,7 +352,7 @@ class FindAndGrepTool(BaseMCPTool):
|
|
|
328
352
|
exclude_globs=arguments.get("exclude_globs"),
|
|
329
353
|
follow_symlinks=bool(arguments.get("follow_symlinks", False)),
|
|
330
354
|
hidden=bool(arguments.get("hidden", False)),
|
|
331
|
-
no_ignore=
|
|
355
|
+
no_ignore=no_ignore, # Use the same no_ignore flag from fd stage
|
|
332
356
|
max_filesize=arguments.get("max_filesize"),
|
|
333
357
|
context_before=arguments.get("context_before"),
|
|
334
358
|
context_after=arguments.get("context_after"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tree-sitter-analyzer
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.4
|
|
4
4
|
Summary: Extensible multi-language code analyzer framework using Tree-sitter with dynamic plugin architecture
|
|
5
5
|
Project-URL: Homepage, https://github.com/aimasteracc/tree-sitter-analyzer
|
|
6
6
|
Project-URL: Documentation, https://github.com/aimasteracc/tree-sitter-analyzer#readme
|
|
@@ -164,10 +164,10 @@ Description-Content-Type: text/markdown
|
|
|
164
164
|
[](https://python.org)
|
|
165
165
|
[](LICENSE)
|
|
166
166
|
[](#quality-assurance)
|
|
167
|
-
[](#quality-assurance)
|
|
168
168
|
[](#quality-assurance)
|
|
169
169
|
[](https://pypi.org/project/tree-sitter-analyzer/)
|
|
170
|
-
[](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
|
|
171
171
|
[](https://github.com/aimasteracc/tree-sitter-analyzer)
|
|
172
172
|
|
|
173
173
|
## 🚀 Break LLM Token Limits, Let AI Understand Code Files of Any Size
|
|
@@ -266,7 +266,7 @@ powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | ie
|
|
|
266
266
|
|
|
267
267
|
Add the following to your configuration file:
|
|
268
268
|
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
269
|
-
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
269
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
270
270
|
- **Linux**: `~/.config/claude/claude_desktop_config.json`
|
|
271
271
|
|
|
272
272
|
**Basic Configuration (Recommended):**
|
|
@@ -353,11 +353,11 @@ uv run python -m tree_sitter_analyzer examples/BigService.java --partial-read --
|
|
|
353
353
|
### 💬 AI IDE Prompts (SMART Analysis Workflow)
|
|
354
354
|
|
|
355
355
|
> **✅ Test Verification Status:** All prompts below have been tested and verified in real environments, ensuring 100% availability
|
|
356
|
-
>
|
|
356
|
+
>
|
|
357
357
|
> **🎯 SMART Analysis Workflow:**
|
|
358
358
|
> - **S** - Setup project (set_project_path)
|
|
359
359
|
> - **M** - Map target files (precision pattern matching)
|
|
360
|
-
> - **A** - Analyze core structure (analyze_code_structure)
|
|
360
|
+
> - **A** - Analyze core structure (analyze_code_structure)
|
|
361
361
|
> - **R** - Retrieve essential code (extract_code_section)
|
|
362
362
|
> - **T** - Trace dependencies (when needed)
|
|
363
363
|
>
|
|
@@ -708,7 +708,7 @@ Tree-sitter Analyzer now features a revolutionary unified architecture that inte
|
|
|
708
708
|
|
|
709
709
|
#### **Supported Element Types:**
|
|
710
710
|
- `class` - Classes and interfaces
|
|
711
|
-
- `function` - Methods and functions
|
|
711
|
+
- `function` - Methods and functions
|
|
712
712
|
- `variable` - Fields and variables
|
|
713
713
|
- `import` - Import statements
|
|
714
714
|
- `package` - Package declarations
|
|
@@ -733,7 +733,7 @@ Get insights without reading complete files:
|
|
|
733
733
|
### 🔍 **Advanced Query Filtering**
|
|
734
734
|
Powerful code element query and filtering system:
|
|
735
735
|
- **Exact matching**: `--filter "name=main"` to find specific methods
|
|
736
|
-
- **Pattern matching**: `--filter "name=~auth*"` to find authentication-related methods
|
|
736
|
+
- **Pattern matching**: `--filter "name=~auth*"` to find authentication-related methods
|
|
737
737
|
- **Parameter filtering**: `--filter "params=2"` to find methods with specific parameter counts
|
|
738
738
|
- **Modifier filtering**: `--filter "static=true,public=true"` to find static public methods
|
|
739
739
|
- **Compound conditions**: `--filter "name=~get*,params=0,public=true"` to combine multiple conditions
|
|
@@ -742,7 +742,7 @@ Powerful code element query and filtering system:
|
|
|
742
742
|
### 🔗 **AI Assistant Integration**
|
|
743
743
|
Deep integration through MCP protocol:
|
|
744
744
|
- Claude Desktop
|
|
745
|
-
- Cursor IDE
|
|
745
|
+
- Cursor IDE
|
|
746
746
|
- Roo Code
|
|
747
747
|
- Other MCP-compatible AI tools
|
|
748
748
|
|
|
@@ -920,11 +920,11 @@ Tree-sitter Analyzer automatically detects and protects project boundaries:
|
|
|
920
920
|
- **Zero test failures** - Fully CI/CD ready
|
|
921
921
|
- **Cross-platform compatibility** - Windows, macOS, Linux
|
|
922
922
|
|
|
923
|
-
### ⚡ **Latest Quality Achievements (v1.3.
|
|
923
|
+
### ⚡ **Latest Quality Achievements (v1.3.4)**
|
|
924
924
|
- ✅ **Cross-platform path compatibility** - Fixed Windows short path names and macOS symbolic link differences
|
|
925
925
|
- ✅ **Windows environment** - Implemented robust path normalization using Windows API
|
|
926
926
|
- ✅ **macOS environment** - Fixed `/var` vs `/private/var` symbolic link differences
|
|
927
|
-
- ✅ **Comprehensive test coverage** - 1605 tests, 74.
|
|
927
|
+
- ✅ **Comprehensive test coverage** - 1605 tests, 74.38% coverage
|
|
928
928
|
- ✅ **GitFlow implementation** - Professional development/release branch strategy. See [GitFlow documentation](GITFLOW.md) for details.
|
|
929
929
|
|
|
930
930
|
### ⚙️ **Running Tests**
|
|
@@ -1041,9 +1041,9 @@ All AI prompts in this document have been thoroughly tested in real environments
|
|
|
1041
1041
|
|
|
1042
1042
|
**Test Environment:**
|
|
1043
1043
|
- Operating System: Windows 10
|
|
1044
|
-
- Project: tree-sitter-analyzer v1.3.
|
|
1044
|
+
- Project: tree-sitter-analyzer v1.3.4
|
|
1045
1045
|
- Test Files: BigService.java (1419 lines), sample.py (256 lines), MultiClass.java (54 lines)
|
|
1046
|
-
- Test Coverage: 1605 tests passed, 74.
|
|
1046
|
+
- Test Coverage: 1605 tests passed, 74.38% coverage
|
|
1047
1047
|
- Test Tools: All MCP tools (check_code_scale, analyze_code_structure, extract_code_section, query_code, list_files, search_content, find_and_grep)
|
|
1048
1048
|
|
|
1049
1049
|
**🚀 Start Now** → [30-Second Quick Start](#-30-second-quick-start)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
tree_sitter_analyzer/__init__.py,sha256=
|
|
1
|
+
tree_sitter_analyzer/__init__.py,sha256=w-TSWkZBKM6e0-pDzQpQ40S0ZA6t89fBOLIWWSOoUmw,3067
|
|
2
2
|
tree_sitter_analyzer/__main__.py,sha256=Zl79tpe4UaMu-7yeztc06tgP0CVMRnvGgas4ZQP5SCs,228
|
|
3
3
|
tree_sitter_analyzer/api.py,sha256=N_bcf1pLwzXS3elPn30OySLR6ehsHdWpchXMycjl0PY,17399
|
|
4
4
|
tree_sitter_analyzer/cli_main.py,sha256=jWjVJ5AgNmtf6Z7CgeK3IF-zi7yIiu9zn4Oyvzl-iNQ,10349
|
|
@@ -57,8 +57,8 @@ tree_sitter_analyzer/mcp/tools/__init__.py,sha256=9KfetZTaUhvWTeKuZPYzWb7ZomFQ8S
|
|
|
57
57
|
tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py,sha256=JyS9gey2oFoWjzsiiLjwcqTgwBYGlbY01vAK3QYUuF4,28470
|
|
58
58
|
tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py,sha256=mssed7bEfGeGxW4mOf7dg8BDS1oqHLolIBNX9DaZ3DM,8997
|
|
59
59
|
tree_sitter_analyzer/mcp/tools/base_tool.py,sha256=qf2My325azlnKOugNVMN_R1jtZcjXVy354sGVKzvZls,3546
|
|
60
|
-
tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=
|
|
61
|
-
tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py,sha256=
|
|
60
|
+
tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=R1ICH40vkWO3OdKZjxok9ptQZpZ6-tM5SkLHHOC4-BE,17749
|
|
61
|
+
tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py,sha256=u4VeRWhyS_kltWtuzwHNPtmFHjQguKAceP9X-RHD7Lk,21194
|
|
62
62
|
tree_sitter_analyzer/mcp/tools/list_files_tool.py,sha256=TA1BRQtb-D5x1pD-IcRJYnP0WnnFfl9q7skI25MOdHk,12873
|
|
63
63
|
tree_sitter_analyzer/mcp/tools/query_tool.py,sha256=1xY1ONNY2sIFJxoILlnNzBnwGVgzEF7vVJ2ccqR9auA,10879
|
|
64
64
|
tree_sitter_analyzer/mcp/tools/read_partial_tool.py,sha256=BMAJF205hTIrYTQJG6N1-vVuKSby2CSm9nWzSMMWceI,11339
|
|
@@ -82,7 +82,7 @@ tree_sitter_analyzer/security/__init__.py,sha256=ZTqTt24hsljCpTXAZpJC57L7MU5lJLT
|
|
|
82
82
|
tree_sitter_analyzer/security/boundary_manager.py,sha256=3eeENRKWtz2pyZHzd8DiVaq8fdeC6s1eVOuBylSmQPg,9347
|
|
83
83
|
tree_sitter_analyzer/security/regex_checker.py,sha256=jWK6H8PTPgzbwRPfK_RZ8bBTS6rtEbgjY5vr3YWjQ_U,9616
|
|
84
84
|
tree_sitter_analyzer/security/validator.py,sha256=yR4qTWEcXpR--bSFwtWvSgY0AzqujOFAqlc1Z7dlTdk,9809
|
|
85
|
-
tree_sitter_analyzer-1.3.
|
|
86
|
-
tree_sitter_analyzer-1.3.
|
|
87
|
-
tree_sitter_analyzer-1.3.
|
|
88
|
-
tree_sitter_analyzer-1.3.
|
|
85
|
+
tree_sitter_analyzer-1.3.4.dist-info/METADATA,sha256=ZGb953-SqZGOvjQQ_HZTkrrq-zuTuuOtxxYbKjDktVY,39700
|
|
86
|
+
tree_sitter_analyzer-1.3.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
87
|
+
tree_sitter_analyzer-1.3.4.dist-info/entry_points.txt,sha256=U4tfLGXgCWubKm2PyEb3zxhQ2pm7zVotMyfyS0CodD8,486
|
|
88
|
+
tree_sitter_analyzer-1.3.4.dist-info/RECORD,,
|
|
File without changes
|
{tree_sitter_analyzer-1.3.2.dist-info → tree_sitter_analyzer-1.3.4.dist-info}/entry_points.txt
RENAMED
|
File without changes
|