Skip to content

Commit a566c3e

Browse files
committed
feat!: drop nvim 0.10 support
1 parent 9ac2bd1 commit a566c3e

File tree

6 files changed

+33
-36
lines changed

6 files changed

+33
-36
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,12 @@ that are specific to Haskell tooling.
6868

6969
### Required
7070

71-
- `neovim >= 0.10`
71+
- `neovim >= 0.11`
72+
73+
> [!NOTE]
74+
>
75+
> For versions that are compatible with older Neovim versions,
76+
> see previous major version bumps in [the changelog](./CHANGELOG.md).
7277
7378
### Optional
7479

ftplugin/cabal.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if vim.fn.has('nvim-0.10') ~= 1 then
2-
vim.notify_once('haskell-tools.nvim requires Neovim 0.10 or above', vim.log.levels.ERROR)
1+
if vim.fn.has('nvim-0.11') ~= 1 then
2+
vim.notify_once('haskell-tools.nvim requires Neovim 0.11 or above', vim.log.levels.ERROR)
33
return
44
end
55
require('haskell-tools.internal').ftplugin()

ftplugin/cabalproject.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if vim.fn.has('nvim-0.10') ~= 1 then
2-
vim.notify_once('haskell-tools.nvim requires Neovim 0.10 or above', vim.log.levels.ERROR)
1+
if vim.fn.has('nvim-0.11') ~= 1 then
2+
vim.notify_once('haskell-tools.nvim requires Neovim 0.11 or above', vim.log.levels.ERROR)
33
return
44
end
55
require('haskell-tools.internal').ftplugin()

ftplugin/haskell.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if vim.fn.has('nvim-0.10') ~= 1 then
2-
vim.notify_once('haskell-tools.nvim requires Neovim 0.10 or above', vim.log.levels.ERROR)
1+
if vim.fn.has('nvim-0.11') ~= 1 then
2+
vim.notify_once('haskell-tools.nvim requires Neovim 0.11 or above', vim.log.levels.ERROR)
33
return
44
end
55
require('haskell-tools.internal').ftplugin()

ftplugin/lhaskell.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
if vim.fn.has('nvim-0.10') ~= 1 then
2-
vim.notify_once('haskell-tools.nvim requires Neovim 0.10 or above', vim.log.levels.ERROR)
1+
if vim.fn.has('nvim-0.11') ~= 1 then
2+
vim.notify_once('haskell-tools.nvim requires Neovim 0.11 or above', vim.log.levels.ERROR)
33
return
44
end
55
require('haskell-tools.internal').ftplugin()

lua/haskell-tools/health.lua

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,7 @@ local health = {}
1212
local Types = require('haskell-tools.types.internal')
1313
local deps = require('haskell-tools.deps')
1414
local HTConfig = require('haskell-tools.config.internal')
15-
local h = vim.health or require('health')
16-
---@diagnostic disable-next-line: deprecated
17-
local start = h.start or h.report_start
18-
---@diagnostic disable-next-line: deprecated
19-
local ok = h.ok or h.report_ok
20-
---@diagnostic disable-next-line: deprecated
21-
local error = h.error or h.report_error
22-
---@diagnostic disable-next-line: deprecated
23-
local warn = h.warn or h.report_warn
15+
local h = vim.health
2416

