aboutsummaryrefslogtreecommitdiffstats
path: root/lua/nvim_lsp
diff options
context:
space:
mode:
authorHirokazu Hata <h.hata.ai.t@gmail.com>2020-01-01 07:15:50 +0900
committerJustin M. Keyes <justinkz@gmail.com>2019-12-31 14:15:50 -0800
commit10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15 (patch)
tree7eef1897eafc3607927b2006715e4e56b3ecd843 /lua/nvim_lsp
parent[docgen] Update README.md (diff)
downloadnvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.tar
nvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.tar.gz
nvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.tar.bz2
nvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.tar.lz
nvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.tar.xz
nvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.tar.zst
nvim-lspconfig-10d3a9bde1d72bd3dfdbffbc317ef6b36ff9dd15.zip
CI: luacheck #86
Diffstat (limited to 'lua/nvim_lsp')
-rw-r--r--lua/nvim_lsp/intelephense.lua2
-rw-r--r--lua/nvim_lsp/pyls.lua1
-rw-r--r--lua/nvim_lsp/pyls_ms.lua9
-rw-r--r--lua/nvim_lsp/texlab.lua28
-rw-r--r--lua/nvim_lsp/tsserver.lua2
-rw-r--r--lua/nvim_lsp/util.lua30
-rw-r--r--lua/nvim_lsp/vimls.lua1
7 files changed, 35 insertions, 38 deletions
diff --git a/lua/nvim_lsp/intelephense.lua b/lua/nvim_lsp/intelephense.lua
index 077c2aaf..3ea18491 100644
--- a/lua/nvim_lsp/intelephense.lua
+++ b/lua/nvim_lsp/intelephense.lua
@@ -39,7 +39,7 @@ skeleton[server_name] = {
description = [[
https://intelephense.com/
-`intelephense` can be installed via `:LspInstall intelephense` or by yourself with `npm`:
+`intelephense` can be installed via `:LspInstall intelephense` or by yourself with `npm`:
```sh
npm install -g intelephense
```
diff --git a/lua/nvim_lsp/pyls.lua b/lua/nvim_lsp/pyls.lua
index 372385bd..1d4c703c 100644
--- a/lua/nvim_lsp/pyls.lua
+++ b/lua/nvim_lsp/pyls.lua
@@ -1,5 +1,4 @@
local skeleton = require 'nvim_lsp/skeleton'
-local util = require 'nvim_lsp/util'
local lsp = vim.lsp
skeleton.pyls = {
diff --git a/lua/nvim_lsp/pyls_ms.lua b/lua/nvim_lsp/pyls_ms.lua
index 6bd42abb..34c2e4a1 100644
--- a/lua/nvim_lsp/pyls_ms.lua
+++ b/lua/nvim_lsp/pyls_ms.lua
@@ -41,12 +41,13 @@ local function make_installer()
system = 'linux'
elseif vim.fn.has('win32') == 1 then
system = 'win'
- else
+ else
error('Unable to identify host operating system')
end
local url = string.format("https://pvsc.azureedge.net/python-language-server-stable/Python-Language-Server-%s-x64.0.5.10.nupkg", string.lower(system))
- download_cmd = string.format('curl -fLo %s --create-dirs %s', install_info.install_dir .. "/pyls.nupkg", url)
+ local download_cmd = string.format('curl -fLo %s --create-dirs %s', install_info.install_dir .. "/pyls.nupkg", url)
+ local install_cmd = ''
if vim.fn.has('mac') == 1 or vim.fn.has('unix') == 1 then
install_cmd = "unzip " .. install_info.install_dir .. "/pyls.nupkg -d " .. install_info.install_dir
@@ -96,9 +97,9 @@ skeleton[name] = {
installer.configure(config)
end;
init_options = {
- interpreter =
+ interpreter =
{
- properties=
+ properties=
{
InterpreterPath=vim.fn.exepath("python");
Version=get_python_version();
diff --git a/lua/nvim_lsp/texlab.lua b/lua/nvim_lsp/texlab.lua
index ab45d872..79ede52c 100644
--- a/lua/nvim_lsp/texlab.lua
+++ b/lua/nvim_lsp/texlab.lua
@@ -22,14 +22,14 @@ end
-- bufnr isn't actually required here, but we need a valid buffer in order to
-- be able to find the client for buf_request.
-- TODO find a client by looking through buffers for a valid client?
-local function build_cancel_all(bufnr)
- bufnr = util.validate_bufnr(bufnr)
- local params = { token = "texlab-build-*" }
- lsp.buf_request(bufnr, 'window/progress/cancel', params, function(err, method, result, client_id)
- if err then error(tostring(err)) end
- print("Cancel result", vim.inspect(result))
- end)
-end
+-- local function build_cancel_all(bufnr)
+-- bufnr = util.validate_bufnr(bufnr)
+-- local params = { token = "texlab-build-*" }
+-- lsp.buf_request(bufnr, 'window/progress/cancel', params, function(err, method, result, client_id)
+-- if err then error(tostring(err)) end
+-- print("Cancel result", vim.inspect(result))
+-- end)
+-- end
skeleton.texlab = {
default_config = {
@@ -49,14 +49,14 @@ skeleton.texlab = {
executable = nil;
onSave = false;
};
- lint = {
- onChange = false;
+ lint = {
+ onChange = false;
};
};
- bibtex = {
- formatting = {
- lineLength = 120
- };
+ bibtex = {
+ formatting = {
+ lineLength = 120
+ };
};
};
};
diff --git a/lua/nvim_lsp/tsserver.lua b/lua/nvim_lsp/tsserver.lua
index 32c289da..75b8bb98 100644
--- a/lua/nvim_lsp/tsserver.lua
+++ b/lua/nvim_lsp/tsserver.lua
@@ -34,7 +34,7 @@ skeleton[server_name] = {
description = [[
https://github.com/theia-ide/typescript-language-server
-`typescript-language-server` can be installed via `:LspInstall tsserver` or by yourself with `npm`:
+`typescript-language-server` can be installed via `:LspInstall tsserver` or by yourself with `npm`:
```sh
npm install -g typescript-language-server
```
diff --git a/lua/nvim_lsp/util.lua b/lua/nvim_lsp/util.lua
index 9c880d85..73d8e6cf 100644
--- a/lua/nvim_lsp/util.lua
+++ b/lua/nvim_lsp/util.lua
@@ -14,23 +14,23 @@ function M.validate_bufnr(bufnr)
return bufnr == 0 and api.nvim_get_current_buf() or bufnr
end
-function M.add_hook_before(fn, new_fn)
- if fn then
+function M.add_hook_before(func, new_fn)
+ if func then
return function(...)
-- TODO which result?
new_fn(...)
- return fn(...)
+ return func(...)
end
else
return new_fn
end
end
-function M.add_hook_after(fn, new_fn)
- if fn then
+function M.add_hook_after(func, new_fn)
+ if func then
return function(...)
-- TODO which result?
- fn(...)
+ func(...)
return new_fn(...)
end
else
@@ -38,10 +38,6 @@ function M.add_hook_after(fn, new_fn)
end
end
-local function split_lines(s)
- return vim.split(s, "\n", true)
-end
-
function M.tbl_deep_extend(dst, ...)
validate { dst = { dst, 't' } }
for i = 1, select("#", ...) do
@@ -247,11 +243,11 @@ function M.server_per_root_dir_manager(make_config)
return manager
end
-function M.search_ancestors(startpath, fn)
- validate { fn = {fn, 'f'} }
- if fn(startpath) then return startpath end
+function M.search_ancestors(startpath, func)
+ validate { func = {func, 'f'} }
+ if func(startpath) then return startpath end
for path in M.path.iterate_parents(startpath) do
- if fn(path) then return path end
+ if func(path) then return path end
end
end
@@ -299,9 +295,9 @@ local function validate_string_list(t)
return true
end
-local function map_list(t, fn)
+local function map_list(t, func)
local res = {}
- for i, v in ipairs(t) do table.insert(res, fn(v, i)) end
+ for i, v in ipairs(t) do table.insert(res, func(v, i)) end
return res
end
@@ -385,6 +381,8 @@ function M.sh(script, cwd)
local stdin = uv.new_pipe(false)
local stdout = uv.new_pipe(false)
local stderr = uv.new_pipe(false)
+
+ -- luacheck: no unused
local handle, pid
handle, pid = uv.spawn("sh", {
stdio = {stdin, stdout, stderr};
diff --git a/lua/nvim_lsp/vimls.lua b/lua/nvim_lsp/vimls.lua
index eaee5216..c16e4fdf 100644
--- a/lua/nvim_lsp/vimls.lua
+++ b/lua/nvim_lsp/vimls.lua
@@ -1,7 +1,6 @@
local skeleton = require "nvim_lsp/skeleton"
local util = require "nvim_lsp/util"
local lsp = vim.lsp
-local api = vim.api
local server_name = "vimls"
local bin_name = "vim-language-server"