aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetter Wahlman <petter@wahlman.no>2019-11-17 18:38:32 +0100
committerAshkan Kiani <ashkan.k.kiani@gmail.com>2019-11-17 09:38:32 -0800
commit36c89b6902e876587c13538a539e2f177e6deb67 (patch)
tree5b0a93d2908c753c107fca04deacbe3c3a0ef3f8
parentAdd rls support (#24) (diff)
downloadnvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.tar
nvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.tar.gz
nvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.tar.bz2
nvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.tar.lz
nvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.tar.xz
nvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.tar.zst
nvim-lspconfig-36c89b6902e876587c13538a539e2f177e6deb67.zip
Basic support for the ccls language server (#19)
Based on the clangd equivalent
-rw-r--r--lua/nvim_lsp.lua1
-rw-r--r--lua/nvim_lsp/ccls.lua30
2 files changed, 31 insertions, 0 deletions
diff --git a/lua/nvim_lsp.lua b/lua/nvim_lsp.lua
index d892f696..ed8e979a 100644
--- a/lua/nvim_lsp.lua
+++ b/lua/nvim_lsp.lua
@@ -1,5 +1,6 @@
local skeleton = require 'nvim_lsp/skeleton'
require 'nvim_lsp/bashls'
+require 'nvim_lsp/ccls'
require 'nvim_lsp/clangd'
require 'nvim_lsp/elmls'
require 'nvim_lsp/gopls'
diff --git a/lua/nvim_lsp/ccls.lua b/lua/nvim_lsp/ccls.lua
new file mode 100644
index 00000000..88795526
--- /dev/null
+++ b/lua/nvim_lsp/ccls.lua
@@ -0,0 +1,30 @@
+local skeleton = require 'nvim_lsp/skeleton'
+local util = require 'nvim_lsp/util'
+local lsp = vim.lsp
+
+skeleton.ccls = {
+ default_config = util.utf8_config {
+ cmd = {"ccls"};
+ filetypes = {"c", "cpp", "objc", "objcpp"};
+ root_dir = util.root_pattern("compile_commands.json", "compile_flags.txt", ".git");
+ log_level = lsp.protocol.MessageType.Warning;
+ settings = {};
+ };
+ -- commands = {};
+ -- on_new_config = function(new_config) end;
+ -- on_attach = function(client, bufnr) end;
+ docs = {
+ description = [[
+https://github.com/MaskRay/ccls/wiki
+
+ccls relies on a [JSON compilation database](https://clang.llvm.org/docs/JSONCompilationDatabase.html) specified
+as compile_commands.json or, for simpler projects, a compile_flags.txt.
+]];
+ default_config = {
+ root_dir = [[root_pattern("compile_commands.json", "compile_flags.txt", ".git")]];
+ on_init = [[function to handle changing offsetEncoding]];
+ capabilities = [[default capabilities, with offsetEncoding utf-8]];
+ };
+ };
+}
+-- vim:et ts=2 sw=2