tree-sitter-analyzer 1.9.0__py3-none-any.whl → 1.9.2__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.

@@ -11,7 +11,7 @@ Architecture:
11
11
  - Data Models: Generic and language-specific code element representations
12
12
  """
13
13
 
14
- __version__ = "1.9.0"
14
+ __version__ = "1.9.2"
15
15
  __author__ = "aisheng.yu"
16
16
  __email__ = "aimasteracc@gmail.com"
17
17
 
@@ -484,15 +484,5 @@ class HtmlCompactFormatter(IFormatter):
484
484
  return "\n".join(lines)
485
485
 
486
486
 
487
- # Register HTML formatters
488
- def register_html_formatters() -> None:
489
- """Register HTML-specific formatters"""
490
- from .formatter_registry import FormatterRegistry
491
-
492
- FormatterRegistry.register_formatter(HtmlFormatter)
493
- FormatterRegistry.register_formatter(HtmlJsonFormatter)
494
- FormatterRegistry.register_formatter(HtmlCompactFormatter)
495
-
496
-
497
- # Auto-register when module is imported
498
- register_html_formatters()
487
+ # HTML formatters are registered via formatter_registry.py
488
+ # to avoid duplicate registration warnings
@@ -397,7 +397,11 @@ def group_matches_by_file(matches: list[dict[str, Any]]) -> dict[str, Any]:
397
397
  # Convert to grouped structure
398
398
  files = []
399
399
  for file_path, file_matches in file_groups.items():
400
- files.append({"file": file_path, "matches": file_matches})
400
+ files.append({
401
+ "file": file_path,
402
+ "matches": file_matches,
403
+ "match_count": len(file_matches)
404
+ })
401
405
 
402
406
  return {"success": True, "count": total_matches, "files": files}
403
407
 
@@ -515,6 +519,11 @@ def summarize_search_results(
515
519
  truncated_line += "..."
516
520
  sample_lines.append(f"L{line_num}: {truncated_line}")
517
521
  remaining_lines -= 1
522
+
523
+ # Ensure we have at least some sample lines if matches exist
524
+ if not sample_lines and file_matches:
525
+ # Fallback: create a simple summary line
526
+ sample_lines.append(f"Found {len(file_matches)} matches")
518
527
 
519
528
  # Optimize file path for token efficiency
520
529
  optimized_path = _optimize_file_path(file_path, common_prefix)
@@ -341,21 +341,41 @@ class SearchContentTool(BaseMCPTool):
341
341
  # Simple cache lookup without complex cross-format logic for performance
342
342
  cached_result = self.cache.get(cache_key)
343
343
  if cached_result is not None:
344
- # Add cache hit indicator to result
345
- if isinstance(cached_result, dict):
346
- cached_result = cached_result.copy()
347
- cached_result["cache_hit"] = True
348
- return cached_result
349
- elif isinstance(cached_result, int):
350
- # For integer results (like total_only mode), return as-is
351
- return cached_result
344
+ # Check if this is a total_only request
345
+ total_only_requested = arguments.get("total_only", False)
346
+
347
+ if total_only_requested:
348
+ # For total_only mode, always return integer if possible
349
+ if isinstance(cached_result, int):
350
+ return cached_result
351
+ elif isinstance(cached_result, dict) and "total_matches" in cached_result:
352
+ return cached_result["total_matches"]
353
+ elif isinstance(cached_result, dict) and "count" in cached_result:
354
+ return cached_result["count"]
355
+ else:
356
+ # Fallback: extract count from dict or return 0
357
+ return 0
352
358
  else:
353
- # For other types, convert to dict format
354
- return {
355
- "success": True,
356
- "cached_result": cached_result,
357
- "cache_hit": True,
358
- }
359
+ # For non-total_only modes, return dict format
360
+ if isinstance(cached_result, dict):
361
+ cached_result = cached_result.copy()
362
+ cached_result["cache_hit"] = True
363
+ return cached_result
364
+ elif isinstance(cached_result, int):
365
+ # Convert integer to dict format for non-total_only modes
366
+ return {
367
+ "success": True,
368
+ "count": cached_result,
369
+ "total_matches": cached_result,
370
+ "cache_hit": True,
371
+ }
372
+ else:
373
+ # For other types, convert to dict format
374
+ return {
375
+ "success": True,
376
+ "cached_result": cached_result,
377
+ "cache_hit": True,
378
+ }
359
379
 
360
380
  # Handle max_count parameter properly
361
381
  # If user specifies max_count, use it directly (with reasonable upper limit)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tree-sitter-analyzer
3
- Version: 1.9.0
3
+ Version: 1.9.2
4
4
  Summary: AI-era enterprise-grade code analysis tool with comprehensive HTML/CSS support, dynamic plugin architecture, and MCP integration
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
@@ -198,11 +198,11 @@ Description-Content-Type: text/markdown
198
198
 
199
199
  [![Python Version](https://img.shields.io/badge/python-3.10%2B-blue.svg)](https://python.org)
200
200
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
201
- [![Tests](https://img.shields.io/badge/tests-3380%20passed-brightgreen.svg)](#quality-assurance)
201
+ [![Tests](https://img.shields.io/badge/tests-3370%20passed-brightgreen.svg)](#quality-assurance)
202
202
  [![Coverage](https://codecov.io/gh/aimasteracc/tree-sitter-analyzer/branch/main/graph/badge.svg)](https://codecov.io/gh/aimasteracc/tree-sitter-analyzer)
203
203
  [![Quality](https://img.shields.io/badge/quality-enterprise%20grade-blue.svg)](#quality-assurance)
204
204
  [![PyPI](https://img.shields.io/pypi/v/tree-sitter-analyzer.svg)](https://pypi.org/project/tree-sitter-analyzer/)
205
- [![Version](https://img.shields.io/badge/version-1.8.4-blue.svg)](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
205
+ [![Version](https://img.shields.io/badge/version-1.9.2-blue.svg)](https://github.com/aimasteracc/tree-sitter-analyzer/releases)
206
206
  [![zread](https://img.shields.io/badge/Ask_Zread-_.svg?style=flat&color=00b0aa&labelColor=000000&logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTQuOTYxNTYgMS42MDAxSDIuMjQxNTZDMS44ODgxIDEuNjAwMSAxLjYwMTU2IDEuODg2NjQgMS42MDE1NiAyLjI0MDFWNC45NjAxQzEuNjAxNTYgNS4zMTM1NiAxLjg4ODEgNS42MDAxIDIuMjQxNTYg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z4K&logoColor=ffffff)](https://zread.ai/aimasteracc/tree-sitter-analyzer)
207
207
  [![GitHub Stars](https://img.shields.io/github/stars/aimasteracc/tree-sitter-analyzer.svg?style=social)](https://github.com/aimasteracc/tree-sitter-analyzer)
208
208
 
@@ -255,7 +255,7 @@ Tree-sitter Analyzer is an enterprise-grade code analysis tool designed for the
255
255
  | **Go** | Basic Support | Basic syntax parsing |
256
256
 
257
257
  ### 🏆 Production Ready
258
- - **3,380 Tests** - 100% pass rate, enterprise-grade quality assurance
258
+ - **3,370 Tests** - 100% pass rate, enterprise-grade quality assurance
259
259
  - **High Coverage** - Comprehensive test coverage
260
260
  - **Cross-platform Support** - Compatible with Windows, macOS, Linux
261
261
  - **Continuous Maintenance** - Active development and community support
@@ -634,13 +634,30 @@ Tree-sitter Analyzer provides a rich set of MCP tools designed for AI assistants
634
634
  | | `analyze_code_structure` | Code structure analysis and table generation | 🆕 suppress_output parameter, multiple formats (full/compact/csv/json/html), automatic language detection |
635
635
  | | `extract_code_section` | Precise code section extraction | Specified line range extraction, large file efficient processing, original format preservation |
636
636
  | **🔍 Intelligent Search** | `list_files` | High-performance file discovery | fd-based, glob patterns, file type filters, time range control |
637
- | | `search_content` | Regex content search | ripgrep-based, multiple output formats, context control, encoding handling, 🆕 unified `set_project_path` support |
637
+ | | `search_content` | Regex content search | ripgrep-based, multiple output formats, context control, encoding handling, 🆕 parallel processing engine, unified `set_project_path` support |
638
638
  | | `find_and_grep` | Two-stage search | File discovery → content search, fd+ripgrep combination, intelligent cache optimization, 🆕 unified `set_project_path` support |
639
639
  | **🔧 Advanced Queries** | `query_code` | tree-sitter queries | Predefined query keys, custom query strings, filter expression support |
640
640
  | **⚙️ System Management** | `set_project_path` | Project root path setting | Security boundary control, automatic path validation, 🆕 unified across all MCP tools |
641
641
  | **📁 Resource Access** | Code file resources | URI code file access | File content access via URI identification |
642
642
  | | Project statistics resources | Project statistics data access | Project analysis data and statistical information |
643
643
 
644
+ ### 🆕 v1.9.0 New Feature: Parallel Processing Engine
645
+
646
+ Revolutionary parallel processing capabilities for enhanced search performance:
647
+
648
+ - **🔄 Parallel Processing Engine**: search_content MCP tool now supports parallel processing for multiple directories
649
+ - **⚡ Performance Boost**: Up to 4x faster search speeds for large codebases
650
+ - **🛡️ Type Safety Improvements**: 7% reduction in mypy errors (341→318)
651
+ - **✨ Code Style Unification**: Significant reduction in ruff violations
652
+ - **🏗️ Technical Debt Resolution**: Comprehensive code quality improvements
653
+ - **🚀 Test Execution Time**: Maintained 83% reduction (215s→37s)
654
+
655
+ #### 🔄 Parallel Processing Details
656
+ - **Automatic Parallel Execution**: Multiple roots directories are automatically processed in parallel
657
+ - **Configurable Control**: `enable_parallel` option for control (default: True)
658
+ - **Scalable Performance**: Performance improvements scale with directory count
659
+ - **Memory Efficient**: Semaphore-controlled concurrent execution limits
660
+
644
661
  ### 🆕 v1.8.4 New Feature: Configurable File Logging
645
662
 
646
663
  Revolutionary environment variable-controlled file logging system:
@@ -873,7 +890,7 @@ uv run python -m tree_sitter_analyzer --show-query-languages
873
890
  ## 8. 🏆 Quality Assurance
874
891
 
875
892
  ### 📊 Quality Metrics
876
- - **3,380 tests** - 100% pass rate ✅
893
+ - **3,370 tests** - 100% pass rate ✅
877
894
  - **High code coverage** - Comprehensive test suite
878
895
  - **Zero test failures** - Production ready
879
896
  - **Cross-platform support** - Windows, macOS, Linux
@@ -1,4 +1,4 @@
1
- tree_sitter_analyzer/__init__.py,sha256=0MHpJmMcjVenxRRk4tpuSe8gRs2A0STrXYh1G7qo6bI,3067
1
+ tree_sitter_analyzer/__init__.py,sha256=2gOLQE2qPo14YhUJcz4zjTq_sQ210fhLrHI0PcSa9aE,3067
2
2
  tree_sitter_analyzer/__main__.py,sha256=Zl79tpe4UaMu-7yeztc06tgP0CVMRnvGgas4ZQP5SCs,228
3
3
  tree_sitter_analyzer/api.py,sha256=y12xDnqvdNJdiG6GyqVdZBunmBLwfIjVgsCy0jjGOds,22129
4
4
  tree_sitter_analyzer/cli_main.py,sha256=AmKeZIUCSI8Gshbz_e1Niquf4pFbpPgtOTwQdLbQgcw,11093
@@ -42,7 +42,7 @@ tree_sitter_analyzer/formatters/__init__.py,sha256=yVb4HF_4EEPRwTf3y3-vM2Nllrhyk
42
42
  tree_sitter_analyzer/formatters/base_formatter.py,sha256=e3LQ9p3_XyaPSx1jevO7eo8r-fHimu4wuC_uUKgSijg,6698
43
43
  tree_sitter_analyzer/formatters/formatter_factory.py,sha256=4fsSMxhBmGWFmPjcuwkTvgiIWWFireaOaChYi1UNnSM,2381
44
44
  tree_sitter_analyzer/formatters/formatter_registry.py,sha256=_3z1nsiV3eqrAq8NZ53aUUBGBXqjibDvbTXElR2yHf0,11479
45
- tree_sitter_analyzer/formatters/html_formatter.py,sha256=mleWyMEkzGl3wLexnsTDONnp2vxkenVjUMT6_7rxlxA,19008
45
+ tree_sitter_analyzer/formatters/html_formatter.py,sha256=XNKtnsqmRBrGhbMu_4UkQb4kQo_5ZM-12ntqHxBHkuo,18696
46
46
  tree_sitter_analyzer/formatters/java_formatter.py,sha256=0jxKfrWtsr_K2VG1zW0LH2E6w6nfpIhcXTfIyWw3Jmc,11163
47
47
  tree_sitter_analyzer/formatters/javascript_formatter.py,sha256=31cbf4UldSdZXxZzcC5faEczkedVHcK9Mlq7lp74tKk,21320
48
48
  tree_sitter_analyzer/formatters/language_formatter_factory.py,sha256=dIfeCb82huRBzhl0M111rkihhPp_sr0CKcXUwg76BU8,2288
@@ -71,12 +71,12 @@ tree_sitter_analyzer/mcp/tools/__init__.py,sha256=9KfetZTaUhvWTeKuZPYzWb7ZomFQ8S
71
71
  tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py,sha256=5IobTL2LuzYalJhIBbk_8QV2ehGGPRbyNO71ECYLmLs,30966
72
72
  tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py,sha256=mssed7bEfGeGxW4mOf7dg8BDS1oqHLolIBNX9DaZ3DM,8997
73
73
  tree_sitter_analyzer/mcp/tools/base_tool.py,sha256=K02l34Yn6brgg45yIXuSsRPB4Cp870ba86ZBlSU4OW8,3689
74
- tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=MOuxAcunj4q0NUCSgrR-tBzE0zcHPk3WTHSy1XKvVmY,25069
74
+ tree_sitter_analyzer/mcp/tools/fd_rg_utils.py,sha256=P4zB5M_hMEZAfzcmhPdkNd5A_KA1atkr3DqBDUibMVE,25400
75
75
  tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py,sha256=if_P_rRqH72WGl845lCJ-aorb7nSOhnvh0cYPqdXje0,32126
76
76
  tree_sitter_analyzer/mcp/tools/list_files_tool.py,sha256=o66KKI2IkObU8qD3bhWKGcuytjCjxuENlxKdLV4NGkg,18187
77
77
  tree_sitter_analyzer/mcp/tools/query_tool.py,sha256=XOP21uVKe1J7ayiUnJJBUGls1QTJ5K0GoZ4HlbOr5YE,16887
78
78
  tree_sitter_analyzer/mcp/tools/read_partial_tool.py,sha256=O7UyZSNW5_-5hGOkO9xiw4qDY5WKvHtTiGQ_WjhAIA8,18305
79
- tree_sitter_analyzer/mcp/tools/search_content_tool.py,sha256=EY--l25VEKfbymP44ozWlfsfNTy94YEu1_3-vVrL6dY,35193
79
+ tree_sitter_analyzer/mcp/tools/search_content_tool.py,sha256=jjN4L8YJ91kHgXs9AdWIWVa5Vm0l4lot2Ud3FnBPN6Y,36297
80
80
  tree_sitter_analyzer/mcp/tools/table_format_tool.py,sha256=48zTj1AthSLfRT9KHzum332pKy3R2uxjGdw1omkzgfY,22853
81
81
  tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py,sha256=-zZnqN9WcoyRTKM_16ADH859LSebzi34BGYwQL2zCOs,25084
82
82
  tree_sitter_analyzer/mcp/utils/__init__.py,sha256=TgTTKsRJAqF95g1fAp5SR_zQVDkImpc_5R0Dw529UUw,3126
@@ -103,7 +103,7 @@ tree_sitter_analyzer/security/regex_checker.py,sha256=jWK6H8PTPgzbwRPfK_RZ8bBTS6
103
103
  tree_sitter_analyzer/security/validator.py,sha256=OIrlMmIqrfpG7FxrI9_xR6g3sgPpJyWPFfYiWma7Rkk,21708
104
104
  tree_sitter_analyzer/utils/__init__.py,sha256=ch_TjuMxxdGF9dDBOP_sYVGVZaMXzgGS1FOFn3sicHA,3863
105
105
  tree_sitter_analyzer/utils/tree_sitter_compat.py,sha256=p565DG7r5sHK2GgZFyj7X4eLwpWujaN_M61Z3oDqAxE,10610
106
- tree_sitter_analyzer-1.9.0.dist-info/METADATA,sha256=glMRTV71CBuIhCu3sJZAnvHzt5fcuBoEIO5u81BvgPI,49119
107
- tree_sitter_analyzer-1.9.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
- tree_sitter_analyzer-1.9.0.dist-info/entry_points.txt,sha256=TJmEXxAMz3og3VPphTHsuE8tNJxf7GuAPjNHwVhXRnc,972
109
- tree_sitter_analyzer-1.9.0.dist-info/RECORD,,
106
+ tree_sitter_analyzer-1.9.2.dist-info/METADATA,sha256=KX23OZLqFpEQG_YTTdcSBbSbpShosquL0j2eOyDwbyY,50168
107
+ tree_sitter_analyzer-1.9.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
+ tree_sitter_analyzer-1.9.2.dist-info/entry_points.txt,sha256=TJmEXxAMz3og3VPphTHsuE8tNJxf7GuAPjNHwVhXRnc,972
109
+ tree_sitter_analyzer-1.9.2.dist-info/RECORD,,