aboutsummaryrefslogtreecommitdiff
path: root/test/functional/fixtures
diff options
context:
space:
mode:
authorMichal Liszcz <liszcz.michal@gmail.com>2023-03-09 15:12:56 +0100
committerGitHub <noreply@github.com>2023-03-09 06:12:56 -0800
commit9ef7297ef142354ace8b1f3f277d0eee3cfdc6d4 (patch)
tree317cfc799191e044e1fc9452ef40ca24376fcbb1 /test/functional/fixtures
parentce0fddf5ae334f0c79dcd95b379999e11df1486b (diff)
downloadrneovim-9ef7297ef142354ace8b1f3f277d0eee3cfdc6d4.tar.gz
rneovim-9ef7297ef142354ace8b1f3f277d0eee3cfdc6d4.tar.bz2
rneovim-9ef7297ef142354ace8b1f3f277d0eee3cfdc6d4.zip
feat(lsp): overwrite omnifunc/tagfunc set by ftplugin #22267
Problem: Some built-in ftplugins set omnifunc/tagfunc/formatexpr which causes lsp.lua:set_defaults() to skip setup of defaults for those filetypes. For example the C++ ftplugin has: omnifunc=ccomplete#Complete Last set from /usr/share/nvim/runtime/ftplugin/c.vim line 30 so the changes done in #95c65a6b221fe6e1cf91e8322e7d7571dc511a71 will always be skipped for C++ files. Solution: Overwrite omnifunc/tagfunc/formatexpr options that were set by stock ftplugin. Fixes #21001
Diffstat (limited to 'test/functional/fixtures')
-rw-r--r--test/functional/fixtures/fake-lsp-server.lua17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/functional/fixtures/fake-lsp-server.lua b/test/functional/fixtures/fake-lsp-server.lua
index dbb66a42e8..9cc2f6fa27 100644
--- a/test/functional/fixtures/fake-lsp-server.lua
+++ b/test/functional/fixtures/fake-lsp-server.lua
@@ -932,6 +932,23 @@ function tests.basic_formatting()
}
end
+function tests.set_defaults_all_capabilities()
+ skeleton {
+ on_init = function(_)
+ return {
+ capabilities = {
+ definitionProvider = true,
+ completionProvider = true,
+ documentRangeFormattingProvider = true,
+ }
+ }
+ end;
+ body = function()
+ notify('test')
+ end;
+ }
+end
+
-- Tests will be indexed by test_name
local test_name = arg[1]
local timeout = arg[2]