You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ruby-lsp integration broken, can't use experimental/goToRelevantFile method #229
I use the method experimental/goToRelevantFile exposed in the ruby-lsp to alternate between the implementation and test files in ruby.
It has been working fine until I decided to start using Copilot in nvim. Now, when I try to navigate using this method, I get the following error:
RPC[ERROR] code_name= MethodNotFound, message = "Method not found: experimental/goToRelevantFile"
tried to call the command Copilot disable right before the lsp request, but it didn't help either.
Using it how, exactly? You'll need to make sure to request that method from the correct language server.
Without copilot.vim it works fine (pardon my lua):
local M = {}
function M.lsp_go_to_relevant_file()
local filetype = vim.bo.filetype
if filetype ~= "ruby" then
return
end
local uri = vim.uri_from_bufnr(0)
local params = { textDocument = { uri = uri } }
vim.lsp.buf_request_all(0, "experimental/goToRelevantFile", params, function(results)
for _, result_or_error in pairs(results) do
local error, result = result_or_error.error, result_or_error.result
if error then
print(error)
return
end
for _, v in pairs(result) do
for _, v1 in pairs(v) do
vim.cmd(string.format("edit %s", v1))
end
end
end
end)
end
return M
local lsp_ext = require("lsp_ext")
vim.keymap.set('n', '<D-A-o>', lsp_ext.lsp_go_to_relevant_file)
my guess is that the plugin intercepts all lsp calls and if the given method is not included in some "hardcoded" list or is unable to find it from the server capabilities, it just blocks the requests. If that'd be case, I think the plugin should allow to bypass the request
Here, the request is sent all attached language servers, that's what the all means. This includes the Copilot language server.
if error then
print(error)
return
end
And this prints any error that results and exits the loop prematurely.
So in short, this code is both causing the error and printing the error and short circuiting before the result you're actually looking for is processed.
my guess is that the plugin intercepts all lsp calls
Thanks a lot for the clarification, did not know that Copilot launched its own lsp, now that makes absolutely sense.
Changing the implementation to something like this, to ensure request is sent only to the ruby-lsp, make it works as expected.
Activity
tpope commentedon Oct 27, 2025
Using it how, exactly? You'll need to make sure to request that method from the correct language server.
dagi3d commentedon Oct 29, 2025
Without copilot.vim it works fine (pardon my lua):
my guess is that the plugin intercepts all lsp calls and if the given method is not included in some "hardcoded" list or is unable to find it from the server capabilities, it just blocks the requests. If that'd be case, I think the plugin should allow to bypass the request
tpope commentedon Oct 29, 2025
Here, the request is sent all attached language servers, that's what the
allmeans. This includes the Copilot language server.And this prints any error that results and exits the loop prematurely.
So in short, this code is both causing the error and printing the error and short circuiting before the result you're actually looking for is processed.
There's nothing like this in Copilot.vim.
dagi3d commentedon Oct 29, 2025
Thanks a lot for the clarification, did not know that Copilot launched its own lsp, now that makes absolutely sense.
Changing the implementation to something like this, to ensure request is sent only to the ruby-lsp, make it works as expected.