aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorBarrOff <58253563+BarrOff@users.noreply.github.com>2024-02-24 12:48:00 +0000
committerGitHub <noreply@github.com>2024-02-24 20:48:00 +0800
commit6b264ff251eafd2ab30caa76b9920da504a9417f (patch)
treeb8217ef9e522ea36007acef1eac84af6b3f06a28 /lua
parentdocs: update server_configurations.md (diff)
downloadnvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.tar
nvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.tar.gz
nvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.tar.bz2
nvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.tar.lz
nvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.tar.xz
nvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.tar.zst
nvim-lspconfig-6b264ff251eafd2ab30caa76b9920da504a9417f.zip
feat: add bqnlsp support (#3024)
* feat: add bqnlsp support * chore(bqnlsp): fix typo in documentation comment
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig/server_configurations/bqnlsp.lua43
1 files changed, 43 insertions, 0 deletions
diff --git a/lua/lspconfig/server_configurations/bqnlsp.lua b/lua/lspconfig/server_configurations/bqnlsp.lua
new file mode 100644
index 00000000..88aea6b9
--- /dev/null
+++ b/lua/lspconfig/server_configurations/bqnlsp.lua
@@ -0,0 +1,43 @@
+local util = require 'lspconfig.util'
+
+-- set os dependent library path
+local function library_path(path)
+ path = path or '/usr/local/lib'
+ if vim.fn.has 'macunix' then
+ return { DYLD_LIBRARY_PATH = path }
+ elseif vim.fn.has 'linux' then
+ return { LD_LIBRARY_PATH = path }
+ end
+end
+
+return {
+ default_config = {
+ cmd = { 'bqnlsp' },
+ filetypes = { 'bqn' },
+ root_dir = util.find_git_ancestor,
+ single_file_support = true,
+ libcbqnPath = nil,
+ on_new_config = function(new_config, _)
+ if new_config.libcbqnPath then
+ new_config.cmd_env = library_path(new_config.libcbqnPath)
+ end
+ end,
+ },
+ docs = {
+ description = [[
+https://git.sr.ht/~detegr/bqnlsp
+
+
+`bqnlsp`, a language server for BQN.
+
+The binary depends on the shared library of [CBQN](https://github.com/dzaima/CBQN) `libcbqn.so`.
+If CBQN is installed system-wide (using `sudo make install` in its source directory) and `bqnlsp` errors that it can't find the shared library, update the linker cache by executing `sudo ldconfig`.
+If CBQN has been installed in a non-standard directory or can't be installed globally pass `libcbqnPath = '/path/to/CBQN'` to the setup function.
+This will set the environment variables `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) to the provided path.
+
+ ]],
+ default_config = {
+ root_dir = [[util.find_git_ancestor]],
+ },
+ },
+}