Commit graph

26 commits

Author SHA1 Message Date
Emilio Ziniades
7384e7149e
fix: util.root_pattern prioritises pattern order (#2885)
* fix: util.root_pattern prioritises pattern order

Instead of traversing the filesystem upwards once and
returning the first match of all the patterns, it traverses
the filesystem upwards once for each pattern. This means
that the order of the patterns provided matters, and the
highest priority patterns should be put first. Also updated
corresponding tests.

* docs: update util.root_pattern description
2023-11-18 15:40:13 +08:00
Raphael
13e86cb91e
test: remove test depend and use vusted (#2603) 2023-05-11 14:48:48 +08:00
figsoda
6669f2d8eb
feat: rename sumneko_lua -> lua_ls (#2439)
* feat: rename sumneko_lua -> lua_language_server

* refactor(sumneko_lua): use vim.deprecate

* refactor: handle deprecated server aliases in one place

* refactor: put server aliases in a function

* feat: rename lua_language_server -> lua_ls
2023-02-12 10:30:20 +08:00
Raphael
64c0222dfc
perf: use the truly minimal test config file (#2269) 2022-12-01 09:58:54 +08:00
emmanueltouzery
8e65dbb6e1
fix: escape wildcards patterns when calling glob (#2111) (#2122) 2022-09-09 20:06:57 +08:00
William Boman
932164a3cc
feat: pass user config to the on_setup hook (#2114)
This is to allow 3rd party plugins to discern between what is
lspconfig's vendored server config and what the user provided.
Currently, these are merged into a single table which is passed to the
on_setup hook. Passing user_config as a 2nd argument would allow 3rd
party plugins to apply a more sensible precedence of configs.
2022-09-08 14:10:59 +08:00
Raphael
b89530f9f8
Revert "fix: remove the config.commands (#2092)" (#2093)
This reverts commit 99e0dc9937.
2022-08-26 21:25:39 +08:00
Raphael
99e0dc9937
fix: remove the config.commands (#2092)
* fix: remove the config.commands

* fix: format by stylua and remove comamnds test

* fix: remove commands from doc

* fix: remove unused function
2022-08-26 20:49:40 +08:00
Ranjith Hegde
fe7a6f41e5
feat!: 0.7 API update (#1984)
* switch to lua api for autocommands
* switch to nvim_create_user_command
* move to lua plugin initialization

NOTICE: Defining commands in server configurations will be deprecated in
future releases.
See `:help lspconfig.txt` to setup the same in an `on_attach` function.

Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com>
2022-08-23 07:03:20 -07:00
Stéphan Kochen
7305324e12
feat: allow attaching to paths inside archives (#1687) 2022-08-23 20:28:28 +08:00
William Boman
6c3cbbc4d5
fix: only consider servers that have been set up as available (#2066)
* test: add failing test

* fix(lspconfig): only consider servers that have been set up as available
2022-08-23 19:20:29 +08:00
Kurtis
7be59acd6e
fix(docs): update example keybindings documentation (#1899) 2022-06-01 07:26:02 -07:00
jdrouhard
b6d9e427c9
feat(configs): use client capabilities by default, deep-extend user-provided capabilities #1889
Previously, vim.lsp.protocol.make_client_capabilities() was used if no
capabilities were specified in either the user-provided config or the
default config (base or server).

Now, the base default config table has a capabilities key with the value
of make_client_capabilities(). When creating the finalized configuration
for a server, it simply uses the finalized config which is the
user-provided config deep extended by the default config (which now
contains the default capabilities).

This means that users will no longer have to create their own customized
capabilities tables seeded from
vim.lsp.protocol.make_client_capabilities(). They simply need to create
the parts that are new or different from the defaults and pass that as
the capabilities. The rest of the defaults are filled in automatically.

For this to work properly, some tbl_extend calls were changed to
tbl_deep_extend. tbl_extend will not recursively update nested tables,
so using it wipes out any server provided defaults in nested config keys
(such as capabilities) and won't properly fill in the "rest" of the
capabilities if the user provided a smaller capabilities key in their
config.

Changing to tbl_deep_extend ensures server-specific configuration values
are preserved and that the finalized config at least contains defaults
for all client-supported capabilities.

For example, clangd's config default has:

```
local default_capabilities = {
  textDocument = {
    completion = {
      editsNearCursor = true,
    },
  },
  offsetEncoding = { 'utf-8', 'utf-16' },
}
```

Prior to this commit, this was the full
vim.lsp.protocol.make_client_capabilities() extended with those extra
values. However, if a user provided their _own_ capabilities to the
setup() function, tbl_extend wiped these extra values out and replaced
it with the users' capabilities, which was likely only
vim.lsp.protocol.make_client_capabilities() with some _other_ tweaks.

Now, clangd can simply provide the extras, and the setup() function will
normalize the config with all of user-provided, server-specific, and
base default capabilities.
2022-05-04 08:26:54 -07:00
Michael Lingelbach
db8357abc0
chore: update minimal init.lua to target 0.6.1 (#1858) 2022-04-25 10:43:40 -04:00
kylo252
486d51cbf4
refactor(tests): simpler temp_dir detection (#1626) 2022-01-02 09:42:14 -05:00
kylo252
4d64e8e1cc
feat: support using minimal_init.lua on windows (#1354)
* let `packpath` use the correct temp folder per platform
* use the appropriate path-separator per platform
2021-11-14 09:47:12 -08:00
Michael Lingelbach
28a8e5258c
chore: update minimal init.lua to use format func (#1314) 2021-10-16 00:40:45 -07:00
Christian Clason
67c41ab1af
chore: make minimal_init.lua more robust (#1131)
1. setting `runtimepath` to `$VIMRUNTIME` _only_  (skipping user plugins but
    still sourcing builtin filetype plugins)
2. putting the `packer_compiled.lua` into a temp directory to avoid clobbering
    the user's own (or, worse, conflicting if they configured a non-standard
    location themselves)
3. updating installed plugins unconditionally (to prevent stale plugins from
    earlier tests)
2021-08-10 11:12:49 -04:00
Michael Lingelbach
cd1ccf056b
chore: change stylua to single quotes (#1068) 2021-07-13 10:41:39 -07:00
Michael Lingelbach
ec11b85df7 ci: lint and format with stylua 2021-07-03 15:49:27 -07:00
Michael Lingelbach
9fe7a37b85 minimal config: make bootstrap on first start 2021-04-03 13:07:37 -07:00
Michael Lingelbach
6a02c860f9 minimal config: update 2021-04-01 00:56:41 -07:00
Michael Lingelbach
aae63b7164 Bump minimal init.lua 2021-03-14 14:23:03 -07:00
Michael Lingelbach
123894205f Issue template: add minimal init.lua to repo and clean up issue template 2021-01-07 01:12:39 -08:00
Hirokazu Hata
ddcd9e6aae
Rename nvim_lsp to lspconfig 2020-09-06 17:49:21 +09:00
Hirokazu Hata
7c1bfdbac5
test: add some test cases util functions 2020-05-21 17:15:44 +09:00