diff --git a/init.lua b/init.lua index fac323d2..3f9c68f2 100644 --- a/init.lua +++ b/init.lua @@ -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 + 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 + 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 }