From 4ee4e171d9e9ef0bd28b35d38524e24517aad890 Mon Sep 17 00:00:00 2001 From: muneebusmani Date: Mon, 10 Jun 2024 15:31:00 +0500 Subject: [PATCH] feat(extras): Added fsharp support --- lua/lazyvim/plugins/extras/lang/fsharp.lua | 64 ++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 lua/lazyvim/plugins/extras/lang/fsharp.lua diff --git a/lua/lazyvim/plugins/extras/lang/fsharp.lua b/lua/lazyvim/plugins/extras/lang/fsharp.lua new file mode 100644 index 00000000..97f2e183 --- /dev/null +++ b/lua/lazyvim/plugins/extras/lang/fsharp.lua @@ -0,0 +1,64 @@ +-- requires dotnet sdk to be installed +return { + recommended = function() + return LazyVim.extras.wants({ + ft = { "fs", "fsx", "fsi" }, + root = { "*.fsproj" }, + }) + end, + { + "nvim-treesitter/nvim-treesitter", + config = function() + local parser_config = require("nvim-treesitter.parsers").get_parser_configs() + parser_config.fsharp = { + install_info = { + url = "https://github.com/ionide/tree-sitter-fsharp", + branch = "main", + files = { "src/scanner.c", "src/parser.c" }, + }, + filetype = "fsharp", + } + end, + opts = { ensure_installed = { "fsharp" } }, + }, + { + "ionide/Ionide-vim", + event = "VeryLazy", + }, + { + "mason.nvim", + opts = { ensure_installed = { + "fsautocomplete", + "fantomas", + } }, + }, + { + "nvimtools/none-ls.nvim", + optional = true, + opts = function(_, opts) + local nls = require("null-ls") + opts.sources = vim.list_extend(opts.sources or {}, { + nls.builtins.formatting.fantomas, + }) + end, + }, + { + "stevearc/conform.nvim", + optional = true, + opts = { + formatters_by_ft = { + fs = { "fantomas" }, + fsi = { "fantomas" }, + fsx = { "fantomas" }, + }, + }, + }, + { + "neovim/nvim-lspconfig", + opts = { + servers = { + fsautocomplete = {}, + }, + }, + }, +}