## Description
A common use of `on_new_config` is to construct the `cmd` for starting
language servers based on the configuration. These language servers
require that the settings are finalized before it is run. It looks like
previous commits did use `add_hook_before` for the `lspconfig`
integration but it got moved to being `add_hook_after` when centralizing
it with the `lua_ls` and `jsonls` plugin integrations. We should revert
this back to `add_hook_before` so that the existing `on_new_config`
functions continue working.
## Description
After updating lspconfig, there is an error when I tried to open
`neoconf.json`.
The reason is that `lspconfig.util.available_servers` has been renamed
to `lspconfig.util._available_servers`.
([link](e118ce58da))
I fixed the issue and also update the deprecated code which is also come
from lspconfig.util
([details](0e234f4cad/lua/lspconfig/util.lua (L359-L362)))
<details>
<summary>error detail</summary>
```
Error 22:01:18 notify.error settings.nvim Failed to run client.before_init for settings/plugins/jsonls
....local/share/nvim/lazy/neoconf.nvim/lua/neoconf/util.lua:36: attempt to call field 'available_servers' (a nil value)
stack traceback:
...nvim/lazy/neoconf.nvim/lua/neoconf/plugins/lspconfig.lua:14: in function <...nvim/lazy/neoconf.nvim/lua/neoconf/plugins/lspconfig.lua:8>
...hare/nvim/lazy/neoconf.nvim/lua/neoconf/plugins/init.lua:14: in function 'fire'
...hare/nvim/lazy/neoconf.nvim/lua/neoconf/plugins/init.lua:20: in function 'fire'
...ocal/share/nvim/lazy/neoconf.nvim/lua/neoconf/schema.lua:45: in function 'get'
...re/nvim/lazy/neoconf.nvim/lua/neoconf/plugins/jsonls.lua:22: in function 'on_config'
....local/share/nvim/lazy/neoconf.nvim/lua/neoconf/util.lua:49: in function <....local/share/nvim/lazy/neoconf.nvim/lua/neoconf/util.lua:48>
[C]: in function 'func'
...al/share/nvim/lazy/nvim-lspconfig/lua/lspconfig/util.lua:53: in function <...al/share/nvim/lazy/nvim-lspconfig/lua/lspconfig/util.lua:51>
[C]: in function 'pcall'
...share/nvim/lazy/nvim-lspconfig/lua/lspconfig/configs.lua:217: in function 'make_config'
...share/nvim/lazy/nvim-lspconfig/lua/lspconfig/manager.lua:160: in function 'add'
...share/nvim/lazy/nvim-lspconfig/lua/lspconfig/manager.lua:220: in function <...share/nvim/lazy/nvim-lspconfig/lua/lspconfig/manager.lua:207>
[C]: in function 'pcall'
...l/share/nvim/lazy/nvim-lspconfig/lua/lspconfig/async.lua:5: in function <...l/share/nvim/lazy/nvim-lspconfig/lua/lspconfig/async.lua:4>
```
</details>
## Related Issue(s)
## Screenshots

according to
e118ce58da
## Description
<!-- Describe the big picture of your changes to communicate to the
maintainers
why we should accept this pull request. -->
fixed _available_servers is nil bug.
## Related Issue(s)
https://github.com/folke/neoconf.nvim/issues/104
<!--
If this PR fixes any issues, please link to the issue here.
- Fixes #<issue_number>
-->
## Screenshots
<!-- Add screenshots of the changes if applicable. -->
This does make the neovim requirement for health 0.9.0, but
nvim-treesitter will soon deprecate most of its "plugin" functionality
and solely serve as an installer of parsers, and any plugin
functionality should rely on the upstream `vim.treesitter` module
Removes usage of several deprecated API functions, and changes all uses
of `vim.loop` to `vim.uv`.
Now that 0.10 is released, several functions used here have been
deprecated and show warnings when they're first called.
I've updated:
- `lsp.get_active_clients()` -> `lsp.get_clients()`
- `api.nvim_buf_set_option` -> `api.nvim_set_option_value` with
buf-local scope
- `api.nvim_win_set_option` -> `api.nvim_set_option_value` with
window-local scope
- `vim.tbl_flatten` -> `vim.iter(t):flatten():totable()`
- `vim.loop.*` -> `vim.uv.*`
- `vim.islist or vim.tbl_islist` -> `vim.islist`
---------
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
This fixes a few issues relating to the CI json schema generation.
- befcc1f452e2226d329b67b0510bd5f2e4a75591 fixes#60, and also fixes
several other servers that previously had an empty `properties` in the
schema. This happened because `c.properties` is a table, which means
`vim.list_extend` doesn't do anything. `properties` should also always
be an object and not an array, so `vim.empty_dict()` is now being used
to prevent outputting `[]` when `properties` is empty.
- 84e19f41b4c0ad6865fdc61f62bae5cff496b71f embeds `index.json` rather
than downloading it every time. As mentioned in #54, the gist is no
longer maintained, so there's no reason to download it anymore. In the
future this should probably be [sourced from
elsewhere](https://gist.github.com/williamboman/a01c3ce1884d4b57cc93422e7eae7702?permalink_comment_id=4689512).
- 2a911fd425dabc54847d61c387fabb4cd572907e fixes the URL for Volar.
- 6dfd503dc5a09a040dab00c2922d4d4e0f9374b5 is just me running the build
step locally. If I shouldn't have done this I'm happy to revert it.
Fixes#52Fixes#60
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>