add in ionide LSP

This commit is contained in:
Matt Blacker 2024-06-14 10:32:03 +10:00
parent e67c6beb67
commit 32cd02ed62
1 changed files with 91 additions and 1 deletions

View File

@ -437,7 +437,58 @@ require('lazy').setup({
end, { desc = '[S]earch [N]eovim files' })
end,
},
-- lazy.nvim
{
'WillEhrendreich/Ionide-Nvim',
dependencies = {
{
-- highly recommended to use Mason. very nice for lsp/linter/tool installations.
'williamboman/mason.nvim',
opts = {
-- here we make sure fsautocomplete is downloaded by mason, which Ionide absolutely needs in order to work.
ensure_installed = {
'fsautocomplete',
},
},
},
{
-- very recommended to use nvim-lspconfig, as it takes care of much of the management of starting Ionide,
'neovim/nvim-lspconfig',
version = false, -- last release is way too old
opts = {
servers = {
---@type IonideOptions
ionide = {
IonideNvimSettings = {},
cmd = {
vim.fs.normalize(vim.fn.stdpath 'data' .. '/mason/bin/fsautocomplete.cmd'),
},
settings = {
FSharp = {},
},
},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
--- ***VERY IMPORTANT***
--- if you don't wan't both ionide AND fsautocomplete to
---attach themselves to every fsharp file (you don't, trust me), you
--- need to make sure that fsautocomplete doesn't get it's setup function called.
--- from within a lazy.nvim setup it simply means that you do the following:
fsautocomplete = function(_, _)
return true
end,
--- and then pass the opts in from up above.
ionide = function(_, opts)
require('ionide').setup(opts)
end,
},
},
},
},
},
{ -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
@ -453,7 +504,41 @@ require('lazy').setup({
-- `neodev` configures Lua LSP for your Neovim config, runtime and plugins
-- used for completion, annotations and signatures of Neovim apis
{ 'folke/neodev.nvim', opts = {} },
{ 'WillEhrendreich/Ionide-Nvim', opts = {} },
},
opts = {
servers = {
---@type IonideOptions
ionide = {
IonideNvimSettings = {},
cmd = {
vim.fs.normalize(vim.fn.stdpath 'data' .. '/mason/bin/fsautocomplete.cmd'),
},
settings = {
FSharp = {},
},
},
},
-- you can do any additional lsp server setup here
-- return true if you don't want this server to be setup with lspconfig
---@type table<string, fun(server:string, opts:_.lspconfig.options):boolean?>
setup = {
--- ***VERY IMPORTANT***
--- if you don't wan't both ionide AND fsautocomplete to
---attach themselves to every fsharp file (you don't, trust me), you
--- need to make sure that fsautocomplete doesn't get it's setup function called.
--- from within a lazy.nvim setup it simply means that you do the following:
fsautocomplete = function(_, _)
return true
end,
--- and then pass the opts in from up above.
ionide = function(_, opts)
require('ionide').setup(opts)
end,
},
},
config = function()
-- Brief aside: **What is LSP?**
--
@ -637,6 +722,11 @@ require('lazy').setup({
local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, {
'stylua', -- Used to format Lua code
'phpactor',
'tsserver',
'html',
'cssls',
'tailwindcss',
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }