aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorHirokazu Hata <h.hata.ai.t@gmail.com>2020-11-16 12:33:45 +0900
committerGitHub <noreply@github.com>2020-11-16 12:33:45 +0900
commitdf9cd18ef45a23f1d461997e11e3e387758c5edd (patch)
tree977b85e1e744a6d3907d49595ec7f566fa9f177d /lua
parentMerge pull request #399 from Iron-E/patch-1 (diff)
parentnvim_lsp -> lspconfig (diff)
downloadnvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.tar
nvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.tar.gz
nvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.tar.bz2
nvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.tar.lz
nvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.tar.xz
nvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.tar.zst
nvim-lspconfig-df9cd18ef45a23f1d461997e11e3e387758c5edd.zip
Merge pull request #303 from mjlbach/feature/add-pyright-languageserver
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim_lsp/pyright.lua40
1 files changed, 40 insertions, 0 deletions
diff --git a/lua/nvim_lsp/pyright.lua b/lua/nvim_lsp/pyright.lua
new file mode 100644
index 00000000..f2d0084f
--- /dev/null
+++ b/lua/nvim_lsp/pyright.lua
@@ -0,0 +1,40 @@
+local configs = require 'lspconfig/configs'
+local util = require 'lspconfig/util'
+
+local server_name = "pyright"
+
+local installer = util.npm_installer {
+ server_name = server_name;
+ packages = {server_name};
+ binaries = {server_name};
+}
+
+configs[server_name] = {
+ default_config = {
+ cmd = {"pyright-langserver", "--stdio"};
+ filetypes = {"python"};
+ root_dir = util.root_pattern(".git", "setup.py", "setup.cfg", "pyproject.toml", "requirements.txt");
+ settings = {
+ analysis = { autoSearchPaths= true; };
+ pyright = { useLibraryCodeForTypes = true; };
+ };
+ -- The following before_init function can be removed once https://github.com/neovim/neovim/pull/12638 is merged
+ before_init = function(initialize_params)
+ initialize_params['workspaceFolders'] = {{
+ name = 'workspace',
+ uri = initialize_params['rootUri']
+ }}
+ end
+ };
+ docs = {
+ description = [[
+https://github.com/microsoft/pyright
+
+`pyright`, a static type checker and language server for python
+]];
+ };
+}
+
+configs[server_name].install = installer.install
+configs[server_name].install_info = installer.info
+-- vim:et ts=2 sw=2