aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/plugin/lsp_spec.lua')
-rw-r--r--test/functional/plugin/lsp_spec.lua41
1 files changed, 23 insertions, 18 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua
index 35cc2d3075..b77a285379 100644
--- a/test/functional/plugin/lsp_spec.lua
+++ b/test/functional/plugin/lsp_spec.lua
@@ -14,6 +14,7 @@ local retry = helpers.retry
local NIL = helpers.NIL
local read_file = require('test.helpers').read_file
local write_file = require('test.helpers').write_file
+local isCI = helpers.isCI
-- Use these to get access to a coroutine so that I can run async tests and use
-- yield.
@@ -262,8 +263,8 @@ describe('LSP', function()
end)
it('should succeed with manual shutdown', function()
- if 'openbsd' == helpers.uname() then
- pending('hangs the build on openbsd #14028, re-enable with freeze timeout #14204')
+ if isCI() then
+ pending('hangs the build on CI #14028, re-enable with freeze timeout #14204')
return
end
local expected_handlers = {
@@ -1147,14 +1148,14 @@ describe('LSP', function()
make_edit(0, 0, 0, 3, "First ↥ 🤦 🦄")
},
textDocument = {
- uri = "file://fake/uri";
+ uri = "file:///fake/uri";
version = editVersion
}
}
end
before_each(function()
target_bufnr = exec_lua [[
- local bufnr = vim.uri_to_bufnr("file://fake/uri")
+ local bufnr = vim.uri_to_bufnr("file:///fake/uri")
local lines = {"1st line of text", "2nd line of 语text"}
vim.api.nvim_buf_set_lines(bufnr, 0, 1, false, lines)
return bufnr
@@ -1234,7 +1235,7 @@ describe('LSP', function()
make_edit(row, 0, row, 1000, new_line)
},
textDocument = {
- uri = "file://fake/uri";
+ uri = "file:///fake/uri";
version = editVersion
}
}
@@ -1252,7 +1253,7 @@ describe('LSP', function()
before_each(function()
local ret = exec_lua [[
- local bufnr = vim.uri_to_bufnr("file://fake/uri")
+ local bufnr = vim.uri_to_bufnr("file:///fake/uri")
local lines = {
"Original Line #1",
"Original Line #2"
@@ -1532,19 +1533,19 @@ describe('LSP', function()
it('Convert Location[] to items', function()
local expected = {
{
- filename = 'fake/uri',
+ filename = '/fake/uri',
lnum = 1,
col = 3,
text = 'testing'
},
}
local actual = exec_lua [[
- local bufnr = vim.uri_to_bufnr("file://fake/uri")
+ local bufnr = vim.uri_to_bufnr("file:///fake/uri")
local lines = {"testing", "123"}
vim.api.nvim_buf_set_lines(bufnr, 0, 1, false, lines)
local locations = {
{
- uri = 'file://fake/uri',
+ uri = 'file:///fake/uri',
range = {
start = { line = 0, character = 2 },
['end'] = { line = 0, character = 3 },
@@ -1558,14 +1559,14 @@ describe('LSP', function()
it('Convert LocationLink[] to items', function()
local expected = {
{
- filename = 'fake/uri',
+ filename = '/fake/uri',
lnum = 1,
col = 3,
text = 'testing'
},
}
local actual = exec_lua [[
- local bufnr = vim.uri_to_bufnr("file://fake/uri")
+ local bufnr = vim.uri_to_bufnr("file:///fake/uri")
local lines = {"testing", "123"}
vim.api.nvim_buf_set_lines(bufnr, 0, 1, false, lines)
local locations = {
@@ -1779,14 +1780,14 @@ describe('LSP', function()
local expected = {
{
col = 1,
- filename = 'test_a',
+ filename = '/test_a',
kind = 'File',
lnum = 2,
text = '[File] TestA'
},
{
col = 1,
- filename = 'test_b',
+ filename = '/test_b',
kind = 'Module',
lnum = 4,
text = '[Module] TestB'
@@ -1809,7 +1810,7 @@ describe('LSP', function()
line = 2
}
},
- uri = "file://test_a"
+ uri = "file:///test_a"
},
contanerName = "TestAContainer"
},
@@ -1828,7 +1829,7 @@ describe('LSP', function()
line = 4
}
},
- uri = "file://test_b"
+ uri = "file:///test_b"
},
contanerName = "TestBContainer"
}
@@ -1867,7 +1868,7 @@ describe('LSP', function()
before_each(function()
target_bufnr = exec_lua [[
- local bufnr = vim.uri_to_bufnr("file://fake/uri")
+ local bufnr = vim.uri_to_bufnr("file:///fake/uri")
local lines = {"1st line of text", "å å ɧ 汉语 ↥ 🤦 🦄"}
vim.api.nvim_buf_set_lines(bufnr, 0, 1, false, lines)
return bufnr
@@ -1876,7 +1877,7 @@ describe('LSP', function()
local location = function(start_line, start_char, end_line, end_char)
return {
- uri = "file://fake/uri",
+ uri = "file:///fake/uri",
range = {
start = { line = start_line, character = start_char },
["end"] = { line = end_line, character = end_char },
@@ -1901,7 +1902,7 @@ describe('LSP', function()
it('jumps to a LocationLink', function()
local pos = jump({
- targetUri = "file://fake/uri",
+ targetUri = "file:///fake/uri",
targetSelectionRange = {
start = { line = 0, character = 4 },
["end"] = { line = 0, character = 4 },
@@ -2025,7 +2026,9 @@ describe('LSP', function()
local expected = { {
bufnr = 2,
col = 5,
+ end_col = 0,
lnum = 4,
+ end_lnum = 0,
module = "",
nr = 0,
pattern = "",
@@ -2097,7 +2100,9 @@ describe('LSP', function()
local expected = { {
bufnr = 2,
col = 5,
+ end_col = 0,
lnum = 4,
+ end_lnum = 0,
module = "",
nr = 0,
pattern = "",