2517
---@class haskell-tools.LuaDependency
2618
---@field module string The name of a module
@@ -99,9 +91,9 @@ local external_dependencies = {
9991
if errmsg then
10092
local hoogle_mode = HTConfig.tools.hoogle.mode
10193
if hoogle_mode and hoogle_mode == 'auto' or hoogle_mode == 'telescope-local' then
102-
error('hoogle: ' .. errmsg)
94+
h.error('hoogle: ' .. errmsg)
10395
else
104-
warn('hoogle: ' .. errmsg)
96+
h.warn('hoogle: ' .. errmsg)
10597
end
10698
end
10799
end,
@@ -156,13 +148,13 @@ local external_dependencies = {
156148
---@param dep haskell-tools.LuaDependency
157149
local function check_lua_dependency(dep)
158150
if deps.has(dep.module) then
159-
ok(dep.url .. ' installed.')
151+
h.ok(dep.url .. ' installed.')
160152
return
161153
end
162154
if dep.optional() then
163-
warn(('%s not installed. %s %s'):format(dep.module, dep.info, dep.url))
155+
h.warn(('%s not installed. %s %s'):format(dep.module, dep.info, dep.url))
164156
else
165-
error(('Lua dependency %s not found: %s'):format(dep.module, dep.url))
157+
h.error(('Lua dependency %s not found: %s'):format(dep.module, dep.url))
166158
end
167159
end
168160

@@ -195,20 +187,20 @@ local function check_external_dependency(dep)
195187
local mb_version_newline_idx = mb_version and mb_version:find('\n')
196188
local mb_version_len = mb_version and (mb_version_newline_idx and mb_version_newline_idx - 1 or mb_version:len())
197189
local version = mb_version and mb_version:sub(0, mb_version_len) or '(unknown version)'
198-
ok(('%s: found %s'):format(dep.name, version))
190+
h.ok(('%s: found %s'):format(dep.name, version))
199191
if dep.extra_checks then
200192
dep.extra_checks()
201193
end
202194
return
203195
end
204196
if dep.optional() then
205-
warn(([[
197+
h.warn(([[
206198
%s: not found.
207199
Install %s for extended capabilities.
208200
%s
209201
]]):format(dep.name, dep.url, dep.info))
210202
else
211-
error(([[
203+
h.error(([[
212204
%s: not found.
213205
haskell-tools.nvim requires %s.
214206
%s
@@ -217,41 +209,41 @@ local function check_external_dependency(dep)
217209
end
218210

219211
local function check_config()
220-
start('Checking config')
212+
h.start('Checking config')
221213
if vim.g.haskell_tools and not HTConfig.debug_info.was_g_haskell_tools_sourced then
222-
error('vim.g.haskell_tools is set, but was not sourced before haskell-tools.nvim was initialized.')
214+
h.error('vim.g.haskell_tools is set, but was not sourced before haskell-tools.nvim was initialized.')
223215
return
224216
end
225217
local valid, err = require('haskell-tools.config.check').validate(HTConfig)
226218
if valid then
227-
ok('No errors found in config.')
219+
h.ok('No errors found in config.')
228220
else
229-
error(err or '' .. vim.g.haskell_tools and '' or ' This looks like a plugin bug!')
221+
h.error(err or '' .. vim.g.haskell_tools and '' or ' This looks like a plugin bug!')
230222
end
231223
local unrecognized_keys = HTConfig.debug_info.unrecognized_keys
232224
if #unrecognized_keys > 0 then
233-
warn('unrecognized configs in vim.g.haskell_tools: ' .. vim.inspect(unrecognized_keys))
225+
h.warn('unrecognized configs in vim.g.haskell_tools: ' .. vim.inspect(unrecognized_keys))
234226
end
235227
end
236228

237229
local function check_for_conflicts()
238-
start('Checking for conflicting plugins')
230+
h.start('Checking for conflicting plugins')
239231
for _, autocmd in ipairs(vim.api.nvim_get_autocmds { event = 'FileType', pattern = 'haskell' }) do
240232
if autocmd.group_name and autocmd.group_name == 'lspconfig' and autocmd.desc and autocmd.desc:match(' hls ') then
241-
error('lspconfig.hls has been setup. This will likely lead to conflicts with the haskell-tools LSP client.')
233+
h.error('lspconfig.hls has been setup. This will likely lead to conflicts with the haskell-tools LSP client.')
242234
return
243235
end
244236
end
245-
ok('No conflicting plugins detected.')
237+
h.ok('No conflicting plugins detected.')
246238
end
247239

248240
function health.check()
249-
start('Checking for Lua dependencies')
241+
h.start('Checking for Lua dependencies')
250242
for _, dep in ipairs(lua_dependencies) do
251243
check_lua_dependency(dep)
252244
end
253245

254-
start('Checking external dependencies')
246+
h.start('Checking external dependencies')
255247
for _, dep in ipairs(external_dependencies) do
256248
check_external_dependency(dep)
257249
end

0 commit comments

Comments
 (0)