Skip to content

Instantly share code, notes, and snippets.

@Per48edjes
Created September 13, 2023 20:10
Show Gist options
  • Save Per48edjes/1c2132dd1be63183cff3ab70c295ebfa to your computer and use it in GitHub Desktop.
Save Per48edjes/1c2132dd1be63183cff3ab70c295ebfa to your computer and use it in GitHub Desktop.
Debugging HLS/Neovim/InsertLeave/FoldRange issue
-- Minimal nvim config with lazy
-- Assumes a directory in $NVIM_DATA_MINIMAL
-- Start with
--
-- export NVIM_DATA_MINIMAL=$(mktemp -d)
-- export NVIM_APP_NAME="nvim-ht-minimal"
-- nvim -u minimal.lua
--
-- Then exit out of neovim and start again.
-- Ignore default config
local config_path = vim.fn.stdpath('config')
vim.opt.rtp:remove(config_path)
-- Ignore default plugins
local data_path = vim.fn.stdpath('data')
local pack_path = data_path .. '/site'
vim.opt.packpath:remove(pack_path)
-- bootstrap lazy.nvim
data_path = assert(os.getenv('NVIM_DATA_MINIMAL'), '$NVIM_DATA_MINIMAL environment variable not set!')
local lazypath = data_path .. '/lazy/lazy.nvim'
local uv = vim.uv
---@diagnostic disable-next-line: deprecated
or vim.loop
if not uv.fs_stat(lazypath) then
vim.fn.system {
'git',
'clone',
'--filter=blob:none',
'git@github.com:folke/lazy.nvim.git',
'--branch=stable',
lazypath,
}
end
vim.opt.rtp:prepend(lazypath)
local lazy = require('lazy')
lazy.setup({
{
'mrcjkb/haskell-tools.nvim',
branch = '2.x.x',
init = function()
-- Configure haskell-tools.nvim here
vim.g.haskell_tools = {}
end,
dependencies = {
'nvim-lua/plenary.nvim',
-- Uncomment or add any optional dependencies needed to reproduce the issue
-- 'nvim-telescope/telescope.nvim',
-- 'akinsho/toggleterm.nvim',
},
ft = { 'haskell', 'lhaskell', 'cabal', 'cabalproject' },
},
-- Add any other plugins needed to reproduce the issue.
-- see https://github.com/folke/lazy.nvim#-lazynvim for details.
{
'kevinhwang91/nvim-ufo',
dependencies = {'kevinhwang91/promise-async'}
},
}, { root = data_path, state = data_path .. '/lazy-state.json', lockfile = data_path .. '/lazy-lock.json' })
-- FROM NVIM-UFO MINIMAL CONFIG:
-- Option 2: nvim lsp as LSP client
-- Tell the server the capability of foldingRange,
-- Neovim hasn't added foldingRange to default capabilities, users must add it manually
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.foldingRange = {
dynamicRegistration = false,
lineFoldingOnly = true
}
require('ufo').setup()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment