uga-rosa / ccc.nvim

Color picker and highlighter plugin for Neovim.
MIT License
782 stars 13 forks source link

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

Open leana8959 opened 23 hours ago

leana8959 commented 23 hours ago

Not a question

I investigated.

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

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
  3. 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!

uga-rosa commented 12 hours ago

I'm sure the request is only sent if the server responds that textDocument/documentColor is supported🤔 It might be a bug in the server. I'll check when I have time.