diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 3cc1daf..5917aec 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -23,8 +23,9 @@ body: required: true - type: input attributes: - label: "Output of `haskell-language-server-wrapper --version`" - placeholder: "2.1.0.0 (GHC: 9.2.8)" + label: "Output of `:checkhealth haskell-tools`" + validations: + required: true - type: textarea attributes: label: "How to reproduce the issue" diff --git a/CHANGELOG.md b/CHANGELOG.md index 95fb9b9..4f082c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] +### Added +- Health: Check for conflicting `lspconfig.hls` configuration. + ## [2.2.0] - 2023-09-12 ### Added - Automatically add `foldingRange` LSP client capabilities if [`nvim-ufo`](https://github.com/kevinhwang91/nvim-ufo) @@ -139,7 +143,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Only show definition/typeDefinition hover actions if they are in different locations. ### Added - Rockspec for automatic dependency management by LuaRocks-compatible plugin managers. -- LuaRocks tag release worflow. +- LuaRocks tag release workflow. - `HlsStart`, `HlsStop` and `HlsRestart` commands. - Dynamically load `haskell-language-server` settings JSON from project root, if available. - Health checks, runnable with `:checkhealth haskell-tools`. diff --git a/lua/haskell-tools/health.lua b/lua/haskell-tools/health.lua index 51d1045..5c2128c 100644 --- a/lua/haskell-tools/health.lua +++ b/lua/haskell-tools/health.lua @@ -230,6 +230,17 @@ local function check_config() end end +local function check_for_conflicts() + start('Checking for conflicting plugins') + for _, autocmd in ipairs(vim.api.nvim_get_autocmds { event = 'FileType', pattern = 'haskell' }) do + if autocmd.group_name and autocmd.group_name == 'lspconfig' then + error('lspconfig.hls has been setup. This will likely lead to conflicts with the haskell-tools LSP client.') + return + end + end + ok('No conflicting plugins detected.') +end + function health.check() start('Checking for Lua dependencies') for _, dep in ipairs(lua_dependencies) do @@ -241,6 +252,7 @@ function health.check() check_external_dependency(dep) end check_config() + check_for_conflicts() end return health