y@
y@4mo ago

Neovim setup with LSP formatting & linting

hello, I am trying to set up the fmt & linting using nvim-lspconfig with neovim Anyone know how i set it so that I format using the deno.json file? here is a link to my dotfiles
GitHub
dotfiles/environments/WyatSoule/common/nvim at master · DustinMEast...
Files used to set a system up with my preferred applications and configuration. - DustinMEastway/dotfiles
4 Replies
Deno AI Helper
Deno AI Helper4mo ago
I wasn't able to find the answer to your question in the official Deno documentation. However, based on your message, I can provide some general advice on setting up formatting with Deno in Neovim using nvim-lspconfig. To configure Neovim to format your code using the settings from a deno.json file, you would typically need to ensure that the Deno language server is properly set up in your Neovim configuration. This usually involves adding a configuration block for Deno in your init.vim or init.lua file, depending on which configuration language you are using. Here's an example of how you might set up the Deno language server in Lua:
require'lspconfig'.denols.setup {
-- Add your configuration settings here
init_options = {
lint = true,
unstable = true,
},
root_dir = require'lspconfig'.util.root_pattern("deno.json", "deno.jsonc"),
}
require'lspconfig'.denols.setup {
-- Add your configuration settings here
init_options = {
lint = true,
unstable = true,
},
root_dir = require'lspconfig'.util.root_pattern("deno.json", "deno.jsonc"),
}
This configuration tells the Deno language server to use the deno.json or deno.jsonc file in the root of your project to configure the Deno runtime. Please note that this advice is not based on the Deno documentation, and you should double-check the accuracy of this advice. Additionally, since I don't have access to external links, I cannot review your dotfiles directly. Make sure to consult the nvim-lspconfig documentation and the Deno manual for more detailed instructions on integrating Deno with Neovim's LSP.
kaiju
kaiju4mo ago
I find the setup easy with coc.nvim along with coc-deno extension. I Personally found it a bit challenging, so I skipped nvim-lspconfig. But if you want to try coc, here's a short reference on how to set it up ->.
GitHub
GitHub - neoclide/coc.nvim: Nodejs extension host for vim & neovim,...
Nodejs extension host for vim & neovim, load extensions like VSCode and host language servers. - neoclide/coc.nvim
GitHub
GitHub - fannheyward/coc-deno: Deno extension for coc.nvim
Deno extension for coc.nvim. Contribute to fannheyward/coc-deno development by creating an account on GitHub.
y@
y@3mo ago
awesome! thank you. I was able to get it with my nvim-lspconfig but it is still giving some issues so i will probably either convert over to coc, or I will check out biomejs
Chiezo
Chiezo3mo ago
GitHub
dotlua/lua/rc/lspconfig/init.lua at main · hasundue/dotlua
Chiezo's Neovim configuration. Contribute to hasundue/dotlua development by creating an account on GitHub.