Skip to content

Commit e5f1e9d

Browse files
wenytang-msCopilot
andcommitted
Address Java LSP handoff review comments
Use normalized relative paths consistently when resolving file structure inputs and classify truncated findSymbol responses before small exact-result guidance. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0a5233c commit e5f1e9d

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

src/copilot/tools/javaContextTools.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function resolveFileUri(input: string): vscode.Uri {
142142
: normalizedRelativePath.substring(matchingFolder.name.length + 1);
143143
uri = vscode.Uri.joinPath(matchingFolder.uri, pathInFolder);
144144
} else {
145-
uri = vscode.Uri.joinPath(folders[0].uri, normalizedInput);
145+
uri = vscode.Uri.joinPath(folders[0].uri, normalizedRelativePath);
146146
}
147147
}
148148

@@ -340,17 +340,17 @@ const findSymbolTool: vscode.LanguageModelTool<FindSymbolInput> = {
340340
};
341341
});
342342
resultCount = results.length;
343-
const nextStep = symbols.length <= 3
343+
const nextStep = totalResults > resultCount
344344
? [
345-
"These are exact Java symbol locations.",
346-
"Use read_file on the returned file/range, or lsp_java_getFileStructure with outlineInput for broader file context.",
347-
"Do not call lsp_java_findSymbol again for the same or similar symbol unless these results are irrelevant.",
345+
"Many symbols matched.",
346+
"Refine only if the returned locations are not specific enough;",
347+
"otherwise use read_file on the relevant returned file/range.",
348348
].join(" ")
349-
: symbols.length > resultCount
349+
: resultCount <= 3
350350
? [
351-
"Many symbols matched.",
352-
"Refine only if the returned locations are not specific enough;",
353-
"otherwise use read_file on the relevant returned file/range.",
351+
"These are exact Java symbol locations.",
352+
"Use read_file on the returned file/range, or lsp_java_getFileStructure with outlineInput for broader file context.",
353+
"Do not call lsp_java_findSymbol again for the same or similar symbol unless these results are irrelevant.",
354354
].join(" ")
355355
: [
356356
"Use read_file on the relevant returned file/range,",

0 commit comments

Comments
 (0)