Skip to content

Commit

Permalink
Rename nvim_lsp to lspconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
h-michael committed Sep 6, 2020
1 parent bd7127d commit ddcd9e6
Show file tree
Hide file tree
Showing 66 changed files with 212 additions and 212 deletions.
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ parlance here is the "spec":
The `configs.__newindex` metamethod consumes the config definition and returns
an object with a `setup()` method, to be invoked by users:

require'nvim_lsp'.SERVER_NAME.setup{}
require'lspconfig'.SERVER_NAME.setup{}

After you set `configs.SERVER_NAME` you can add arbitrary language-specific
functions to it if necessary.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
function! health#nvim_lsp#check()
function! health#lspconfig#check()
call health#report_start('Checking language server protocol configuration')
lua require 'nvim_lsp/health'.check_health()
lua require 'lspconfig/health'.check_health()
endfunction
16 changes: 8 additions & 8 deletions lua/nvim_lsp.lua → lua/lspconfig.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local configs = require 'nvim_lsp/configs'
local configs = require 'lspconfig/configs'

local M = {
util = require 'nvim_lsp/util';
util = require 'lspconfig/util';
}

function M.available_servers()
Expand All @@ -17,14 +17,14 @@ function M.installable_servers()
end

M._root = {}
-- Called from plugin/nvim_lsp.vim because it requires knowing that the last
-- script in scriptnames to be executed is nvim_lsp.
-- Called from plugin/lspconfig.vim because it requires knowing that the last
-- script in scriptnames to be executed is lspconfig.
function M._root._setup()
M._root.commands = {
LspInstall = {
function(name)
if configs[name] == nil then
pcall(require('nvim_lsp/'..name))
pcall(require('lspconfig/'..name))
end
local config = configs[name]
if not config then
Expand All @@ -40,7 +40,7 @@ function M._root._setup()
end;
"-nargs=1";
"-complete=custom,v:lua.lsp_complete_installable_servers";
description = '`:LspInstall {name}` installs a server under stdpath("cache")/nvim_lsp/{name}';
description = '`:LspInstall {name}` installs a server under stdpath("cache")/lspconfig/{name}';
};
LspInstallInfo = {
function(name)
Expand All @@ -54,7 +54,7 @@ function M._root._setup()
return print(vim.inspect(res))
end
if configs[name] == nil then
pcall(require('nvim_lsp/'..name))
pcall(require('lspconfig/'..name))
end
local config = configs[name]
if not config then
Expand All @@ -74,7 +74,7 @@ end
local mt = {}
function mt:__index(k)
if configs[k] == nil then
require('nvim_lsp/'..k)
require('lspconfig/'..k)
end
return configs[k]
end
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim_lsp/als.lua → lua/lspconfig/als.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local server_name = 'als'
local bin_name = 'ada_language_server'

Expand Down Expand Up @@ -83,7 +83,7 @@ Ada language server. Use `LspInstall als` to install it.
Can be configured by passing a "settings" object to `als.setup{}`:
```lua
require('nvim_lsp').als.setup{
require('lspconfig').als.setup{
settings = {
ada = {
projectFile = "project.gpr";
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/angularls.lua → lua/lspconfig/angularls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = 'angularls'
local bin_name = server_name
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/bashls.lua → lua/lspconfig/bashls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "bashls"
local bin_name = "bash-language-server"
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/ccls.lua → lua/lspconfig/ccls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.ccls = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/clangd.lua → lua/lspconfig/clangd.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

-- https://clangd.llvm.org/extensions.html#switch-between-sourceheader
local function switch_source_header(bufnr)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.clojure_lsp = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/cmake.lua → lua/lspconfig/cmake.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.cmake = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/codeqlls.lua → lua/lspconfig/codeqlls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require "nvim_lsp/configs"
local util = require "nvim_lsp/util"
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "codeqlls"

Expand Down
6 changes: 3 additions & 3 deletions lua/nvim_lsp/configs.lua → lua/lspconfig/configs.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local util = require 'nvim_lsp/util'
local util = require 'lspconfig/util'
local api, validate, lsp = vim.api, vim.validate, vim.lsp
local tbl_extend = vim.tbl_extend

Expand Down Expand Up @@ -99,7 +99,7 @@ function configs.__newindex(t, config_name, config_def)
trigger = "BufReadPost *"
end
api.nvim_command(string.format(
"autocmd %s lua require'nvim_lsp'[%q].manager.try_add()"
"autocmd %s lua require'lspconfig'[%q].manager.try_add()"
, trigger
, config.name
))
Expand Down Expand Up @@ -154,7 +154,7 @@ function configs.__newindex(t, config_name, config_def)
M._setup_buffer(client.id)
else
api.nvim_command(string.format(
"autocmd BufEnter <buffer=%d> ++once lua require'nvim_lsp'[%q]._setup_buffer(%d)"
"autocmd BufEnter <buffer=%d> ++once lua require'lspconfig'[%q]._setup_buffer(%d)"
, bufnr
, config_name
, client.id
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/cssls.lua → lua/lspconfig/cssls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "cssls"
local bin_name = "css-languageserver"
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim_lsp/dartls.lua → lua/lspconfig/dartls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local nvim_lsp = require 'nvim_lsp'
local configs = require 'nvim_lsp/configs'
local util = require 'lspconfig/util'
local configs = require 'lspconfig/configs'

local server_name = "dartls"
local bin_name = "dart"
Expand Down Expand Up @@ -31,7 +31,7 @@ configs[server_name] = {
default_config = {
cmd = {bin_name, analysis_server_snapshot_path(), "--lsp"};
filetypes = {"dart"};
root_dir = nvim_lsp.util.root_pattern("pubspec.yaml");
root_dir = util.root_pattern("pubspec.yaml");
init_options = {
onlyAnalyzeProjectsWithOpenFiles = "false",
suggestFromUnimportedLibraries = "true",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "diagnosticls"
local bin_name = "diagnostic-languageserver"
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/dockerls.lua → lua/lspconfig/dockerls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "dockerls"
local bin_name = "docker-langserver"
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/efm.lua → lua/lspconfig/efm.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "efm"
local bin_name = "efm-langserver"
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim_lsp/elixirls.lua → lua/lspconfig/elixirls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "elixirls"
local bin_name = "elixir-ls"
Expand Down Expand Up @@ -90,7 +90,7 @@ This language server does not provide a global binary, but must be installed man
Fetching the elixir-ls repository from GitHub, compiling it and then installing it.
```lua
require'nvim_lsp'.elixirls.setup{
require'lspconfig'.elixirls.setup{
-- Unix
cmd = { "path/to/language_server.sh" };
-- Windows
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/elmls.lua → lua/lspconfig/elmls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local lsp = vim.lsp
local api = vim.api

Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/flow.lua → lua/lspconfig/flow.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.flow = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/fortls.lua → lua/lspconfig/fortls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.fortls = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/gdscript.lua → lua/lspconfig/gdscript.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.gdscript = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/ghcide.lua → lua/lspconfig/ghcide.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.ghcide = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/gopls.lua → lua/lspconfig/gopls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.gopls = {
default_config = {
Expand Down
2 changes: 1 addition & 1 deletion lua/nvim_lsp/health.lua → lua/lspconfig/health.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local M = {}
function M.check_health()
local configs = require 'nvim_lsp/configs'
local configs = require 'lspconfig/configs'

for _, top_level_config in pairs(configs) do
-- If users execute `:LspInstall` or `:LspInstallInfo`,
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/hie.lua → lua/lspconfig/hie.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.hie = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/hls.lua → lua/lspconfig/hls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.hls = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/html.lua → lua/lspconfig/html.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "html"
local bin_name = "html-languageserver"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "intelephense"
local bin_name = "intelephense"
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/jdtls.lua → lua/lspconfig/jdtls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local callbacks = require 'vim.lsp.callbacks'
local path = util.path

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
local configs = require 'nvim_lsp/configs'
local configs = require 'lspconfig/configs'

configs.jedi_language_server = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/jsonls.lua → lua/lspconfig/jsonls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local server_name = "jsonls"
local bin_name = "vscode-json-languageserver"
Expand Down
6 changes: 3 additions & 3 deletions lua/nvim_lsp/julials.lua → lua/lspconfig/julials.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

local environment_directory = util.path.join(util.base_install_dir, "julials")

Expand Down Expand Up @@ -36,7 +36,7 @@ julia --project=]] .. environment_directory .. [[ -e 'using Pkg; Pkg.add("Langua
```
If you want to install the LanguageServer manually, you will have to ensure that the Julia environment is stored in this location:
```vim
:lua print(require'nvim_lsp'.util.path.join(require'nvim_lsp'.util.base_install_dir, "julials"))
:lua print(require'lspconfig'.util.path.join(require'lspconfig'.util.base_install_dir, "julials"))
```
]];
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
--- https://github.com/udalov/kotlin-vim (recommended)
--- Note that there is no LICENSE specified yet.

local util = require 'nvim_lsp/util'
local configs = require 'nvim_lsp/configs'
local util = require 'lspconfig/util'
local configs = require 'lspconfig/configs'

configs.kotlin_language_server = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/leanls.lua → lua/lspconfig/leanls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.leanls = {
default_config = {
Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/metals.lua → lua/lspconfig/metals.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'
local server_name = "metals"
local bin_name = "metals"

Expand Down
4 changes: 2 additions & 2 deletions lua/nvim_lsp/nimls.lua → lua/lspconfig/nimls.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local configs = require 'nvim_lsp/configs'
local util = require 'nvim_lsp/util'
local configs = require 'lspconfig/configs'
local util = require 'lspconfig/util'

configs.nimls = {
default_config = {
Expand Down
Loading

0 comments on commit ddcd9e6

Please sign in to comment.