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
Return structured file and line fields from findSymbol so the model can consume precise ranges without repeating symbol search. Accept line-suffixed Java locations in file structure resolution and document outlineInput handoff.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copy file name to clipboardExpand all lines: package.json
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@
52
52
{
53
53
"name": "lsp_java_getFileStructure",
54
54
"toolReferenceName": "javaFileStructure",
55
-
"modelDescription": "Get a known Java file's outline: classes, interfaces, methods, fields, symbol kinds, and line ranges, to pick a precise read_file range instead of reading the whole file.\n\nUse after lsp_java_findSymbol returns a file, or when the user gave a Java file path; do not guess paths. Not for workspace-wide search\u2014use lsp_java_findSymbol for that. Do not re-call for the same file unless the first result was empty.",
55
+
"modelDescription": "Get a known Java file's outline: classes, interfaces, methods, fields, symbol kinds, and line ranges, to pick a precise read_file range instead of reading the whole file.\n\nUse after lsp_java_findSymbol returns outlineInput/file, or when the user gave a Java file path; do not guess paths. This accepts a workspace-relative Java path and tolerates a trailing line suffix such as src/Foo.java:42. Not for workspace-wide search\u2014use lsp_java_findSymbol for that. Do not re-call for the same file unless the first result was empty.",
56
56
"displayName": "Java: Get File Structure",
57
57
"userDescription": "Get a Java file outline with classes, methods, fields, and line ranges.",
58
58
"tags": [
@@ -69,7 +69,7 @@
69
69
"properties": {
70
70
"uri": {
71
71
"type": "string",
72
-
"description": "Workspace-relative path to a Java file. Must be a known path from prior tool results or user input — do not guess."
72
+
"description": "Workspace-relative path to a Java file. Prefer outlineInput or file returned by lsp_java_findSymbol. A trailing line suffix like src/Foo.java:42 is tolerated. Must be a known path from prior tool results or user input — do not guess."
73
73
}
74
74
},
75
75
"required": [
@@ -80,7 +80,7 @@
80
80
{
81
81
"name": "lsp_java_findSymbol",
82
82
"toolReferenceName": "javaFindSymbol",
83
-
"modelDescription": "Find Java class, interface, method, or field definitions across the workspace by name or partial identifier. Prefer over grep_search, file_search, semantic_search, or search subagents for Java symbol lookup.\n\nOn relevant results, do not repeat with a similar query; continue with lsp_java_getFileStructure or read_file on the returned line range. The tool retries internally, so on an empty result do not re-search\u2014retry once only if it reports indexing in progress, otherwise use generic search.\n\nDo not use for non-Java files, literals, comments, build/XML files, or conceptual exploration.",
83
+
"modelDescription": "Find Java class, interface, method, or field definitions across the workspace by name or partial identifier. Prefer over grep_search, file_search, semantic_search, or search subagents for Java symbol lookup.\n\nResults include file, startLine, endLine, range, and outlineInput. On relevant results, do not repeat with a similar query; use read_file on the returned file/range, or lsp_java_getFileStructure with outlineInput when broader file context is needed. The tool retries internally, so on an empty result do not re-search\u2014retry once only if it reports indexing in progress, otherwise use generic search.\n\nDo not use for non-Java files, literals, comments, build/XML files, or conceptual exploration.",
84
84
"displayName": "Java: Find Symbol",
85
85
"userDescription": "Find Java class, method, field, or interface definitions by name.",
Copy file name to clipboardExpand all lines: resources/instruments/javaLspContext.instructions.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,6 @@ For Java symbol navigation, two compiler-accurate `lsp_java_*` tools are availab
10
10
11
11
If these tools are not already available in the current tool list, load them with `tool_search` using a query such as `Java LSP symbol navigation lsp_java`.
12
12
13
-
Use `lsp_java_findSymbol` before `grep_search`, `search_subagent`, `semantic_search`, or `file_search` only when the task is to locate Java symbols by name or partial identifier. If it returns relevant symbols, do not call it again with the same or similar query; next use `lsp_java_getFileStructure` for the returned file or `read_file` on the smallest useful line range.
13
+
Use `lsp_java_findSymbol` before `grep_search`, `search_subagent`, `semantic_search`, or `file_search` only when the task is to locate Java symbols by name or partial identifier. If it returns relevant symbols, do not call it again with the same or similar query; next use `read_file` on the returned `file`/`range`, or call `lsp_java_getFileStructure` with `outlineInput` when broader file context is needed.
14
14
15
-
Use `lsp_java_getFileStructure` only with a path confirmed by the user or a previous tool result. Do not guess paths. Use generic search for string literals, comments, XML, Gradle/Maven files, non-Java files, or broad conceptual exploration. `findSymbol` already retries internally with a normalized identifier, so do not re-issue the same search on an empty result: if it reports indexing in progress, retry once after a short pause; otherwise fall back to generic search.
15
+
Use `lsp_java_getFileStructure` only with a path confirmed by the user or a previous tool result. Prefer `outlineInput` or `file` from `findSymbol`; a trailing line suffix such as `src/Foo.java:42` is tolerated, but do not guess paths. Use generic search for string literals, comments, XML, Gradle/Maven files, non-Java files, or broad conceptual exploration. `findSymbol` already retries internally with a normalized identifier, so do not re-issue the same search on an empty result: if it reports indexing in progress, retry once after a short pause; otherwise fall back to generic search.
Copy file name to clipboardExpand all lines: resources/skills/java-lsp-tools/SKILL.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,13 +12,13 @@ Two compiler-accurate tools backed by the Java Language Server (jdtls). They ret
12
12
### `lsp_java_findSymbol`
13
13
Search for Java symbol definitions (classes, methods, fields) by name across the workspace. Supports partial matching.
14
14
- Input: `{ query, limit? }` — limit defaults to 20, max 50
15
-
- Output: `{ results: [{ name, kind, container?, location, range}], total }` (~60 tokens); `range` is `L start-end`
15
+
- Output: `{ results: [{ name, kind, container?, file, startLine, endLine, location, range, outlineInput }], total, nextStep }`; `range` is `L start-end`, and `outlineInput` can be passed to `lsp_java_getFileStructure`
16
16
-**Use instead of**`grep_search`, `file_search`, `semantic_search`, or `search_subagent` when looking for where a Java class/method/field is defined by identifier
17
17
- Do not repeat with the same or similar query after relevant results are returned
18
18
19
19
### `lsp_java_getFileStructure`
20
20
Get hierarchical outline of a Java file (classes, methods, fields) with line ranges.
21
-
- Input: `{ uri }` — workspace-relative path. Must be a known path from prior tool results or user input — do not guess
21
+
- Input: `{ uri }` — workspace-relative path. Prefer `outlineInput` or `file` from `lsp_java_findSymbol`; a trailing line suffix such as `src/Foo.java:42` is tolerated. Must be a known path from prior tool results or user input — do not guess
22
22
- Output: symbol tree with `L start-end` ranges (~100 tokens)
23
23
-**Use before**`read_file` when you need to choose a precise line range in a known Java file
24
24
@@ -36,7 +36,7 @@ Get hierarchical outline of a Java file (classes, methods, fields) with line ran
If `findSymbol` returns relevant symbols, move forward to `getFileStructure` or `read_file`; do not call `findSymbol` again with the same or similar identifier.
39
+
If `findSymbol` returns relevant symbols, use `read_file` on the returned `file`/`range`, or call `getFileStructure` with `outlineInput` when broader file context is needed. Do not call `findSymbol` again with the same or similar identifier unless the returned symbols are irrelevant.
0 commit comments