home
NOTE: Under Construction - I'm in the middle of upgrading my site and lots of stuff is kinda broken. Please forgive the mess.

Attached A Neovim Buffer To An LSP Based Off File Extension

I'm working on an LSP to use with Neopolitan in Neovim. The first hurdle was figuring out how to attach a file to the LSP. This is how I'm doing it.

September 2023
Code
vim.api.nvim_create_autocmd("BufReadPost", {
  pattern = "*.tmp",
  group = vim.api.nvim_create_augroup("LSPTestGroup", { clear = true }),
  callback = function() 
    vim.lsp.start({
      name = 'neopolitan',
      cmd = {'/Users/alan/workshop/neopolitan-lsp/target/debug/nrs-language-server'},
      root_dir = vim.fs.dirname(vim.fs.find({'Cargo.toml'}, { upward = true })[1]),
    })
  end,
})
═══ § ═══

Footnotes And References