From 09e5cd383f17481ad940ccb1c029682486647189 Mon Sep 17 00:00:00 2001 From: jiriks74 Date: Wed, 6 Mar 2024 21:36:22 +0100 Subject: [PATCH] feat: add asm-lsp setup --- nix/neovim-overlay.nix | 2 ++ nvim/ftplugin/asm.lua | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 nvim/ftplugin/asm.lua diff --git a/nix/neovim-overlay.nix b/nix/neovim-overlay.nix index d162e46..841f2ef 100644 --- a/nix/neovim-overlay.nix +++ b/nix/neovim-overlay.nix @@ -46,6 +46,7 @@ with final.pkgs.lib; let cmp-cmdline-history # cmp command line history suggestions copilot-lua # Github Copilot https://github.com/zbirenbaum/copilot.lua/ copilot-cmp # Add Copilot as a cmp source # https://github.com/zbirenbaum/copilot-cmp/ + # nvim-lspconfig # ^ nvim-cmp extensions # git integration plugins @@ -99,6 +100,7 @@ with final.pkgs.lib; let extraPackages = with pkgs; [ # language servers, etc. clang-tools + asm-lsp # Assembly language server lua-language-server nil # nix LSP nodejs_20 diff --git a/nvim/ftplugin/asm.lua b/nvim/ftplugin/asm.lua new file mode 100644 index 0000000..17ceae7 --- /dev/null +++ b/nvim/ftplugin/asm.lua @@ -0,0 +1,20 @@ +-- Exit if the language server isn't available +if vim.fn.executable('asm-lsp') ~= 1 then + return +end + +-- require'lspconfig'.asm_lsp.setup{} + +local root_files = { + '.asm-lsp.toml', + '.vscode', + '.git', +} + +vim.lsp.start { + name = 'asm-lsp', + cmd = { 'asm-lsp' }, + root_dir = vim.fs.dirname(vim.fs.find(root_files, { upward = true })[1]), + capabilities = require('user.lsp').make_client_capabilities(), + -- capabilities = { offsetEncoding = "utf-8" }, +}