You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/java-context-tools-skill.md
+24-24Lines changed: 24 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
22
22
23
23
## Tool Reference
24
24
25
-
### `java_getFileStructure`
25
+
### `lsp_java_getFileStructure`
26
26
27
27
**Purpose:** Get the structural outline of a Java file — classes, methods, fields with line ranges.
28
28
@@ -41,7 +41,7 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
41
41
42
42
---
43
43
44
-
### `java_findSymbol`
44
+
### `lsp_java_findSymbol`
45
45
46
46
**Purpose:** Find classes, interfaces, methods by name across the entire workspace.
47
47
@@ -60,7 +60,7 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
60
60
61
61
---
62
62
63
-
### `java_getFileImports`
63
+
### `lsp_java_getFileImports`
64
64
65
65
**Purpose:** Get all import statements from a Java file, classified by source (jdk/project/external).
66
66
@@ -75,11 +75,11 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
75
75
76
76
**Typical output size:**~80 tokens
77
77
78
-
**Important:** This tells you WHAT is imported but not HOW it's used. For details about a specific imported class, use `read_file` to read the relevant source or `java_getTypeAtPosition` on its usage.
78
+
**Important:** This tells you WHAT is imported but not HOW it's used. For details about a specific imported class, use `read_file` to read the relevant source or `lsp_java_getTypeAtPosition` on its usage.
79
79
80
80
---
81
81
82
-
### `java_getTypeAtPosition`
82
+
### `lsp_java_getTypeAtPosition`
83
83
84
84
**Purpose:** Get the exact resolved type of any expression at a specific source position.
85
85
@@ -99,7 +99,7 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
99
99
100
100
---
101
101
102
-
### `java_getCallHierarchy`
102
+
### `lsp_java_getCallHierarchy`
103
103
104
104
**Purpose:** Find all callers of a method (incoming) or all methods it calls (outgoing).
105
105
@@ -118,7 +118,7 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
118
118
119
119
---
120
120
121
-
### `java_getTypeHierarchy`
121
+
### `lsp_java_getTypeHierarchy`
122
122
123
123
**Purpose:** Find all supertypes or subtypes of a class/interface.
124
124
@@ -142,10 +142,10 @@ You have access to 6 Java-specific tools that provide **compiler-accurate** info
142
142
### Pattern 1: "Fix a bug in a Java file"
143
143
144
144
```
145
-
1. java_getFileStructure(file) → Understand what's in the file (100 tokens)
145
+
1. lsp_java_getFileStructure(file) → Understand what's in the file (100 tokens)
146
146
2. read_file(file, relevant_lines) → Read the buggy method
147
-
3. [If needed] java_getFileImports(file) → Check what types are used (80 tokens)
### ❌ Don't call java_getTypeAtPosition on obvious types
194
+
### ❌ Don't call lsp_java_getTypeAtPosition on obvious types
195
195
196
196
```java
197
197
String name ="hello"; // Obviously String — don't call the tool
@@ -202,11 +202,11 @@ var result = service.process(input); // Not obvious — DO call the tool
202
202
203
203
You already know `java.util.List`, `java.lang.String`, `java.io.File`. Don't waste a tool call on them.
204
204
205
-
### ❌ Don't call java_getFileStructure on small files
205
+
### ❌ Don't call lsp_java_getFileStructure on small files
206
206
207
207
If a file is < 100 lines, just use `read_file` directly. File structure is most valuable for large files.
208
208
209
-
### ❌ Don't call java_getCallHierarchy without reading the method first
209
+
### ❌ Don't call lsp_java_getCallHierarchy without reading the method first
210
210
211
211
Understand what the method does before tracing its callers.
212
212
@@ -223,6 +223,6 @@ If a Java tool returns an error or empty result:
223
223
**For dependency/project info not covered by these tools:**
224
224
- Read `pom.xml` or `build.gradle` directly with `read_file`
225
225
- Use `grep_search` to find dependency declarations
226
-
- Use `java_getFileImports` to see what external libraries a file uses
226
+
- Use `lsp_java_getFileImports` to see what external libraries a file uses
227
227
228
228
**General rule:** If a Java-specific tool fails, fall back to the universal tools (`read_file`, `grep_search`, `list_code_usages`). Don't retry more than once.
Copy file name to clipboardExpand all lines: docs/package-json-tools-snippet.jsonc
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@
18
18
}
19
19
},
20
20
{
21
-
"name": "java_getFileImports",
21
+
"name": "lsp_java_getFileImports",
22
22
"tags": ["java", "imports", "file"],
23
23
"modelDescription": "Get the classified import list of a Java file. Each import is tagged with its kind (class/interface/enum/annotation) and source (project/external/jdk). Returns ~80 tokens. Use this to understand what a file depends on WITHOUT reading the full source. Follow up with java_getClassDetail only for the 1-2 classes you actually need to understand — do NOT expand every import.",
"modelDescription": "Get the structural outline of a Java file: classes, methods, fields, and their line ranges — WITHOUT reading the file content. Returns ~100 tokens. Use this BEFORE read_file to understand what's in a large file, then read_file on specific line ranges. Much more efficient than reading the entire file.",
"modelDescription": "Search for classes, interfaces, methods, or fields by name across the entire Java workspace. Returns precise symbol definitions only (no comments, no string literals, no import statements). More accurate than grep_search for finding Java symbol definitions. Supports partial names and camelCase matching.",
96
96
"displayName": "Java: Find Symbol",
@@ -106,7 +106,7 @@
106
106
}
107
107
},
108
108
{
109
-
"name": "java_getTypeAtPosition",
109
+
"name": "lsp_java_getTypeAtPosition",
110
110
"tags": ["java", "type", "inference", "hover"],
111
111
"modelDescription": "Get the compiler-resolved type of any expression at a specific source position. Returns the EXACT type (~20 tokens), using the Java compiler's own type inference. Use this for: var declarations, lambda parameters, generic type arguments, chained method call return types. Do NOT use for obvious types like String literals or explicit type declarations.",
112
112
"displayName": "Java: Get Type at Position",
@@ -130,7 +130,7 @@
130
130
}
131
131
},
132
132
{
133
-
"name": "java_getCallHierarchy",
133
+
"name": "lsp_java_getCallHierarchy",
134
134
"tags": ["java", "calls", "hierarchy", "impact"],
135
135
"modelDescription": "Find all callers of a method (incoming) or all methods it calls (outgoing). More precise than list_code_usages — returns only actual method CALLS, not imports, declarations, or comments. Use 'incoming' before modifying a method signature to find all callers. Use 'outgoing' to understand what a method depends on.",
"modelDescription": "Find all supertypes or subtypes of a class/interface. Catches things grep misses: indirect implementations, anonymous classes, lambda implementations of functional interfaces. Use 'subtypes' when modifying an interface to find ALL implementations. Use 'supertypes' to understand the inheritance chain.",
Copy file name to clipboardExpand all lines: lsp-ai-tools.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -695,7 +695,7 @@ class TypeQueryTool implements vscode.LanguageModelTool<{ uri: string; line: num
695
695
}
696
696
},
697
697
{
698
-
"name":"java_findSymbol",
698
+
"name":"lsp_java_findSymbol",
699
699
"displayName":"Find Symbol in Workspace",
700
700
"modelDescription":"Search for a class, interface, method or field by name across the entire workspace. Returns exact matches with kind (Class/Interface/Method) and file location. More precise than grep - no noise from comments or imports.",
Copy file name to clipboardExpand all lines: package.json
+13-7Lines changed: 13 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@
50
50
],
51
51
"languageModelTools": [
52
52
{
53
-
"name": "java_getFileStructure",
53
+
"name": "lsp_java_getFileStructure",
54
54
"toolReferenceName": "javaFileStructure",
55
55
"modelDescription": "Get the structure (classes, methods, fields, inner classes) of a Java file. Returns a hierarchical outline with symbol kinds and line ranges. Use this first when you need to understand a file's layout before reading specific sections.",
56
56
"displayName": "Java: Get File Structure",
@@ -68,7 +68,7 @@
68
68
}
69
69
},
70
70
{
71
-
"name": "java_findSymbol",
71
+
"name": "lsp_java_findSymbol",
72
72
"toolReferenceName": "javaFindSymbol",
73
73
"modelDescription": "Search for Java symbols (classes, interfaces, methods, fields) across the workspace by name. Supports partial/fuzzy matching. Use this to find where a class or method is defined.",
74
74
"displayName": "Java: Find Symbol",
@@ -90,7 +90,7 @@
90
90
}
91
91
},
92
92
{
93
-
"name": "java_getFileImports",
93
+
"name": "lsp_java_getFileImports",
94
94
"toolReferenceName": "javaFileImports",
95
95
"modelDescription": "Get all import statements from a Java file, classified by source (jdk/project/external).",
96
96
"displayName": "Java: Get File Imports",
@@ -108,7 +108,7 @@
108
108
}
109
109
},
110
110
{
111
-
"name": "java_getTypeAtPosition",
111
+
"name": "lsp_java_getTypeAtPosition",
112
112
"toolReferenceName": "javaTypeAtPosition",
113
113
"modelDescription": "Get the compiler-resolved type signature at a specific position. Returns fully qualified type, method signature, or field declaration. Use this when you see var, lambdas, or generics and need the exact type.",
114
114
"displayName": "Java: Get Type at Position",
@@ -134,7 +134,7 @@
134
134
}
135
135
},
136
136
{
137
-
"name": "java_getCallHierarchy",
137
+
"name": "lsp_java_getCallHierarchy",
138
138
"toolReferenceName": "javaCallHierarchy",
139
139
"modelDescription": "Get incoming callers or outgoing callees of a method. PREFER THIS over grep_search when you need to find which methods call a specific method — returns precise call sites without noise from comments, imports, or string matches. Use 'incoming' for callers, 'outgoing' for callees.",
140
140
"displayName": "Java: Get Call Hierarchy",
@@ -166,7 +166,7 @@
166
166
}
167
167
},
168
168
{
169
-
"name": "java_getTypeHierarchy",
169
+
"name": "lsp_java_getTypeHierarchy",
170
170
"toolReferenceName": "javaTypeHierarchy",
171
171
"modelDescription": "Get supertypes or subtypes/implementors of a type. PREFER THIS over grep_search('extends|implements') — returns only actual inheritance relationships. Use 'supertypes' for parents, 'subtypes' for children.",
0 commit comments