tree-sitter-analyzer 1.7.0__tar.gz → 1.7.2__tar.gz
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-1.7.2/.roo/rules/ROO_RULES.md +826 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/CHANGELOG.md +58 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/GITFLOW.md +63 -2
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/GITFLOW_ja.md +61 -2
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/GITFLOW_zh.md +61 -2
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/PKG-INFO +205 -238
- tree_sitter_analyzer-1.7.2/README.md +672 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/README_ja.md +109 -142
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/README_zh.md +108 -158
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/coverage.json +1 -1
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/pyproject.toml +3 -2
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/__init__.py +1 -1
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py +184 -11
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/list_files_tool.py +112 -2
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/search_content_tool.py +210 -10
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/uv.lock +1 -1
- tree_sitter_analyzer-1.7.0/README.md +0 -705
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.gitattributes +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.gitignore +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.kiro/steering/product.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.kiro/steering/structure.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.kiro/steering/tech.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.pre-commit-config.yaml +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/.pre-commit-hooks.yaml +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/AI_COLLABORATION_GUIDE.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/CODE_STYLE_GUIDE.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/CONTRIBUTING.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/DEPLOYMENT_GUIDE.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/FILE_OUTPUT_FEATURE_SUMMARY.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/LANGUAGE_GUIDELINES.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/LLM_CODING_GUIDELINES.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/MCP_SETUP_DEVELOPERS.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/MCP_SETUP_USERS.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/PROJECT_ROOT_CONFIG.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/PYPI_RELEASE_GUIDE.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/PYTHON_SUPPORT_SUMMARY.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/REFACTORING_SUMMARY.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/build_standalone.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/check_quality.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/docs/GITFLOW_BEST_PRACTICES.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/docs/RELEASE_EXECUTION_GUIDE.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/docs/api.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/docs/mcp_fd_rg_design.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/BigService.java +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/BigService.json +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/BigService.summary.json +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/ComprehensiveTypeScript.ts +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/JavaDocTest.java +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/ModernJavaScript.js +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/MultiClass.java +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/ReactComponent.jsx +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/ReactTypeScriptComponent.tsx +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/Sample.java +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/TypeScriptDeclarations.d.ts +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/cache_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/calculate_token_comparison.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/file_output_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/javascript_analysis_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/project_root_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/sample.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/security_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/security_integration_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/smart_cache_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/suppress_output_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/examples/total_only_optimization_demo.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/llm_code_checker.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/pypirc_example.txt +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/pytest.ini +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/scripts/README.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/scripts/gitflow_helper.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/scripts/gitflow_release_automation.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/scripts/sync_version.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/scripts/sync_version_minimal.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/start_mcp_server.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/test_python_support.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/01_onboarding.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/02_architecture_map.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/03_cli_cheatsheet.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/04_mcp_cheatsheet.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/05_plugin_tutorial.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/06_quality_workflow.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/07_troubleshooting.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/08_prompt_library.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/09_tasks.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/10_glossary.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/11_takeover_plan.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/CLI_COMMAND_CORRECTIONS.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/IMPROVEMENT_SUMMARY.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/training/README.md +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/__main__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/api.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/__main__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/advanced_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/base_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/default_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/find_and_grep_cli.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/list_files_cli.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/partial_read_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/query_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/search_content_cli.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/structure_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/summary_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/commands/table_command.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli/info_commands.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/cli_main.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/constants.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/analysis_engine.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/cache_service.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/engine.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/parser.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/query.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/query_filter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/core/query_service.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/encoding_utils.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/exceptions.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/file_handler.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/base_formatter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/formatter_factory.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/java_formatter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/javascript_formatter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/python_formatter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/formatters/typescript_formatter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/interfaces/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/interfaces/cli.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/interfaces/cli_adapter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/interfaces/mcp_adapter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/interfaces/mcp_server.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/language_detector.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/language_loader.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/languages/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/languages/java_plugin.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/languages/javascript_plugin.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/languages/python_plugin.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/languages/typescript_plugin.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/resources/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/resources/code_file_resource.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/resources/project_stats_resource.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/server.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/analyze_scale_tool_cli_compatible.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/base_tool.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/fd_rg_utils.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/query_tool.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/read_partial_tool.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/table_format_tool.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/tools/universal_analyze_tool.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/utils/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/utils/error_handler.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/utils/file_output_manager.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/utils/gitignore_detector.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/utils/path_resolver.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/mcp/utils/search_cache.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/models.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/output_manager.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/plugins/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/plugins/base.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/plugins/manager.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/project_detector.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/queries/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/queries/java.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/queries/javascript.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/queries/python.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/queries/typescript.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/query_loader.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/security/__init__.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/security/boundary_manager.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/security/regex_checker.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/security/validator.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/table_formatter.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/tree_sitter_analyzer/utils.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/upload_interactive.py +0 -0
- {tree_sitter_analyzer-1.7.0 → tree_sitter_analyzer-1.7.2}/upload_to_pypi.py +0 -0
|
@@ -0,0 +1,826 @@
|
|
|
1
|
+
# ROO規則 - Tree-Sitter-Analyzer MCP最適化ガイド
|
|
2
|
+
|
|
3
|
+
## 基本原則
|
|
4
|
+
|
|
5
|
+
### 1. ファイル読取の優先順位
|
|
6
|
+
- **禁止**: 標準の`read_file`ツールをコードファイルの読取に使用すること
|
|
7
|
+
- **推奨**: tree-sitter-analyzer MCPツールを使用してコードファイルを読取すること
|
|
8
|
+
- **理由**: tree-sitter-analyzer MCPは構造化された解析とトークン効率化を提供
|
|
9
|
+
|
|
10
|
+
### 2. Tree-Sitter-Analyzer MCP使用規則
|
|
11
|
+
|
|
12
|
+
#### 2.1 コード構造解析の最適化
|
|
13
|
+
```markdown
|
|
14
|
+
# 推奨パターン: suppress_output + output_file
|
|
15
|
+
use_mcp_tool:
|
|
16
|
+
server_name: tree-sitter-analyzer
|
|
17
|
+
tool_name: analyze_code_structure
|
|
18
|
+
arguments:
|
|
19
|
+
file_path: "target/file.py"
|
|
20
|
+
format_type: "full"
|
|
21
|
+
suppress_output: true
|
|
22
|
+
output_file: "structure_analysis.md"
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**利点**:
|
|
26
|
+
- トークン消費を大幅削減
|
|
27
|
+
- 構造情報を外部ファイルに保存
|
|
28
|
+
- 後続の読取で詳細情報を取得可能
|
|
29
|
+
|
|
30
|
+
#### 2.2 ファイル一覧取得の最適化
|
|
31
|
+
```markdown
|
|
32
|
+
# 推奨パターン: suppress_output + output_file
|
|
33
|
+
use_mcp_tool:
|
|
34
|
+
server_name: tree-sitter-analyzer
|
|
35
|
+
tool_name: list_files
|
|
36
|
+
arguments:
|
|
37
|
+
roots: ["src"]
|
|
38
|
+
extensions: ["py", "js", "java"]
|
|
39
|
+
suppress_output: true
|
|
40
|
+
output_file: "file_list.json"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**利点**:
|
|
44
|
+
- 大量のファイル一覧でもトークン消費を最小化
|
|
45
|
+
- ファイル詳細情報(サイズ、更新日時等)を外部ファイルに保存
|
|
46
|
+
- count_onlyモードでも対応
|
|
47
|
+
|
|
48
|
+
#### 2.3 段階的コード解析戦略
|
|
49
|
+
1. **第1段階**: `analyze_code_structure`で構造概要を取得
|
|
50
|
+
2. **第2段階**: 生成されたファイルを`read_file`で読取
|
|
51
|
+
3. **第3段階**: 必要に応じて`extract_code_section`で詳細取得
|
|
52
|
+
|
|
53
|
+
#### 2.4 効率的なツール選択
|
|
54
|
+
|
|
55
|
+
##### コード読取用ツール
|
|
56
|
+
- `analyze_code_structure`: 全体構造の把握
|
|
57
|
+
- `extract_code_section`: 特定行範囲の抽出
|
|
58
|
+
- `query_code`: 特定要素の検索(関数、クラス等)
|
|
59
|
+
|
|
60
|
+
##### ファイル検索用ツール
|
|
61
|
+
- `list_files`: ファイル一覧取得(fd使用)
|
|
62
|
+
- `count_only: true`でカウントのみ取得
|
|
63
|
+
- `suppress_output + output_file`で大量ファイル対応
|
|
64
|
+
- `search_content`: コンテンツ検索(ripgrep使用)
|
|
65
|
+
- `find_and_grep`: 2段階検索(fd + ripgrep)
|
|
66
|
+
|
|
67
|
+
### 3. トークン最適化戦略
|
|
68
|
+
|
|
69
|
+
#### 3.1 出力抑制の活用
|
|
70
|
+
```markdown
|
|
71
|
+
# 大きなファイルの場合
|
|
72
|
+
suppress_output: true
|
|
73
|
+
output_file: "analysis_result.md"
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
#### 3.2 フォーマット選択
|
|
77
|
+
- `full`: 詳細解析(小〜中規模ファイル)
|
|
78
|
+
- `compact`: 簡潔表示(中〜大規模ファイル)
|
|
79
|
+
- `csv`: データ処理用
|
|
80
|
+
- `json`: プログラム処理用
|
|
81
|
+
|
|
82
|
+
#### 3.3 検索最適化
|
|
83
|
+
```markdown
|
|
84
|
+
# 大量結果が予想される場合
|
|
85
|
+
summary_only: true
|
|
86
|
+
group_by_file: true
|
|
87
|
+
total_only: true # カウントのみ必要な場合
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
#### 3.4 検索ツールでのファイル出力最適化
|
|
91
|
+
```markdown
|
|
92
|
+
# find_and_grep と search_content でのトークン節約
|
|
93
|
+
use_mcp_tool:
|
|
94
|
+
server_name: tree-sitter-analyzer
|
|
95
|
+
tool_name: find_and_grep
|
|
96
|
+
arguments:
|
|
97
|
+
roots: ["src"]
|
|
98
|
+
pattern: "*XXXX060*"
|
|
99
|
+
glob: true
|
|
100
|
+
query: "項目名|lblKoumokuName"
|
|
101
|
+
case: "insensitive"
|
|
102
|
+
suppress_output: true
|
|
103
|
+
output_file: "search_results.json"
|
|
104
|
+
|
|
105
|
+
# または search_content でも同様
|
|
106
|
+
use_mcp_tool:
|
|
107
|
+
server_name: tree-sitter-analyzer
|
|
108
|
+
tool_name: search_content
|
|
109
|
+
arguments:
|
|
110
|
+
roots: ["src"]
|
|
111
|
+
query: "項目名|lblKoumokuName"
|
|
112
|
+
case: "insensitive"
|
|
113
|
+
summary_only: true
|
|
114
|
+
suppress_output: true
|
|
115
|
+
output_file: "content_search.json"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**利点**:
|
|
119
|
+
- 大量の検索結果でもトークン消費を最小化
|
|
120
|
+
- 詳細な結果をファイルに保存して後で参照可能
|
|
121
|
+
- JSONまたはMarkdown形式で自動保存
|
|
122
|
+
- 既存の検索最適化オプションと組み合わせ可能
|
|
123
|
+
|
|
124
|
+
#### 3.5 日本語検索でのトークン爆発対策
|
|
125
|
+
```markdown
|
|
126
|
+
# 危険: 汎用的な日本語単語での無制限検索
|
|
127
|
+
query: "項目名"
|
|
128
|
+
context_before: 3
|
|
129
|
+
context_after: 3
|
|
130
|
+
# → 大量マッチでトークン爆発
|
|
131
|
+
|
|
132
|
+
# 安全: 段階的アプローチ
|
|
133
|
+
# ステップ1: まずカウントのみ確認
|
|
134
|
+
total_only: true
|
|
135
|
+
|
|
136
|
+
# ステップ2: 必要に応じて制限付きで詳細取得
|
|
137
|
+
max_count: 10
|
|
138
|
+
summary_only: true
|
|
139
|
+
# コンテキスト行は最小限に抑制
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### 4. 具体的使用パターン
|
|
143
|
+
|
|
144
|
+
#### 4.1 関連ファイル一括検索(推奨パターン)
|
|
145
|
+
```markdown
|
|
146
|
+
# 画面ID、機能名、クラス名等で関連ファイルを一括検索
|
|
147
|
+
use_mcp_tool:
|
|
148
|
+
server_name: tree-sitter-analyzer
|
|
149
|
+
tool_name: search_content
|
|
150
|
+
arguments:
|
|
151
|
+
roots: ["src"]
|
|
152
|
+
query: "画面ID" # 画面ID例
|
|
153
|
+
case: "insensitive"
|
|
154
|
+
summary_only: true
|
|
155
|
+
suppress_output: true
|
|
156
|
+
output_file: "content_search.json"
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**利点**:
|
|
160
|
+
- Controller、Service、HTML、JavaScript、Mapperなど関連ファイルを一度に特定
|
|
161
|
+
- 機能全体の構成を素早く把握
|
|
162
|
+
- 後続の詳細解析対象を効率的に絞り込み
|
|
163
|
+
|
|
164
|
+
**適用場面**:
|
|
165
|
+
- 新機能の調査開始時
|
|
166
|
+
- バグ修正対象の特定
|
|
167
|
+
- 既存機能の理解
|
|
168
|
+
- リファクタリング範囲の確認
|
|
169
|
+
|
|
170
|
+
#### 4.2 新しいコードベース調査
|
|
171
|
+
```markdown
|
|
172
|
+
1. search_content で関連ファイル一括検索(4.1参照)
|
|
173
|
+
2. list_files で全体構造把握
|
|
174
|
+
3. analyze_code_structure で主要ファイル解析
|
|
175
|
+
4. extract_code_section で詳細確認
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
#### 4.3 バグ修正・機能追加
|
|
179
|
+
```markdown
|
|
180
|
+
1. search_content で関連コード一括検索(4.1参照)
|
|
181
|
+
2. analyze_code_structure で影響範囲確認
|
|
182
|
+
3. query_code で依存関係調査
|
|
183
|
+
4. extract_code_section で実装詳細取得
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### 4.4 リファクタリング
|
|
187
|
+
```markdown
|
|
188
|
+
1. search_content で対象機能の関連ファイル特定(4.1参照)
|
|
189
|
+
2. find_and_grep で詳細なコード特定
|
|
190
|
+
3. analyze_code_structure で構造解析
|
|
191
|
+
4. query_code で関数・クラス抽出
|
|
192
|
+
5. 段階的な変更実装
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### 5. セキュリティとパフォーマンス
|
|
196
|
+
|
|
197
|
+
#### 5.1 プロジェクト境界
|
|
198
|
+
- 全てのMCPツールはプロジェクトルート内に制限
|
|
199
|
+
- `set_project_path`で明示的に境界設定可能
|
|
200
|
+
|
|
201
|
+
#### 5.2 リソース制限
|
|
202
|
+
- ファイルサイズ制限: `max_filesize`パラメータ使用
|
|
203
|
+
- 結果数制限: `limit`パラメータ使用
|
|
204
|
+
- タイムアウト: `timeout_ms`パラメータ使用
|
|
205
|
+
|
|
206
|
+
#### 5.3 キャッシュ活用
|
|
207
|
+
- tree-sitter解析結果は自動キャッシュ
|
|
208
|
+
- 同一ファイルの再解析は高速化
|
|
209
|
+
|
|
210
|
+
### 6. エラーハンドリング
|
|
211
|
+
|
|
212
|
+
#### 6.1 一般的なエラー対応
|
|
213
|
+
- ファイルが見つからない → `list_files`で存在確認
|
|
214
|
+
- 解析失敗 → 言語指定を明示的に設定
|
|
215
|
+
- メモリ不足 → `suppress_output: true`使用
|
|
216
|
+
|
|
217
|
+
#### 6.2 大規模ファイル対応
|
|
218
|
+
```markdown
|
|
219
|
+
# 大規模ファイルの場合
|
|
220
|
+
1. check_code_scale でサイズ確認
|
|
221
|
+
2. extract_code_section で部分読取
|
|
222
|
+
3. 必要に応じて複数回に分割
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### 7. 言語別最適化
|
|
226
|
+
|
|
227
|
+
#### 7.1 Python
|
|
228
|
+
- クラス・関数定義: `query_code`で効率的抽出
|
|
229
|
+
- インポート解析: `search_content`でパターン検索
|
|
230
|
+
|
|
231
|
+
#### 7.2 JavaScript/TypeScript
|
|
232
|
+
- コンポーネント構造: `analyze_code_structure`で全体把握
|
|
233
|
+
- 型定義: `query_code`で型情報抽出
|
|
234
|
+
|
|
235
|
+
#### 7.3 Java
|
|
236
|
+
- パッケージ構造: `list_files`で階層確認
|
|
237
|
+
- クラス関係: `analyze_code_structure`で依存関係把握
|
|
238
|
+
|
|
239
|
+
### 8. 禁止事項
|
|
240
|
+
|
|
241
|
+
#### 8.1 非効率なパターン
|
|
242
|
+
- 大きなファイルでの`read_file`直接使用
|
|
243
|
+
- `suppress_output: false`での大量データ取得
|
|
244
|
+
- 不必要な`format_type: full`使用
|
|
245
|
+
|
|
246
|
+
#### 8.2 セキュリティ違反
|
|
247
|
+
- プロジェクトルート外へのアクセス試行
|
|
248
|
+
- 過度なリソース消費(無制限検索等)
|
|
249
|
+
|
|
250
|
+
#### 8.3 トークン爆発を引き起こす危険なパターン
|
|
251
|
+
- **汎用的な日本語単語での無制限検索**
|
|
252
|
+
```markdown
|
|
253
|
+
# 危険な例: 「項目名」「データ」「処理」「画面」等の汎用語
|
|
254
|
+
query: "項目名"
|
|
255
|
+
context_before: 3
|
|
256
|
+
context_after: 3
|
|
257
|
+
# → 大量のマッチと膨大なコンテキスト出力でトークン爆発
|
|
258
|
+
```
|
|
259
|
+
- **コンテキスト行指定での大量マッチ検索**
|
|
260
|
+
- **出力制限なしでの広範囲検索**
|
|
261
|
+
|
|
262
|
+
### 9. ベストプラクティス
|
|
263
|
+
|
|
264
|
+
#### 9.1 効率的なワークフロー
|
|
265
|
+
1. **計画**: 必要な情報を明確化
|
|
266
|
+
2. **概要**: `analyze_code_structure`で全体把握
|
|
267
|
+
3. **詳細**: 必要な部分のみ`extract_code_section`
|
|
268
|
+
4. **検索**: `search_content`で関連コード発見
|
|
269
|
+
5. **実装**: 段階的な変更適用
|
|
270
|
+
|
|
271
|
+
#### 9.2 トークン節約
|
|
272
|
+
- `suppress_output: true`の積極活用
|
|
273
|
+
- `summary_only: true`での概要確認
|
|
274
|
+
- 適切な`format_type`選択
|
|
275
|
+
|
|
276
|
+
#### 9.3 品質保証
|
|
277
|
+
- 変更前の構造解析保存
|
|
278
|
+
- 影響範囲の事前確認
|
|
279
|
+
- 段階的テスト実行
|
|
280
|
+
|
|
281
|
+
### 10. 実用的な使用例
|
|
282
|
+
|
|
283
|
+
#### 10.1 大規模プロジェクトの初期調査
|
|
284
|
+
```markdown
|
|
285
|
+
# ステップ1: プロジェクト全体のファイル構造把握
|
|
286
|
+
use_mcp_tool:
|
|
287
|
+
server_name: tree-sitter-analyzer
|
|
288
|
+
tool_name: list_files
|
|
289
|
+
arguments:
|
|
290
|
+
roots: ["."]
|
|
291
|
+
extensions: ["py", "js", "ts", "java"]
|
|
292
|
+
types: ["f"]
|
|
293
|
+
limit: 100
|
|
294
|
+
|
|
295
|
+
# ステップ2: 主要ファイルの構造解析(トークン節約)
|
|
296
|
+
use_mcp_tool:
|
|
297
|
+
server_name: tree-sitter-analyzer
|
|
298
|
+
tool_name: analyze_code_structure
|
|
299
|
+
arguments:
|
|
300
|
+
file_path: "src/main.py"
|
|
301
|
+
format_type: "compact"
|
|
302
|
+
suppress_output: true
|
|
303
|
+
output_file: "main_structure.md"
|
|
304
|
+
|
|
305
|
+
# ステップ3: 生成されたファイルを読取
|
|
306
|
+
read_file:
|
|
307
|
+
path: "main_structure.md"
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
#### 10.2 特定機能の実装場所特定
|
|
311
|
+
```markdown
|
|
312
|
+
# ステップ1: 関数名で検索
|
|
313
|
+
use_mcp_tool:
|
|
314
|
+
server_name: tree-sitter-analyzer
|
|
315
|
+
tool_name: search_content
|
|
316
|
+
arguments:
|
|
317
|
+
roots: ["src"]
|
|
318
|
+
query: "def process_data|function processData|processData\\s*\\("
|
|
319
|
+
case: "insensitive"
|
|
320
|
+
summary_only: true
|
|
321
|
+
|
|
322
|
+
# ステップ2: 該当ファイルの詳細解析
|
|
323
|
+
use_mcp_tool:
|
|
324
|
+
server_name: tree-sitter-analyzer
|
|
325
|
+
tool_name: query_code
|
|
326
|
+
arguments:
|
|
327
|
+
file_path: "src/data_processor.py"
|
|
328
|
+
query_key: "functions"
|
|
329
|
+
filter: "name=~process*"
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
#### 10.3 バグ修正のための影響範囲調査
|
|
333
|
+
```markdown
|
|
334
|
+
# ステップ1: 問題のある関数を特定(トークン節約版)
|
|
335
|
+
use_mcp_tool:
|
|
336
|
+
server_name: tree-sitter-analyzer
|
|
337
|
+
tool_name: find_and_grep
|
|
338
|
+
arguments:
|
|
339
|
+
roots: ["src"]
|
|
340
|
+
extensions: ["py"]
|
|
341
|
+
query: "calculate_total"
|
|
342
|
+
context_before: 3
|
|
343
|
+
context_after: 3
|
|
344
|
+
suppress_output: true
|
|
345
|
+
output_file: "bug_analysis.json"
|
|
346
|
+
|
|
347
|
+
# ステップ2: 依存関係の調査(トークン節約版)
|
|
348
|
+
use_mcp_tool:
|
|
349
|
+
server_name: tree-sitter-analyzer
|
|
350
|
+
tool_name: search_content
|
|
351
|
+
arguments:
|
|
352
|
+
roots: ["src", "tests"]
|
|
353
|
+
query: "import.*calculate_total|from.*calculate_total"
|
|
354
|
+
group_by_file: true
|
|
355
|
+
suppress_output: true
|
|
356
|
+
output_file: "dependency_analysis.json"
|
|
357
|
+
|
|
358
|
+
# ステップ3: 保存された結果を読取
|
|
359
|
+
read_file:
|
|
360
|
+
path: "bug_analysis.json"
|
|
361
|
+
read_file:
|
|
362
|
+
path: "dependency_analysis.json"
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### 10.4 コードレビュー準備
|
|
366
|
+
```markdown
|
|
367
|
+
# ステップ1: 変更されたファイルの構造確認
|
|
368
|
+
use_mcp_tool:
|
|
369
|
+
server_name: tree-sitter-analyzer
|
|
370
|
+
tool_name: analyze_code_structure
|
|
371
|
+
arguments:
|
|
372
|
+
file_path: "src/updated_module.py"
|
|
373
|
+
format_type: "full"
|
|
374
|
+
output_file: "review_structure.json"
|
|
375
|
+
suppress_output: true
|
|
376
|
+
|
|
377
|
+
# ステップ2: 複雑度の高いメソッド特定
|
|
378
|
+
use_mcp_tool:
|
|
379
|
+
server_name: tree-sitter-analyzer
|
|
380
|
+
tool_name: check_code_scale
|
|
381
|
+
arguments:
|
|
382
|
+
file_path: "src/updated_module.py"
|
|
383
|
+
```
|
|
384
|
+
|
|
385
|
+
### 11. 高度なテクニック
|
|
386
|
+
|
|
387
|
+
#### 11.1 条件付きファイル処理
|
|
388
|
+
```markdown
|
|
389
|
+
# 大きなファイルかどうかを事前チェック
|
|
390
|
+
use_mcp_tool:
|
|
391
|
+
server_name: tree-sitter-analyzer
|
|
392
|
+
tool_name: check_code_scale
|
|
393
|
+
arguments:
|
|
394
|
+
file_path: "large_file.py"
|
|
395
|
+
|
|
396
|
+
# 結果に基づいて処理方法を選択
|
|
397
|
+
# - 小さい場合: analyze_code_structure (full)
|
|
398
|
+
# - 大きい場合: analyze_code_structure (suppress_output: true)
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
#### 11.2 段階的コード読取
|
|
402
|
+
```markdown
|
|
403
|
+
# ステップ1: 概要把握
|
|
404
|
+
use_mcp_tool:
|
|
405
|
+
server_name: tree-sitter-analyzer
|
|
406
|
+
tool_name: analyze_code_structure
|
|
407
|
+
arguments:
|
|
408
|
+
file_path: "complex_module.py"
|
|
409
|
+
format_type: "compact"
|
|
410
|
+
|
|
411
|
+
# ステップ2: 興味のある部分の詳細取得
|
|
412
|
+
use_mcp_tool:
|
|
413
|
+
server_name: tree-sitter-analyzer
|
|
414
|
+
tool_name: extract_code_section
|
|
415
|
+
arguments:
|
|
416
|
+
file_path: "complex_module.py"
|
|
417
|
+
start_line: 45
|
|
418
|
+
end_line: 80
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
#### 11.3 パフォーマンス最適化検索
|
|
422
|
+
```markdown
|
|
423
|
+
# 大量の結果が予想される場合
|
|
424
|
+
use_mcp_tool:
|
|
425
|
+
server_name: tree-sitter-analyzer
|
|
426
|
+
tool_name: search_content
|
|
427
|
+
arguments:
|
|
428
|
+
roots: ["src"]
|
|
429
|
+
query: "TODO|FIXME|BUG"
|
|
430
|
+
total_only: true # カウントのみ取得
|
|
431
|
+
|
|
432
|
+
# 必要に応じて詳細取得(トークン節約版)
|
|
433
|
+
use_mcp_tool:
|
|
434
|
+
server_name: tree-sitter-analyzer
|
|
435
|
+
tool_name: search_content
|
|
436
|
+
arguments:
|
|
437
|
+
roots: ["src"]
|
|
438
|
+
query: "TODO|FIXME|BUG"
|
|
439
|
+
max_count: 10
|
|
440
|
+
summary_only: true
|
|
441
|
+
suppress_output: true
|
|
442
|
+
output_file: "todo_analysis.json"
|
|
443
|
+
|
|
444
|
+
# または find_and_grep での複合検索(トークン節約版)
|
|
445
|
+
use_mcp_tool:
|
|
446
|
+
server_name: tree-sitter-analyzer
|
|
447
|
+
tool_name: find_and_grep
|
|
448
|
+
arguments:
|
|
449
|
+
roots: ["src"]
|
|
450
|
+
extensions: ["py", "js", "java"]
|
|
451
|
+
query: "TODO|FIXME|BUG"
|
|
452
|
+
max_count: 20
|
|
453
|
+
group_by_file: true
|
|
454
|
+
suppress_output: true
|
|
455
|
+
output_file: "comprehensive_todo.json"
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### 12. トラブルシューティング
|
|
459
|
+
|
|
460
|
+
#### 12.1 メモリ不足対策
|
|
461
|
+
```markdown
|
|
462
|
+
# 問題: 大きなファイルでメモリ不足
|
|
463
|
+
# 解決策1: suppress_output使用
|
|
464
|
+
suppress_output: true
|
|
465
|
+
output_file: "temp_analysis.md"
|
|
466
|
+
|
|
467
|
+
# 解決策2: 部分読取
|
|
468
|
+
extract_code_section:
|
|
469
|
+
start_line: 1
|
|
470
|
+
end_line: 100
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
#### 12.2 検索結果が多すぎる場合
|
|
474
|
+
```markdown
|
|
475
|
+
# 問題: 検索結果が膨大
|
|
476
|
+
# 解決策1: summary_only使用
|
|
477
|
+
summary_only: true
|
|
478
|
+
|
|
479
|
+
# 解決策2: ファイル種別制限
|
|
480
|
+
include_globs: ["*.py"]
|
|
481
|
+
exclude_globs: ["*test*", "*__pycache__*"]
|
|
482
|
+
|
|
483
|
+
# 解決策3: 結果数制限
|
|
484
|
+
max_count: 20
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
#### 12.3 言語検出失敗
|
|
488
|
+
```markdown
|
|
489
|
+
# 問題: ファイル形式が正しく認識されない
|
|
490
|
+
# 解決策: 明示的に言語指定
|
|
491
|
+
language: "python"
|
|
492
|
+
# または
|
|
493
|
+
language: "javascript"
|
|
494
|
+
```
|
|
495
|
+
|
|
496
|
+
### 13. 統合ワークフロー例
|
|
497
|
+
|
|
498
|
+
#### 13.1 新機能開発フロー
|
|
499
|
+
```markdown
|
|
500
|
+
1. 要件分析
|
|
501
|
+
- search_content で類似機能検索
|
|
502
|
+
- analyze_code_structure で既存構造把握
|
|
503
|
+
|
|
504
|
+
2. 設計
|
|
505
|
+
- query_code で関連クラス・関数抽出
|
|
506
|
+
- find_and_grep でパターン調査
|
|
507
|
+
|
|
508
|
+
3. 実装
|
|
509
|
+
- extract_code_section で参考コード取得
|
|
510
|
+
- 段階的な実装とテスト
|
|
511
|
+
|
|
512
|
+
4. テスト
|
|
513
|
+
- search_content でテストパターン検索
|
|
514
|
+
- analyze_code_structure で新コード検証
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
#### 13.2 リファクタリングフロー
|
|
518
|
+
```markdown
|
|
519
|
+
1. 現状分析
|
|
520
|
+
- analyze_code_structure で全体構造把握
|
|
521
|
+
- check_code_scale で複雑度確認
|
|
522
|
+
|
|
523
|
+
2. 影響範囲調査
|
|
524
|
+
- search_content で依存関係特定
|
|
525
|
+
- find_and_grep で使用箇所検索
|
|
526
|
+
|
|
527
|
+
3. 段階的変更
|
|
528
|
+
- extract_code_section で詳細確認
|
|
529
|
+
- 小さな単位での変更実装
|
|
530
|
+
|
|
531
|
+
4. 検証
|
|
532
|
+
- analyze_code_structure で変更後構造確認
|
|
533
|
+
- search_content で残存問題検索
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### 14. 日本語検索でのトークン爆発対策
|
|
537
|
+
|
|
538
|
+
#### 14.1 危険な汎用語リスト
|
|
539
|
+
以下の日本語単語は大量マッチを引き起こしやすく、注意が必要:
|
|
540
|
+
- **UI関連**: 「項目名」「画面」「ボタン」「フィールド」「入力」
|
|
541
|
+
- **データ関連**: 「データ」「情報」「値」「内容」「結果」
|
|
542
|
+
- **処理関連**: 「処理」「実行」「呼び出し」「取得」「設定」
|
|
543
|
+
- **汎用語**: 「名前」「ID」「番号」「コード」「種類」
|
|
544
|
+
|
|
545
|
+
#### 14.2 安全な検索戦略
|
|
546
|
+
|
|
547
|
+
##### 14.2.1 段階的検索アプローチ
|
|
548
|
+
```markdown
|
|
549
|
+
# ステップ1: 影響範囲の事前確認
|
|
550
|
+
use_mcp_tool:
|
|
551
|
+
server_name: tree-sitter-analyzer
|
|
552
|
+
tool_name: search_content
|
|
553
|
+
arguments:
|
|
554
|
+
roots: ["src"]
|
|
555
|
+
query: "項目名"
|
|
556
|
+
total_only: true
|
|
557
|
+
|
|
558
|
+
# ステップ2: 結果数に応じた対応
|
|
559
|
+
# - 10件以下: 通常検索
|
|
560
|
+
# - 11-50件: summary_only + max_count制限
|
|
561
|
+
# - 51件以上: より具体的な検索条件に変更
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
##### 14.2.2 検索条件の具体化
|
|
565
|
+
```markdown
|
|
566
|
+
# 危険: 汎用的すぎる検索
|
|
567
|
+
query: "項目名"
|
|
568
|
+
|
|
569
|
+
# 安全: より具体的な検索
|
|
570
|
+
query: "項目名.*設定|項目名.*取得|setItemName|getItemName"
|
|
571
|
+
# または特定のコンテキストに限定
|
|
572
|
+
query: "class.*項目名|function.*項目名|def.*項目名"
|
|
573
|
+
```
|
|
574
|
+
|
|
575
|
+
##### 14.2.3 ファイル種別による制限
|
|
576
|
+
```markdown
|
|
577
|
+
# 危険: 全ファイル対象
|
|
578
|
+
roots: ["src"]
|
|
579
|
+
|
|
580
|
+
# 安全: ファイル種別を限定
|
|
581
|
+
include_globs: ["*.java", "*.py"]
|
|
582
|
+
exclude_globs: ["*.log", "*.txt", "*.md", "*test*"]
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
#### 14.3 トークン効率化テクニック
|
|
586
|
+
|
|
587
|
+
##### 14.3.1 出力制限の組み合わせ
|
|
588
|
+
```markdown
|
|
589
|
+
# 最も安全なパターン
|
|
590
|
+
use_mcp_tool:
|
|
591
|
+
server_name: tree-sitter-analyzer
|
|
592
|
+
tool_name: search_content
|
|
593
|
+
arguments:
|
|
594
|
+
roots: ["src"]
|
|
595
|
+
query: "項目名"
|
|
596
|
+
case: "insensitive"
|
|
597
|
+
max_count: 15 # 結果数制限
|
|
598
|
+
summary_only: true # 概要のみ
|
|
599
|
+
group_by_file: true # ファイル別グループ化
|
|
600
|
+
include_globs: ["*.java", "*.py"] # ファイル種別制限
|
|
601
|
+
# context_before/afterは指定しない
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
##### 14.3.2 段階的詳細化
|
|
605
|
+
```markdown
|
|
606
|
+
# ステップ1: 概要把握(トークン節約版)
|
|
607
|
+
use_mcp_tool:
|
|
608
|
+
server_name: tree-sitter-analyzer
|
|
609
|
+
tool_name: search_content
|
|
610
|
+
arguments:
|
|
611
|
+
roots: ["src"]
|
|
612
|
+
query: "項目名"
|
|
613
|
+
summary_only: true
|
|
614
|
+
max_count: 20
|
|
615
|
+
suppress_output: true
|
|
616
|
+
output_file: "overview_search.json"
|
|
617
|
+
|
|
618
|
+
# ステップ2: 特定ファイルの詳細確認(必要な場合のみ)
|
|
619
|
+
use_mcp_tool:
|
|
620
|
+
server_name: tree-sitter-analyzer
|
|
621
|
+
tool_name: search_content
|
|
622
|
+
arguments:
|
|
623
|
+
files: ["src/specific_file.java"] # 特定ファイルのみ
|
|
624
|
+
query: "項目名"
|
|
625
|
+
context_before: 2
|
|
626
|
+
context_after: 2
|
|
627
|
+
max_count: 5
|
|
628
|
+
suppress_output: true
|
|
629
|
+
output_file: "detailed_search.json"
|
|
630
|
+
|
|
631
|
+
# ステップ3: 保存された結果を読取
|
|
632
|
+
read_file:
|
|
633
|
+
path: "overview_search.json"
|
|
634
|
+
read_file:
|
|
635
|
+
path: "detailed_search.json"
|
|
636
|
+
```
|
|
637
|
+
|
|
638
|
+
#### 14.4 実践的な対策例
|
|
639
|
+
|
|
640
|
+
##### 14.4.1 UI関連の調査
|
|
641
|
+
```markdown
|
|
642
|
+
# 危険なパターン
|
|
643
|
+
query: "画面"
|
|
644
|
+
context_before: 3
|
|
645
|
+
context_after: 3
|
|
646
|
+
|
|
647
|
+
# 安全なパターン
|
|
648
|
+
query: "画面.*ID|ScreenId|screen_id|画面クラス"
|
|
649
|
+
max_count: 20
|
|
650
|
+
summary_only: true
|
|
651
|
+
include_globs: ["*.java", "*.js", "*.vue"]
|
|
652
|
+
```
|
|
653
|
+
|
|
654
|
+
##### 14.4.2 データ処理の調査
|
|
655
|
+
```markdown
|
|
656
|
+
# 危険なパターン
|
|
657
|
+
query: "データ"
|
|
658
|
+
|
|
659
|
+
# 安全なパターン
|
|
660
|
+
query: "データ.*処理|DataProcessor|data_handler|データベース"
|
|
661
|
+
total_only: true # まずカウントのみ確認
|
|
662
|
+
```
|
|
663
|
+
|
|
664
|
+
##### 14.4.3 機能特定の調査
|
|
665
|
+
```markdown
|
|
666
|
+
# 危険なパターン
|
|
667
|
+
query: "処理"
|
|
668
|
+
context_before: 5
|
|
669
|
+
context_after: 5
|
|
670
|
+
|
|
671
|
+
# 安全なパターン
|
|
672
|
+
# ステップ1: 特定の処理パターンに絞り込み
|
|
673
|
+
query: "処理.*メソッド|process.*function|def.*process"
|
|
674
|
+
summary_only: true
|
|
675
|
+
|
|
676
|
+
# ステップ2: 必要に応じて特定ファイルの詳細確認
|
|
677
|
+
```
|
|
678
|
+
|
|
679
|
+
#### 14.5 緊急時の対処法
|
|
680
|
+
|
|
681
|
+
##### 14.5.1 トークン爆発が発生した場合
|
|
682
|
+
1. **即座に検索を中止**(可能な場合)
|
|
683
|
+
2. **より具体的な検索条件に変更**
|
|
684
|
+
3. **`total_only: true`で影響範囲を事前確認**
|
|
685
|
+
4. **段階的に詳細化**
|
|
686
|
+
|
|
687
|
+
##### 14.5.2 代替アプローチ
|
|
688
|
+
```markdown
|
|
689
|
+
# 汎用語での検索が必要な場合の代替手法
|
|
690
|
+
# 1. ファイル一覧から対象を絞り込み
|
|
691
|
+
use_mcp_tool:
|
|
692
|
+
server_name: tree-sitter-analyzer
|
|
693
|
+
tool_name: list_files
|
|
694
|
+
arguments:
|
|
695
|
+
roots: ["src"]
|
|
696
|
+
pattern: "*Item*|*項目*"
|
|
697
|
+
glob: true
|
|
698
|
+
|
|
699
|
+
# 2. 特定ファイルでの詳細検索
|
|
700
|
+
# 3. query_codeでの構造的検索
|
|
701
|
+
```
|
|
702
|
+
|
|
703
|
+
#### 14.6 予防策チェックリスト
|
|
704
|
+
|
|
705
|
+
検索実行前の確認事項:
|
|
706
|
+
- [ ] 検索語が汎用的すぎないか?
|
|
707
|
+
- [ ] `total_only: true`で事前確認したか?
|
|
708
|
+
- [ ] ファイル種別を適切に制限したか?
|
|
709
|
+
- [ ] `max_count`で結果数を制限したか?
|
|
710
|
+
- [ ] `context_before/after`は本当に必要か?
|
|
711
|
+
- [ ] `summary_only`で十分ではないか?
|
|
712
|
+
|
|
713
|
+
### 15. 新機能: 検索ツールでのファイル出力最適化
|
|
714
|
+
|
|
715
|
+
#### 15.1 対応ツール
|
|
716
|
+
- [`find_and_grep`](tree_sitter_analyzer/mcp/tools/find_and_grep_tool.py): ファイル検索 + コンテンツ検索の2段階検索
|
|
717
|
+
- [`search_content`](tree_sitter_analyzer/mcp/tools/search_content_tool.py): コンテンツ検索
|
|
718
|
+
|
|
719
|
+
#### 15.2 新パラメータ
|
|
720
|
+
- `output_file`: 結果をファイルに保存(拡張子自動検出)
|
|
721
|
+
- `suppress_output`: `output_file`指定時に詳細出力を抑制してトークン節約
|
|
722
|
+
|
|
723
|
+
#### 15.3 推奨使用パターン
|
|
724
|
+
|
|
725
|
+
##### 15.3.1 大量検索結果の処理
|
|
726
|
+
```markdown
|
|
727
|
+
# 従来の問題: 大量の検索結果でトークン爆発
|
|
728
|
+
use_mcp_tool:
|
|
729
|
+
server_name: tree-sitter-analyzer
|
|
730
|
+
tool_name: find_and_grep
|
|
731
|
+
arguments:
|
|
732
|
+
roots: ["."]
|
|
733
|
+
pattern: "*HQBFS060*"
|
|
734
|
+
query: "局署名|lblKyokushoName"
|
|
735
|
+
# → 大量の出力でトークン消費
|
|
736
|
+
|
|
737
|
+
# 新しい解決策: ファイル出力でトークン節約
|
|
738
|
+
use_mcp_tool:
|
|
739
|
+
server_name: tree-sitter-analyzer
|
|
740
|
+
tool_name: find_and_grep
|
|
741
|
+
arguments:
|
|
742
|
+
roots: ["."]
|
|
743
|
+
pattern: "*HQBFS060*"
|
|
744
|
+
query: "局署名|lblKyokushoName"
|
|
745
|
+
case: "insensitive"
|
|
746
|
+
group_by_file: true
|
|
747
|
+
suppress_output: true
|
|
748
|
+
output_file: "search_results.json"
|
|
749
|
+
|
|
750
|
+
# 後で詳細を確認
|
|
751
|
+
read_file:
|
|
752
|
+
path: "search_results.json"
|
|
753
|
+
```
|
|
754
|
+
|
|
755
|
+
##### 15.3.2 段階的検索戦略
|
|
756
|
+
```markdown
|
|
757
|
+
# ステップ1: 概要確認(トークン節約)
|
|
758
|
+
use_mcp_tool:
|
|
759
|
+
server_name: tree-sitter-analyzer
|
|
760
|
+
tool_name: search_content
|
|
761
|
+
arguments:
|
|
762
|
+
roots: ["src"]
|
|
763
|
+
query: "特定の機能名"
|
|
764
|
+
summary_only: true
|
|
765
|
+
suppress_output: true
|
|
766
|
+
output_file: "phase1_overview.json"
|
|
767
|
+
|
|
768
|
+
# ステップ2: 詳細検索(必要な場合のみ)
|
|
769
|
+
use_mcp_tool:
|
|
770
|
+
server_name: tree-sitter-analyzer
|
|
771
|
+
tool_name: find_and_grep
|
|
772
|
+
arguments:
|
|
773
|
+
roots: ["src"]
|
|
774
|
+
extensions: ["java", "html", "js"]
|
|
775
|
+
query: "特定の機能名"
|
|
776
|
+
context_before: 3
|
|
777
|
+
context_after: 3
|
|
778
|
+
suppress_output: true
|
|
779
|
+
output_file: "phase2_detailed.json"
|
|
780
|
+
|
|
781
|
+
# ステップ3: 結果の段階的確認
|
|
782
|
+
read_file:
|
|
783
|
+
path: "phase1_overview.json"
|
|
784
|
+
# 必要に応じて詳細も確認
|
|
785
|
+
read_file:
|
|
786
|
+
path: "phase2_detailed.json"
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
#### 15.4 ファイル形式の自動選択
|
|
790
|
+
- JSON形式: 構造化データとして保存、プログラム処理に適している
|
|
791
|
+
- Markdown形式: 人間が読みやすい形式、ドキュメント化に適している
|
|
792
|
+
- 拡張子は内容に基づいて自動決定
|
|
793
|
+
|
|
794
|
+
#### 15.5 既存オプションとの組み合わせ
|
|
795
|
+
```markdown
|
|
796
|
+
# 最適化された検索パターン
|
|
797
|
+
use_mcp_tool:
|
|
798
|
+
server_name: tree-sitter-analyzer
|
|
799
|
+
tool_name: find_and_grep
|
|
800
|
+
arguments:
|
|
801
|
+
roots: ["src"]
|
|
802
|
+
pattern: "*Controller*"
|
|
803
|
+
glob: true
|
|
804
|
+
types: ["f"]
|
|
805
|
+
extensions: ["java"]
|
|
806
|
+
query: "特定のメソッド名"
|
|
807
|
+
case: "insensitive"
|
|
808
|
+
max_count: 50
|
|
809
|
+
group_by_file: true
|
|
810
|
+
summary_only: true # 概要のみ
|
|
811
|
+
suppress_output: true # 出力抑制
|
|
812
|
+
output_file: "controller_analysis.json" # ファイル保存
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
## まとめ
|
|
816
|
+
|
|
817
|
+
ROOはtree-sitter-analyzer MCPツールを最大限活用し、効率的で安全なコード解析・編集を実現する。標準ツールよりもMCPツールを優先し、トークン効率化と構造化された解析を重視する。
|
|
818
|
+
|
|
819
|
+
**重要な原則**:
|
|
820
|
+
1. **コードファイル読取**: 必ずMCPツールを使用
|
|
821
|
+
2. **トークン節約**: `suppress_output: true` + `output_file`の活用
|
|
822
|
+
3. **段階的アプローチ**: 概要→詳細の順序で情報取得
|
|
823
|
+
4. **適切なツール選択**: 目的に応じた最適なMCPツール使用
|
|
824
|
+
5. **セキュリティ重視**: プロジェクト境界内での安全な操作
|
|
825
|
+
6. **日本語検索対策**: 汎用語での無制限検索を避け、段階的アプローチを採用
|
|
826
|
+
7. **NEW: 検索最適化**: `find_and_grep`と`search_content`でのファイル出力機能活用
|