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

Files changed (38) hide show
  1. tree_sitter_analyzer/__init__.py +1 -3
  2. tree_sitter_analyzer/__main__.py +2 -2
  3. tree_sitter_analyzer/cli/commands/default_command.py +1 -1
  4. tree_sitter_analyzer/cli/commands/query_command.py +5 -5
  5. tree_sitter_analyzer/cli/commands/table_command.py +3 -3
  6. tree_sitter_analyzer/cli/info_commands.py +14 -13
  7. tree_sitter_analyzer/cli_main.py +49 -30
  8. tree_sitter_analyzer/core/analysis_engine.py +21 -21
  9. tree_sitter_analyzer/core/cache_service.py +31 -31
  10. tree_sitter_analyzer/core/query.py +502 -502
  11. tree_sitter_analyzer/encoding_utils.py +5 -2
  12. tree_sitter_analyzer/file_handler.py +3 -3
  13. tree_sitter_analyzer/formatters/base_formatter.py +18 -18
  14. tree_sitter_analyzer/formatters/formatter_factory.py +15 -15
  15. tree_sitter_analyzer/formatters/java_formatter.py +291 -291
  16. tree_sitter_analyzer/formatters/python_formatter.py +259 -259
  17. tree_sitter_analyzer/interfaces/cli_adapter.py +32 -32
  18. tree_sitter_analyzer/interfaces/mcp_adapter.py +2 -2
  19. tree_sitter_analyzer/language_detector.py +398 -398
  20. tree_sitter_analyzer/language_loader.py +224 -224
  21. tree_sitter_analyzer/languages/java_plugin.py +1174 -1174
  22. tree_sitter_analyzer/languages/python_plugin.py +10 -2
  23. tree_sitter_analyzer/mcp/resources/project_stats_resource.py +555 -555
  24. tree_sitter_analyzer/models.py +470 -470
  25. tree_sitter_analyzer/output_manager.py +8 -10
  26. tree_sitter_analyzer/plugins/base.py +33 -0
  27. tree_sitter_analyzer/queries/java.py +78 -78
  28. tree_sitter_analyzer/queries/javascript.py +7 -7
  29. tree_sitter_analyzer/queries/python.py +18 -18
  30. tree_sitter_analyzer/queries/typescript.py +12 -12
  31. tree_sitter_analyzer/query_loader.py +13 -13
  32. tree_sitter_analyzer/table_formatter.py +20 -18
  33. tree_sitter_analyzer/utils.py +1 -1
  34. {tree_sitter_analyzer-0.4.0.dist-info → tree_sitter_analyzer-0.6.1.dist-info}/METADATA +10 -10
  35. {tree_sitter_analyzer-0.4.0.dist-info → tree_sitter_analyzer-0.6.1.dist-info}/RECORD +37 -38
  36. tree_sitter_analyzer/java_analyzer.py +0 -187
  37. {tree_sitter_analyzer-0.4.0.dist-info → tree_sitter_analyzer-0.6.1.dist-info}/WHEEL +0 -0
  38. {tree_sitter_analyzer-0.4.0.dist-info → tree_sitter_analyzer-0.6.1.dist-info}/entry_points.txt +0 -0
@@ -86,22 +86,22 @@ class OutputManager:
86
86
  f"\n{index}. {result.get('capture_name', 'Unknown')} ({result.get('node_type', 'Unknown')})"
87
87
  )
88
88
  print(
89
- f" 位置: {result.get('start_line', '?')}-{result.get('end_line', '?')}"
89
+ f" Position: Line {result.get('start_line', '?')}-{result.get('end_line', '?')}"
90
90
  )
91
91
  if "content" in result:
92
- print(f" 内容:\n{result['content']}")
92
+ print(f" Content:\n{result['content']}")
93
93
 
94
94
  def analysis_summary(self, stats: dict[str, Any]) -> None:
95
95
  """Output analysis summary"""
96
96
  if self.json_output:
97
97
  self.data(stats)
98
98
  else:
99
- self.results_header("統計情報")
99
+ self.results_header("Statistics")
100
100
  for key, value in stats.items():
101
101
  print(f"{key}: {value}")
102
102
 
103
103
  def language_list(
104
- self, languages: list[str], title: str = "サポートされている言語"
104
+ self, languages: list[str], title: str = "Supported Languages"
105
105
  ) -> None:
106
106
  """Output language list"""
107
107
  if not self.quiet:
@@ -112,18 +112,18 @@ class OutputManager:
112
112
  def query_list(self, queries: dict[str, str], language: str) -> None:
113
113
  """Output query list for a language"""
114
114
  if not self.quiet:
115
- print(f"利用可能なクエリキー ({language}):")
115
+ print(f"Available query keys ({language}):")
116
116
  for query_key, description in queries.items():
117
117
  print(f" {query_key:<20} - {description}")
118
118
 
119
119
  def extension_list(self, extensions: list[str]) -> None:
120
120
  """Output supported extensions"""
121
121
  if not self.quiet:
122
- print("サポートされている拡張子:")
122
+ print("Supported file extensions:")
123
123
  for i in range(0, len(extensions), 10):
124
124
  chunk = extensions[i : i + 10]
125
125
  print(f" {' '.join(chunk)}")
126
- print(f"合計 {len(extensions)} 個の拡張子をサポート")
126
+ print(f"Total {len(extensions)} extensions supported")
127
127
 
128
128
  def output_json(self, data: Any) -> None:
129
129
  """Output JSON data"""
@@ -232,9 +232,7 @@ def output_statistics(stats: dict[str, Any]) -> None:
232
232
  _output_manager.output_statistics(stats)
233
233
 
234
234
 
235
- def output_languages(
236
- languages: list[str], title: str = "サポートされている言語"
237
- ) -> None:
235
+ def output_languages(languages: list[str], title: str = "Supported Languages") -> None:
238
236
  """Output available languages"""
239
237
  _output_manager.language_list(languages, title)
240
238
 
@@ -494,3 +494,36 @@ class DefaultLanguagePlugin(LanguagePlugin):
494
494
 
495
495
  def create_extractor(self) -> ElementExtractor:
496
496
  return DefaultExtractor()
497
+
498
+ async def analyze_file(
499
+ self, file_path: str, request: "AnalysisRequest"
500
+ ) -> "AnalysisResult":
501
+ """
502
+ Analyze a file using the default extractor.
503
+
504
+ Args:
505
+ file_path: Path to the file to analyze
506
+ request: Analysis request with configuration
507
+
508
+ Returns:
509
+ AnalysisResult containing extracted information
510
+ """
511
+ from ..core.analysis_engine import UnifiedAnalysisEngine
512
+ from ..models import AnalysisResult
513
+
514
+ try:
515
+ engine = UnifiedAnalysisEngine()
516
+ return await engine.analyze_file(file_path)
517
+ except Exception as e:
518
+ log_error(f"Failed to analyze file {file_path}: {e}")
519
+ return AnalysisResult(
520
+ file_path=file_path,
521
+ language=self.get_language_name(),
522
+ line_count=0,
523
+ elements=[],
524
+ node_count=0,
525
+ query_results={},
526
+ source_code="",
527
+ success=False,
528
+ error_message=str(e),
529
+ )
@@ -6,9 +6,9 @@ Tree-sitter queries specific to Java language constructs.
6
6
  Covers classes, methods, annotations, imports, and other Java-specific elements.
7
7
  """
8
8
 
9
- # Java専用クエリライブラリ
9
+ # Java-specific query library
10
10
  JAVA_QUERIES: dict[str, str] = {
11
- # --- 基本構造 ---
11
+ # --- Basic Structure ---
12
12
  "class": """
13
13
  (class_declaration) @class
14
14
  """,
@@ -21,7 +21,7 @@ JAVA_QUERIES: dict[str, str] = {
21
21
  "annotation_type": """
