Skip to content

copilot: Use latest Copilot API spec #30249

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

imumesh18
Copy link
Contributor

@imumesh18 imumesh18 commented May 8, 2025

Recently we started to use the new copilot-lsp which has different spec compare to the copilot.vim and it returns a lot of warnings for using the older spec. This PR upgrades it to use the latest spec.

Logs
2025-05-07T21:07:24-03:00 INFO  [lsp] Language server with id 0 sent unhandled notification window/logMessage:
{
  "type": 2,
  "message": "[sdk] setEditorInfo is deprecated. Use initializationOptions for editorInfo and editorPluginInfo and workspace/didChangeConfiguration for editorConfiguration."
}

New Docs: https://github.com/github/copilot-language-server-release/blob/main/README.md

Tasks:

  • Move signIn to use latest spec.
  • Move completion to use latest spec.
  • Use window/showMessageRequest to show server sent notification to user. This is already handled from lsp_store.rs.
  • Use window/logMessage to log messages specifically errors and other send from lsp server. This is already handled from lsp_store.rs.
  • Use didChangeStatus to update copilot status update.
  • Do through code cleanup
  • Improve the copilot experience and remove rough edges.

I have tested it it's working now with no rough edges. Also we don't address the bigger issue of how to handle the NES(Next edit suggestions) But this sets up for the NES changes in future.

Release Notes:

  • N/A

- Replace SignInInitiate with SignIn request and update related types
- Move editor info into InitializationOptions and remove SetEditorInfo request
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label May 8, 2025
@maxdeviant maxdeviant changed the title copilot: Use latest copilot api spec copilot: Use latest copilot API spec May 8, 2025
@maxdeviant maxdeviant changed the title copilot: Use latest copilot API spec copilot: Use latest Copilot API spec May 8, 2025
@imumesh18 imumesh18 marked this pull request as draft May 9, 2025 08:35
@@ -241,23 +240,6 @@ impl LogStore {
cx.subscribe(copilot, |this, copilot, inline_completion_event, cx| {
if let copilot::Event::CopilotLanguageServerStarted = inline_completion_event {
if let Some(server) = copilot.read(cx).language_server() {
let server_id = server.server_id();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this as the current copilot-lsp supports windows/logMessage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant