Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds an experimental set of Java Language Server (jdtls/LSP)-backed “language model tools” (lsp_java_*) and accompanying chat skill/instructions, gated behind a new vscode-java-dependency.enableLspTools setting, plus a new jdtls extension command to return classified imports.
Changes:
- Registers 6 Java LSP tools (document/workspace symbols, hover/type, call hierarchy, type hierarchy, and file imports) and contributes their metadata to VS Code.
- Adds a new jdtls workspace command (
java.project.getFileImports) with result models to support the tools. - Introduces an experimental setting gate and bumps the VS Code engine / typings version.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| src/extension.ts | Switches post-jdtls-ready Copilot integration hook to register LSP tools under a setting gate. |
| src/copilot/tools/javaContextTools.ts | Implements the 6 lsp_java_* tools and registers them via vscode.lm. |
| src/commands.ts | Adds the new JAVA_PROJECT_GET_FILE_IMPORTS command constant. |
| resources/skills/java-lsp-tools/SKILL.md | Adds a chat “skill” describing how/when to use the tools. |
| resources/instruments/javaLspContext.instructions.md | Adds chat instructions intended to steer tool usage in Java workspaces. |
| package.json | Contributes languageModelTools, chatSkills, chatInstructions, adds the experimental config flag, and bumps VS Code engine/typings. |
| package.nls.json | Adds localized description text for the new config flag. |
| package-lock.json | Updates lockfile to reflect the VS Code typings/version bump. |
| jdtls.ext/.../CommandHandler.java | Wires the new java.project.getFileImports workspace command to a handler. |
| jdtls.ext/.../AiContextCommand.java | Implements AST-only import extraction + heuristic classification. |
| jdtls.ext/.../model/*.java | Adds result model classes for AI-oriented structured outputs (incl. imports). |
| jdtls.ext/.../plugin.xml | Registers the new java.project.getFileImports command with the plugin. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
jdtls.ext/com.microsoft.jdtls.ext.core/src/com/microsoft/jdtls/ext/core/AiContextCommand.java
Outdated
Show resolved
Hide resolved
chagong
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
setup java LSP tool exp
config.vscode-java-dependency.enableLspToolschatInstructionsto chat to leverage the tool when the LSP readylanguaemodeltoolafter LSP readylsp_java_findSymbol,lsp_java_getCallHierarchy,lsp_java_getTypeHierarchy,lsp_java_getTypeAtPosition,lsp_java_getFileStructure,lsp_java_getFileImportsdemo record