22
22
  (annotation_type_declaration) @annotation_type
23
23
  """,
24
- # --- メソッドと構築子 ---
24
+ # --- Methods and Constructors ---
25
25
  "method": """
26
26
  (method_declaration) @method
27
27
  """,
@@ -33,7 +33,7 @@ JAVA_QUERIES: dict[str, str] = {
33
33
  (modifiers) @mod
34
34
  (#match? @mod "abstract")) @abstract_method
35
35
  """,
36
- # --- フィールドと変数 ---
36
+ # --- Fields and Variables ---
37
37
  "field": """
38
38
  (field_declaration) @field
39
39
  """,
@@ -47,7 +47,7 @@ JAVA_QUERIES: dict[str, str] = {
47
47
  (modifiers) @mod
48
48
  (#match? @mod "final")) @final_field
49
49
  """,
50
- # --- インポートとパッケージ ---
50
+ # --- Imports and Packages ---
51
51
  "import": """
52
52
  (import_declaration) @import
53
53
  """,
@@ -58,7 +58,7 @@ JAVA_QUERIES: dict[str, str] = {
58
58
  "package": """
59
59
  (package_declaration) @package
60
60
  """,
61
- # --- アノテーション ---
61
+ # --- Annotations ---
62
62
  "annotation": """
63
63
  (annotation) @annotation
64
64
  """,
@@ -69,7 +69,7 @@ JAVA_QUERIES: dict[str, str] = {
69
69
  (annotation
70
70
  (annotation_argument_list)) @annotation_with_params
71
71
  """,
72
- # --- Java特有のコンストラクト ---
72
+ # --- Java-specific Constructs ---
73
73
  "lambda": """
74
74
  (lambda_expression) @lambda
75
75
  """,
@@ -82,7 +82,7 @@ JAVA_QUERIES: dict[str, str] = {
82
82
  "generic_type": """
83
83
  (generic_type) @generic_type
84
84
  """,
85
- # --- 名前のみ抽出 ---
85
+ # --- Name-only Extraction ---
86
86
  "class_name": """
87
87
  (class_declaration
88
88
  name: (identifier) @class_name)
@@ -96,7 +96,7 @@ JAVA_QUERIES: dict[str, str] = {
96
96
  declarator: (variable_declarator
97
97
  name: (identifier) @field_name))
98
98
  """,
99
- # --- 詳細付きクエリ ---
99
+ # --- Detailed Queries ---
100
100
  "class_with_body": """
101
101
  (class_declaration
102
102
  name: (identifier) @name
@@ -112,7 +112,7 @@ JAVA_QUERIES: dict[str, str] = {
112
112
  (modifiers (annotation) @annotation)*
113
113
  name: (identifier) @name) @method_with_annotations
114
114
  """,
115
- # --- 継承関係 ---
115
+ # --- Inheritance Relations ---
116
116
  "extends_clause": """
117
117
  (class_declaration
118
118
  (superclass) @extends_clause)
@@ -121,7 +121,7 @@ JAVA_QUERIES: dict[str, str] = {
121
121
  (class_declaration
122
122
  (super_interfaces) @implements_clause)
123
123
  """,
124
- # --- 修飾子別 ---
124
+ # --- By Modifiers ---
125
125
  "public_methods": """
126
126
  (method_declaration
127
127
  (modifiers) @mod
@@ -140,7 +140,7 @@ JAVA_QUERIES: dict[str, str] = {
140
140
  (#match? @mod "static")
141
141
  name: (identifier) @name) @static_methods
142
142
  """,
143
- # --- Spring Framework アノテーション ---
143
+ # --- Spring Framework Annotations ---
144
144
  "spring_controller": """
145
145
  (class_declaration
146
146
  (modifiers (annotation
@@ -162,7 +162,7 @@ JAVA_QUERIES: dict[str, str] = {
162
162
  (#match? @annotation_name "Repository")))
163
163
  name: (identifier) @repository_name) @spring_repository
164
164
  """,
165
- # --- JPA アノテーション ---
165
+ # --- JPA Annotations ---
166
166
  "jpa_entity": """
167
167
  (class_declaration
168
168
  (modifiers (annotation
@@ -178,7 +178,7 @@ JAVA_QUERIES: dict[str, str] = {
178
178
  declarator: (variable_declarator
179
179
  name: (identifier) @field_name)) @jpa_id_field
180
180
  """,
181
- # --- 構造情報抽出用クエリ ---
181
+ # --- Structural Information Extraction Queries ---
182
182
  "javadoc_comment": """
183
183
  (block_comment) @javadoc_comment
184
184
  (#match? @javadoc_comment "^/\\*\\*")
@@ -257,108 +257,108 @@ JAVA_QUERIES: dict[str, str] = {
257
257
  """,
258
258
  }
259
259
 
260
- # クエリの説明
260
+ # Query descriptions
261
261
  JAVA_QUERY_DESCRIPTIONS: dict[str, str] = {
262
- "class": "Javaクラス宣言を抽出",
263
- "interface": "Javaインターフェース宣言を抽出",
264
- "enum": "Java列挙型宣言を抽出",
265
- "annotation_type": "Javaアノテーション型宣言を抽出",
266
- "method": "Javaメソッド宣言を抽出",
267
- "constructor": "Javaコンストラクタ宣言を抽出",
268
- "field": "Javaフィールド宣言を抽出",
269
- "import": "Javaインポート文を抽出",
270
- "package": "Javaパッケージ宣言を抽出",
271
- "annotation": "Javaアノテーションを抽出",
272
- "lambda": "Javaラムダ式を抽出",
273
- "try_catch": "Java try-catch文を抽出",
274
- "class_name": "クラス名のみを抽出",
275
- "method_name": "メソッド名のみを抽出",
276
- "field_name": "フィールド名のみを抽出",
277
- "class_with_body": "クラス宣言と本体を抽出",
278
- "method_with_body": "メソッド宣言と本体を抽出",
279
- "extends_clause": "クラスの継承句を抽出",
280
- "implements_clause": "クラスの実装句を抽出",
281
- "public_methods": "publicメソッドを抽出",
282
- "private_methods": "privateメソッドを抽出",
283
- "static_methods": "staticメソッドを抽出",
284
- # 構造情報抽出用クエリの説明
285
- "javadoc_comment": "JavaDocコメントを抽出",
286
- "class_with_javadoc": "JavaDoc付きクラスを抽出",
287
- "method_with_javadoc": "JavaDoc付きメソッドを抽出",
288
- "field_with_javadoc": "JavaDoc付きフィールドを抽出",
289
- "method_parameters_detailed": "メソッドパラメータの詳細情報を抽出",
290
- "class_inheritance_detailed": "クラスの継承関係詳細を抽出",
291
- "annotation_detailed": "アノテーションの詳細情報を抽出",
292
- "import_detailed": "インポート文の詳細情報を抽出",
293
- "package_detailed": "パッケージ宣言の詳細情報を抽出",
294
- "constructor_detailed": "コンストラクタの詳細情報を抽出",
295
- "enum_constant": "列挙型定数を抽出",
296
- "interface_method": "インターフェースメソッドを抽出",
297
- "spring_controller": "Spring Controllerクラスを抽出",
298
- "spring_service": "Spring Serviceクラスを抽出",
299
- "spring_repository": "Spring Repositoryクラスを抽出",
300
- "jpa_entity": "JPA Entityクラスを抽出",
301
- "abstract_method": "抽象メソッドを抽出",
302
- "static_field": "静的フィールドを抽出",
303
- "final_field": "finalフィールドを抽出",
304
- "static_import": "静的インポート文を抽出",
305
- "marker_annotation": "マーカーアノテーションを抽出",
306
- "annotation_with_params": "パラメータ付きアノテーションを抽出",
307
- "synchronized_block": "synchronized文を抽出",
308
- "generic_type": "ジェネリック型を抽出",
309
- "method_with_annotations": "アノテーション付きメソッドを抽出",
310
- "jpa_id_field": "JPA IDフィールドを抽出",
262
+ "class": "Extract Java class declarations",
263
+ "interface": "Extract Java interface declarations",
264
+ "enum": "Extract Java enum declarations",
265
+ "annotation_type": "Extract Java annotation type declarations",
266
+ "method": "Extract Java method declarations",
267
+ "constructor": "Extract Java constructor declarations",
268
+ "field": "Extract Java field declarations",
269
+ "import": "Extract Java import statements",
270
+ "package": "Extract Java package declarations",
271
+ "annotation": "Extract Java annotations",
272
+ "lambda": "Extract Java lambda expressions",
273
+ "try_catch": "Extract Java try-catch statements",
274
+ "class_name": "Extract class names only",
275
+ "method_name": "Extract method names only",
276
+ "field_name": "Extract field names only",
277
+ "class_with_body": "Extract class declarations with body",
278
+ "method_with_body": "Extract method declarations with body",
279
+ "extends_clause": "Extract class inheritance clauses",
280
+ "implements_clause": "Extract class implementation clauses",
281
+ "public_methods": "Extract public methods",
282
+ "private_methods": "Extract private methods",
283
+ "static_methods": "Extract static methods",
284
+ # Structural information extraction query descriptions
285
+ "javadoc_comment": "Extract JavaDoc comments",
286
+ "class_with_javadoc": "Extract classes with JavaDoc",
287
+ "method_with_javadoc": "Extract methods with JavaDoc",
288
+ "field_with_javadoc": "Extract fields with JavaDoc",
289
+ "method_parameters_detailed": "Extract detailed method parameter information",
290
+ "class_inheritance_detailed": "Extract detailed class inheritance relationships",
291
+ "annotation_detailed": "Extract detailed annotation information",
292
+ "import_detailed": "Extract detailed import statement information",
293
+ "package_detailed": "Extract detailed package declaration information",
294
+ "constructor_detailed": "Extract detailed constructor information",
295
+ "enum_constant": "Extract enum constants",
296
+ "interface_method": "Extract interface methods",
297
+ "spring_controller": "Extract Spring Controller classes",
298
+ "spring_service": "Extract Spring Service classes",
299
+ "spring_repository": "Extract Spring Repository classes",
300
+ "jpa_entity": "Extract JPA Entity classes",
301
+ "abstract_method": "Extract abstract methods",
302
+ "static_field": "Extract static fields",
303
+ "final_field": "Extract final fields",
304
+ "static_import": "Extract static import statements",
305
+ "marker_annotation": "Extract marker annotations",
306
+ "annotation_with_params": "Extract annotations with parameters",
307
+ "synchronized_block": "Extract synchronized statements",
308
+ "generic_type": "Extract generic types",
309
+ "method_with_annotations": "Extract methods with annotations",
310
+ "jpa_id_field": "Extract JPA ID fields",
311
311
  }
312
312
 
313
313
 
314
314
  def get_java_query(name: str) -> str:
315
315
  """
316
- 指定されたJavaクエリを取得
316
+ Get the specified Java query
317
317
 
318
318
  Args:
319
- name: クエリ名
319
+ name: Query name
320
320
 
321
321
  Returns:
322
- クエリ文字列
322
+ Query string
323
323
 
324
324
  Raises:
325
- ValueError: クエリが見つからない場合
325
+ ValueError: When query is not found
326
326
  """
327
327
  if name not in JAVA_QUERIES:
328
328
  available = list(JAVA_QUERIES.keys())
329
- raise ValueError(f"Javaクエリ '{name}' は存在しません。利用可能: {available}")
329
+ raise ValueError(f"Java query '{name}' does not exist. Available: {available}")
330
330
 
331
331
  return JAVA_QUERIES[name]
332
332
 
333
333
 
334
334
  def get_java_query_description(name: str) -> str:
335
335
  """
336
- 指定されたJavaクエリの説明を取得
336
+ Get the description of the specified Java query
337
337
 
338
338
  Args:
339
- name: クエリ名
339
+ name: Query name
340
340
 
341
341
  Returns:
342
- クエリの説明
342
+ Query description
343
343
  """
344
- return JAVA_QUERY_DESCRIPTIONS.get(name, "説明なし")
344
+ return JAVA_QUERY_DESCRIPTIONS.get(name, "No description")
345
345
 
346
346
 
347
347
  # Convert to ALL_QUERIES format for dynamic loader compatibility
348
348
  ALL_QUERIES = {}
349
349
  for query_name, query_string in JAVA_QUERIES.items():
350
- description = JAVA_QUERY_DESCRIPTIONS.get(query_name, "説明なし")
350
+ description = JAVA_QUERY_DESCRIPTIONS.get(query_name, "No description")
351
351
  ALL_QUERIES[query_name] = {"query": query_string, "description": description}
352
352
 
353
353
  # Add common query aliases for cross-language compatibility
354
354
  ALL_QUERIES["functions"] = {
355
355
  "query": JAVA_QUERIES["method"],
356
- "description": "すべての関数/メソッド宣言を検索(methodのエイリアス)",
356
+ "description": "Search all function/method declarations (alias for method)",
357
357
  }
358
358
 
359
359
  ALL_QUERIES["classes"] = {
360
360
  "query": JAVA_QUERIES["class"],
361
- "description": "すべてのクラス宣言を検索(classのエイリアス)",
361
+ "description": "Search all class declarations (alias for class)",
362
362
  }
363
363
 
364
364
 
@@ -383,9 +383,9 @@ def list_queries() -> list:
383
383
 
384
384
  def get_available_java_queries() -> list[str]:
385
385
  """
386
- 利用可能なJavaクエリ一覧を取得
386
+ Get list of available Java queries
387
387
 
388
388
  Returns:
389
- クエリ名のリスト
389
+ List of query names
390
390
  """
391
391
  return list(JAVA_QUERIES.keys())
@@ -106,26 +106,26 @@ COMMENTS = """
106
106
  ALL_QUERIES = {
107
107
  "functions": {
108
108
  "query": FUNCTIONS,
109
- "description": "すべての関数宣言、式、メソッドを検索",
109
+ "description": "Search all function declarations, expressions, and methods",
110
110
  },
111
111
  "classes": {
112
112
  "query": CLASSES,
113
- "description": "すべてのクラス宣言と式を検索",
113
+ "description": "Search all class declarations and expressions",
114
114
  },
115
115
  "variables": {
116
116
  "query": VARIABLES,
117
- "description": "すべての変数宣言(varletconst)を検索",
117
+ "description": "Search all variable declarations (var, let, const)",
118
118
  },
119
119
  "imports": {
120
120
  "query": IMPORTS,
121
- "description": "すべてのインポート文と句を検索",
121
+ "description": "Search all import statements and clauses",
122
122
  },
123
- "exports": {"query": EXPORTS, "description": "すべてのエクスポート文を検索"},
123
+ "exports": {"query": EXPORTS, "description": "Search all export statements"},
124
124
  "objects": {
125
125
  "query": OBJECTS,
126
- "description": "オブジェクトリテラルとプロパティ定義を検索",
126
+ "description": "Search object literals and property definitions",
127
127
  },
128
- "comments": {"query": COMMENTS, "description": "すべてのコメントを検索"},
128
+ "comments": {"query": COMMENTS, "description": "Search all comments"},
129
129
  }
130
130
 
131
131
 
@@ -210,58 +210,58 @@ MODERN_PATTERNS = """
210
210
  ALL_QUERIES = {
211
211
  "functions": {
212
212
  "query": FUNCTIONS,
213
- "description": "すべての関数定義(async含む)を検索",
213
+ "description": "Search all function definitions (including async)",
214
214
  },
215
- "classes": {"query": CLASSES, "description": "すべてのクラス定義を検索"},
216
- "imports": {"query": IMPORTS, "description": "すべてのインポート文を検索"},
217
- "variables": {"query": VARIABLES, "description": "すべての変数代入を検索"},
218
- "decorators": {"query": DECORATORS, "description": "すべてのデコレータを検索"},
215
+ "classes": {"query": CLASSES, "description": "Search all class definitions"},
216
+ "imports": {"query": IMPORTS, "description": "Search all import statements"},
217
+ "variables": {"query": VARIABLES, "description": "Search all variable assignments"},
218
+ "decorators": {"query": DECORATORS, "description": "Search all decorators"},
219
219
  "methods": {
220
220
  "query": METHODS,
221
- "description": "クラス内のすべてのメソッド定義を検索",
221
+ "description": "Search all method definitions within classes",
222
222
  },
223
223
  "exceptions": {
224
224
  "query": EXCEPTIONS,
225
- "description": "例外処理とraise文を検索",
225
+ "description": "Search exception handling and raise statements",
226
226
  },
227
227
  "comprehensions": {
228
228
  "query": COMPREHENSIONS,
229
- "description": "リスト、辞書、セット内包表記を検索",
229
+ "description": "Search list, dictionary, and set comprehensions",
230
230
  },
231
- "comments": {"query": COMMENTS, "description": "コメントとdocstringを検索"},
231
+ "comments": {"query": COMMENTS, "description": "Search comments and docstrings"},
232
232
  "type_hints": {
233
233
  "query": TYPE_HINTS,
234
- "description": "型ヒントとアノテーションを検索",
234
+ "description": "Search type hints and annotations",
235
235
  },
236
236
  "async_patterns": {
237
237
  "query": ASYNC_PATTERNS,
238
- "description": "async/awaitパターンを検索",
238
+ "description": "Search async/await patterns",
239
239
  },
240
240
  "string_formatting": {
241
241
  "query": STRING_FORMATTING,
242
- "description": "f文字列と文字列フォーマットを検索",
242
+ "description": "Search f-strings and string formatting",
243
243
  },
244
244
  "context_managers": {
245
245
  "query": CONTEXT_MANAGERS,
246
- "description": "コンテキストマネージャー(with文)を検索",
246
+ "description": "Search context managers (with statements)",
247
247
  },
248
- "lambdas": {"query": LAMBDAS, "description": "ラムダ式を検索"},
248
+ "lambdas": {"query": LAMBDAS, "description": "Search lambda expressions"},
249
249
  "modern_patterns": {
250
250
  "query": MODERN_PATTERNS,
251
- "description": "モダンなPythonパターン(match/case、セイウチ演算子)を検索",
251
+ "description": "Search modern Python patterns (match/case, walrus operator)",
252
252
  },
253
253
  # Convenience aliases
254
254
  "function_names": {
255
255
  "query": FUNCTIONS,
256
- "description": "関数のエイリアス - すべての関数定義を検索",
256
+ "description": "Function alias - search all function definitions",
257
257
  },
258
258
  "class_names": {
259
259
  "query": CLASSES,
260
- "description": "クラスのエイリアス - すべてのクラス定義を検索",
260
+ "description": "Class alias - search all class definitions",
261
261
  },
262
262
  "all_declarations": {
263
263
  "query": FUNCTIONS + "\n\n" + CLASSES + "\n\n" + VARIABLES,
264
- "description": "すべての関数、クラス、変数宣言を検索",
264
+ "description": "Search all function, class, and variable declarations",
265
265
  },
266
266
  }
267
267
 
@@ -173,40 +173,40 @@ COMMENTS = """
173
173
  ALL_QUERIES = {
174
174
  "functions": {
175
175
  "query": FUNCTIONS,
176
- "description": "型アノテーション付きのすべての関数宣言、式、メソッドを検索",
176
+ "description": "Search all function declarations, expressions, and methods with type annotations",
177
177
  },
178
178
  "classes": {
179
179
  "query": CLASSES,
180
- "description": "抽象クラスを含むすべてのクラス宣言を検索",
180
+ "description": "Search all class declarations including abstract classes",
181
181
  },
182
182
  "interfaces": {
183
183
  "query": INTERFACES,
184
- "description": "すべてのインターフェース宣言を検索",
184
+ "description": "Search all interface declarations",
185
185
  },
186
186
  "type_aliases": {
187
187
  "query": TYPE_ALIASES,
188
- "description": "すべての型エイリアス宣言を検索",
188
+ "description": "Search all type alias declarations",
189
189
  },
190
- "enums": {"query": ENUMS, "description": "すべての列挙型宣言を検索"},
190
+ "enums": {"query": ENUMS, "description": "Search all enum declarations"},
191
191
  "variables": {
192
192
  "query": VARIABLES,
193
- "description": "型アノテーション付きのすべての変数宣言を検索",
193
+ "description": "Search all variable declarations with type annotations",
194
194
  },
195
195
  "imports": {
196
196
  "query": IMPORTS,
197
- "description": "型インポートを含むすべてのインポート文を検索",
197
+ "description": "Search all import statements including type imports",
198
198
  },
199
- "exports": {"query": EXPORTS, "description": "すべてのエクスポート文を検索"},
200
- "decorators": {"query": DECORATORS, "description": "すべてのデコレータを検索"},
199
+ "exports": {"query": EXPORTS, "description": "Search all export statements"},
200
+ "decorators": {"query": DECORATORS, "description": "Search all decorators"},
201
201
  "generics": {
202
202
  "query": GENERICS,
203
- "description": "すべてのジェネリック型パラメータを検索",
203
+ "description": "Search all generic type parameters",
204
204
  },
205
205
  "signatures": {
206
206
  "query": SIGNATURES,
207
- "description": "プロパティシグネチャ、メソッドシグネチャ、コンストラクタシグネチャを検索",
207
+ "description": "Search property signatures, method signatures, and constructor signatures",
208
208
  },
209
- "comments": {"query": COMMENTS, "description": "すべてのコメントを検索"},
209
+ "comments": {"query": COMMENTS, "description": "Search all comments"},
210
210
  }
211
211
 
212
212
 
@@ -33,19 +33,19 @@ class QueryLoader:
33
33
  }
34
34
 
35
35
  _QUERY_DESCRIPTIONS: dict[str, str] = {
36
- "class": "クラス宣言を抽出",
37
- "interface": "インターフェース宣言を抽出",
38
- "method": "メソッド宣言を抽出",
39
- "constructor": "コンストラクタ宣言を抽出",
40
- "field": "フィールド宣言を抽出",
41
- "import": "インポート文を抽出",
42
- "package": "パッケージ宣言を抽出",
43
- "annotation": "アノテーションを抽出",
44
- "method_name": "メソッド名のみを抽出",
45
- "class_name": "クラス名のみを抽出",
46
- "method_invocations": "メソッド呼び出しを抽出",
47
- "class_with_body": "クラス宣言と本体を抽出",
48
- "method_with_body": "メソッド宣言と本体を抽出",
36
+ "class": "Extract class declarations",
37
+ "interface": "Extract interface declarations",
38
+ "method": "Extract method declarations",
39
+ "constructor": "Extract constructor declarations",
40
+ "field": "Extract field declarations",
41
+ "import": "Extract import statements",
42
+ "package": "Extract package declarations",
43
+ "annotation": "Extract annotations",
44
+ "method_name": "Extract method names only",
45
+ "class_name": "Extract class names only",
46
+ "method_invocations": "Extract method invocations",
47
+ "class_with_body": "Extract class declarations with body",
48
+ "method_with_body": "Extract method declarations with body",
49
49
  }
50
50
 
51
51
  def __init__(self) -> None: