Skip to content

feat: lsp tools exp#972

Merged
wenytang-ms merged 15 commits intomainfrom
wenyt/lsp
Mar 18, 2026
Merged

feat: lsp tools exp#972
wenytang-ms merged 15 commits intomainfrom
wenyt/lsp

Conversation

@wenytang-ms
Copy link
Copy Markdown
Contributor

@wenytang-ms wenytang-ms commented Mar 17, 2026

setup java LSP tool exp

  1. All the Tool, prompt, skill are controlled by the Exp config.vscode-java-dependency.enableLspTools
  2. add the chatInstructions to chat to leverage the tool when the LSP ready
  3. add skills to copilot to leverage the tool when LSP ready
  4. register languaemodeltool after LSP ready
  5. add 6 tools. lsp_java_findSymbol, lsp_java_getCallHierarchy, lsp_java_getTypeHierarchy, lsp_java_getTypeAtPosition, lsp_java_getFileStructure, lsp_java_getFileImports

demo record

@wenytang-ms wenytang-ms changed the title Wenyt/lsp feat: lsp tools exp Mar 17, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@wenytang-ms wenytang-ms marked this pull request as ready for review March 17, 2026 08:47
@wenytang-ms wenytang-ms merged commit 8ef1af7 into main Mar 18, 2026
4 of 6 checks passed
@wenytang-ms wenytang-ms deleted the wenyt/lsp branch March 18, 2026 05:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants