Skip to content
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

not found: "metals/findTextInDependencyJars" request handler for client "GitHub Copilot". #664

Open
alycklama opened this issue Apr 13, 2024 · 4 comments

Comments

@alycklama
Copy link

Describe the bug

When executing :MetalsFindInDependencyJars on the command-line with the GitHub Copilot plugin installed with the following input:

Filemask: .conf
Query: String

I then run into the following error:

Error executing Lua callback: ...l/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1382: not found: "metals/findTextInDependencyJars" request handler for client "GitHub Copilot".
stack traceback:
        [C]: in function 'assert'
        ...l/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1382: in function 'request'
        ...l/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1969: in function 'fn'
        ...l/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:184: in function 'for_each_buffer_client'
        ...l/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1968: in function 'buf_request'
        ...lt.ext/.local/share/nvim/lazy/nvim-metals/lua/metals.lua:281: in function 'send_request'
        ...lt.ext/.local/share/nvim/lazy/nvim-metals/lua/metals.lua:292: in function 'on_confirm'
        ...al/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/ui.lua:103: in function 'input'
        ...lt.ext/.local/share/nvim/lazy/nvim-metals/lua/metals.lua:288: in function 'get_query_and_send'
        ...lt.ext/.local/share/nvim/lazy/nvim-metals/lua/metals.lua:302: in function 'on_confirm'
        ...al/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/ui.lua:103: in function 'input'
        ...lt.ext/.local/share/nvim/lazy/nvim-metals/lua/metals.lua:297: in function <...lt.ext/.local/share/nvim/lazy/nvim-metals/lua/metals.lua:276>
        .../.local/share/nvim/lazy/nvim-metals/lua/metals/setup.lua:46: in function <.../.local/share/nvim/lazy/nvim-metals/lua/metals/setup.lua:45>

Why is GitHub Copilot affected by a command for Metals? Any idea what could be going on here?

Expected behavior

I would expect to see the results when searching for text in dependency jars.

Operating system

macOS

Version of Metals

v1.2.2

Commit of nvim-metals

4f9bf0c

@ckipp01
Copy link
Member

ckipp01 commented Apr 15, 2024

Just to confirm, if you don't have copilot enabled or installed you don't have this problem? Just testing the command locally for me works fine, so you'll have to try and minimally reproduce. I have no idea why having copilot would impact this at all.

@alycklama
Copy link
Author

alycklama commented Apr 15, 2024

Correct, if I disable Copilot I don't run into any issue and I see the results in the Quickfix window.

@ckipp01
Copy link
Member

ckipp01 commented Apr 15, 2024

I will need to try and reproduce this. I think what is happening is that we're just grabbing the current client and sending the request to it. Normally in Scala here this would always just be Metals, but it seems that the client this is being sent to is copilot... and of course the custom metals endpoint doesn't exist there.

@alycklama
Copy link
Author

That would be great, thanks!

This is my Lazy config for Copilot :

  {
    "github/copilot.vim"
  },

Using the latest version:

  "copilot.vim": { "branch": "release", "commit": "1e135c5303bc60598f6314a2276f31dc91aa34dd" },

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

No branches or pull requests

2 participants