Skip to content

Calls for "textDocument/documentColor" when using Haskell Language Server #133

@leana8959

Description

@leana8959

Not a question

  • This is not a question. If you have a question, use discussions.

I investigated.

  • I have read README.md, help documentation, and searched past issues but no solution.

Description

I noticed that, at each buffer change (input, etc.), neovim shows the following error message.

LSP[haskell-tools.nvim] Error condition, please check your setup and/or the [issue tracker](https://github.com/haskell/haskell-language-server/issues):
LSP: no handler for: "textDocument/documentColor"

This happens with haskell-tools.nvim and lspconfig.nvim's hls configuration. I provide a latter example for the former below.

I have tried to disable the lsp functionality or disable ccc by default, but the error message is still popping up.

Environments

  • Linux 6.6.60 (NixOS) x86_64 GNU/Linux
  • Neovim 0.10.2

Minimal reproducible full config

set termguicolors

let s:plug_dir = expand('/tmp/plugged/vim-plug')
if !filereadable(s:plug_dir .. '/autoload/plug.vim')
  execute printf('!curl -fLo %s/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim', s:plug_dir)
end

execute 'set runtimepath+=' . s:plug_dir
call plug#begin(s:plug_dir)
Plug 'uga-rosa/ccc.nvim'
Plug 'neovim/nvim-lspconfig'
call plug#end()
PlugInstall | quit

lua <<EOF
local ccc = require("ccc")
local mapping = ccc.mapping

ccc.setup({
    pickers = { disable = { "haskell" } },
    highlighter = {
        auto_enable = true,
        lsp = true,
        excludes = {
            "haskell",
        },
    },
})

require("lspconfig").hls.setup({})
EOF

Steps to reproduce

  1. Install haskell language server (the LSP needs to run for this issue to manifest)
  2. Open the following example file (write the content to something like main.hs)
module Main where

main :: IO ()
main = undefined
  1. Type anything in insert mode and the error will pop up.

Expected behavior

The call to "textDocument/documentColor" shouldn't fail with such errors at each buffer change.

Actual behavior

The call to "textDocument/documentColor" fails with an error message.

Additional context

Thank you for the project and for reading this issue!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions