nvimdev / nvimdev/lspsaga.nvim

'height' key must be a positive 'Integer' when opening code actions.

Open
#1,469 11 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Lua
Stars
3.8k
Forks
308
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

I run Lspsaga code_action on a Haskell file with HLS running and I get the following error:

image

Above it, this also displays: (Sorry, I can only keep one on the screen at a time for a screenshot).
image

Steps to reproduce

I have a simple haskell file open in Nvim, with Haskell language server running.
The code has code actions available, like unused imports:

module HCat where

import Control.Exception qualified as Exception
import Data.ByteString qualified as BS
import Data.Text qualified as Text
import Data.Text.IO qualified as TextIO
import System.Environment qualified as Env
import System.IO.Error qualified as IOError

runHCat :: IO ()
runHCat =
  handleIOError $
    handleArgs
      >>= eitherToErr
      >>= TextIO.readFile
      >>= TextIO.putStrLn
  where
    handleIOError :: IO () -> IO ()
    handleIOError ioAction =
      Exception.catch ioAction $
        \e -> putStrLn "I ran into an error: " >> print @IOError e

eitherToErr :: (Show a) => Either a b -> IO b
eitherToErr (Right a) = return a
eitherToErr (Left e) =
  Exception.throwIO . IOError.userError $ show e

handleArgs :: IO (Either String FilePath)
handleArgs =
  parseArgs <$> Env.getArgs
  where
    parseArgs argumentsList =
      case argumentsList of
        [fname] -> Right fname
        [] -> Left "Error: No arguments provided"
        _ -> Left "Error: Too many arguments provided"

groupsOf :: Int -> [a] -> [[a]]
groupsOf _ [] = []
groupsOf n elems =
  let (hd, tl) = splitAt n elems
   in hd : groupsOf n tl

I run Lspsaga code_action and I get the error messages.

Here's my nixvim flake, if you run it, you should have the exact same config as I do.

Expected behavior

I'd expect no errors.

Neovim version (nvim -v)

0.10.0 commit

lspsaga commit

2024-06-09 (that's the version in nixpackages unstable) I don't know where the commit is.

Terminal name/version

kitty 0.35.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure by opening Lspsaga code actions for the provided Haskell file in Neovim 0.10.0 with HLS running. Trace the code-action entry point and the reported height error; the work is done when code actions open without either displayed error.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.