-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(lsp): compatibility with Neovim 0.9
- Loading branch information
Showing
6 changed files
with
50 additions
and
23 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
---@diagnostic disable: deprecated | ||
---@mod rustaceanvim.compat Functions for backward compatibility with older Neovim versions | ||
|
||
local M = {} | ||
|
||
M.joinpath = vim.fs.joinpath or function(...) | ||
return (table.concat({ ... }, '/'):gsub('//+', '/')) | ||
end | ||
|
||
M.get_clients = vim.lsp.get_clients or vim.lsp.get_active_clients | ||
|
||
return M |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,20 @@ | ||
local uv = vim.uv or vim.loop | ||
-- load RustAnalyzer command | ||
require('rustaceanvim.lsp') | ||
|
||
local stub = require('luassert.stub') | ||
describe('LSP client API', function() | ||
local RustaceanConfig = require('rustaceanvim.config.internal') | ||
local Types = require('rustaceanvim.types.internal') | ||
local ra_bin = Types.evaluate(RustaceanConfig.server.cmd)[1] | ||
if vim.fn.executable(ra_bin) ~= 0 then | ||
it('Can spin up rust-analyzer.', function() | ||
--- TODO: Figure out how to add tests for this | ||
print('TODO') | ||
local lsp_start = stub(vim.lsp, 'start') | ||
vim.cmd.e('test.rs') | ||
vim.cmd.RustAnalyzer('start') | ||
-- TODO: Use something less flaky, e.g. a timeout | ||
uv.sleep(5000) | ||
assert.stub(lsp_start).was_called() | ||
end) | ||
end | ||
end) |