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

View File

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