Skip to content

Commit

Permalink
fix(lsp): disable hover actions if luajit is not available
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Sep 20, 2024
1 parent f32ba45 commit 24865bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,9 @@ And the hover buffer's filetype is set to markdown,
so that [nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter)
users can benefit from syntax highlighting of code snippets.

For invoking hover actions with a keymap in normal mode, this plugin
provides the following `<Plug>` mappings:

- `HaskellHoverAction`: Takes a `<count>` prefix for the hover action to invoke.
- `HaskellHoverActionHoogle`: Invokes the first Hoogle search hover action.
- `HaskellHoverActionOpenDocs`: Open
> [!NOTE]
>
> Hover actions are disabled if Neovim is not built with luajit.
![hoverActions](https://user-images.githubusercontent.com/12857160/219763211-61fc4207-4300-41f2-99c4-6a420cf940f2.gif)

Expand Down
5 changes: 4 additions & 1 deletion lua/haskell-tools/config/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ local HTDefaultConfig = {
---@class haskell-tools.hover.Config Enhanced LSP hover options.
hover = {
---@type boolean | (fun():boolean) (default: `true`) Whether to enable haskell-tools hover.
enable = true,
enable = function()
local has_jit = pcall(require, 'jit')
return has_jit
end,
---@type string[][] | nil The hover window's border. Set to `nil` to disable.
border = {
{ '', 'FloatBorder' },
Expand Down

0 comments on commit 24865bf

Please sign in to comment.