fix(haskell): Make Haskell-snippets lazy load for performance (#2676)

* fix(haskell): add filetype to haskell-snippets for lazy load

* format haskell.lua

---------

Co-authored-by: Uthman Mohamed <83053931+1239uth@users.noreply.github.com>
This commit is contained in:
Uthman Mohamed 2024-03-08 05:22:36 -05:00 committed by GitHub
parent c0ad2209b6
commit 04bc5718a5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -13,14 +13,14 @@ return {
{ {
"mrcjkb/haskell-tools.nvim", "mrcjkb/haskell-tools.nvim",
version = "^3", version = "^3",
ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
dependencies = { dependencies = {
{ "nvim-telescope/telescope.nvim", optional = true }, { "nvim-telescope/telescope.nvim", optional = true },
}, },
config = function() config = function()
local ok, telescope = pcall(require, 'telescope') local ok, telescope = pcall(require, "telescope")
if ok then if ok then
telescope.load_extension('ht') telescope.load_extension("ht")
end end
end, end,
}, },
@ -51,7 +51,7 @@ return {
"nvim-neotest/neotest", "nvim-neotest/neotest",
optional = true, optional = true,
dependencies = { dependencies = {
{ "mrcjkb/neotest-haskell", } { "mrcjkb/neotest-haskell" },
}, },
opts = { opts = {
adapters = { adapters = {
@ -62,23 +62,24 @@ return {
{ {
"mrcjkb/haskell-snippets.nvim", "mrcjkb/haskell-snippets.nvim",
dependencies = { "L3MON4D3/LuaSnip", }, dependencies = { "L3MON4D3/LuaSnip" },
ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
config = function() config = function()
local haskell_snippets = require('haskell-snippets').all local haskell_snippets = require("haskell-snippets").all
require('luasnip').add_snippets('haskell', haskell_snippets, { key = 'haskell' }) require("luasnip").add_snippets("haskell", haskell_snippets, { key = "haskell" })
end, end,
}, },
{ {
"luc-tielen/telescope_hoogle", "luc-tielen/telescope_hoogle",
ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' }, ft = { "haskell", "lhaskell", "cabal", "cabalproject" },
dependencies = { dependencies = {
{ "nvim-telescope/telescope.nvim" }, { "nvim-telescope/telescope.nvim" },
}, },
config = function() config = function()
local ok, telescope = pcall(require, 'telescope') local ok, telescope = pcall(require, "telescope")
if ok then if ok then
telescope.load_extension('hoogle') telescope.load_extension("hoogle")
end end
end, end,
}, },