https://www.boundaryml.com logo
🟡 Does anyone have a good setup for vim enjoooyer...
# questions
e
Does anyone have a good setup for vim enjoooyers?
g
I have a hacky setup for the BAML lsp in neovim. We have playground support on the roadmap.
Are you more interested in the LSP or the playground?
e
Would be awesome to have both but can settle for LSP and just using the
test
command
g
In my ~/.config/nvim/init.lua I have:
Copy code
require'lspconfig'.pyright.setup{}
require'lspconfig'.baml.setup{}
require('vim.lsp.log').set_format_func(vim.inspect)

vim.filetype.add({
  extension = {
    baml = "baml",
  },
})
vim.lsp.set_log_level("debug")
And then in ~/.config/nvim/pack/nvim/start/nvim-lspconfig/lua/lspconfig/configs/baml.lua I have
Copy code
local util = require 'lspconfig.util'

return {
  default_config = {
    cmd = { '/Users/greghale/code/baml/engine/target/debug/baml-cli', 'lsp' },
    filetypes = { 'baml' },
    root_dir = util.root_pattern('.git', '*.baml'),
    single_file_support = true,
  },
  docs = {
    description = [[
https://github.com/boundaryml/baml

Language Server for BAML.
]],
  },
}
(Be sure to change the path to baml-cli)
This setup is not great. For the officially supported editors, we automatically download the correct baml-cli for the version you specify in your generators, and there's no such nicety here 🙁
e
Awesome. Thanks!