Coc.nvim: Unable to set highlight for floating windows with messageTarget and hoverTarget

Created on 13 Mar 2019  路  1Comment  路  Source: neoclide/coc.nvim

Result from CocInfo
Run :CocInfo command and paste the content below.

## versions

vim version: NVIM v0.4.0-1443-g7fcf2f926
node version: v10.15.3
coc.nvim version: 0.0.59
term: tmux-256color
platform: darwin

## Error messages

## Output channel: languageserver.elixir
[Trace - 5:52:15 PM] Sending request 'initialize - (0)'.
Params: {
    "processId": 47147,
    "rootPath": "/Users/me/code/places/thing_adapter",
    "rootUri": "file:///Users/me/code/places/thing_adapter",
    "capabilities": {
        "workspace": {
            "applyEdit": true,
            "workspaceEdit": {
                "documentChanges": true,
                "resourceOperations": [
                    "create",
                    "rename",
                    "delete"
                ],
                "failureHandling": "textOnlyTransactional"
            },
            "didChangeConfiguration": {
                "dynamicRegistration": true
            },
            "didChangeWatchedFiles": {
                "dynamicRegistration": true
            },
            "symbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "executeCommand": {
                "dynamicRegistration": true
            },
            "configuration": true
        },
        "textDocument": {
            "publishDiagnostics": {
                "relatedInformation": true
            },
            "synchronization": {
                "dynamicRegistration": true,
                "willSave": true,
                "willSaveWaitUntil": true,
                "didSave": true
            },
            "completion": {
                "dynamicRegistration": true,
                "contextSupport": true,
                "completionItem": {
                    "snippetSupport": true,
                    "commitCharactersSupport": true,
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "deprecatedSupport": true,
                    "preselectSupport": true
                },
                "completionItemKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25
                    ]
                }
            },
            "hover": {
                "dynamicRegistration": true,
                "contentFormat": [
                    "markdown",
                    "plaintext"
                ]
            },
            "signatureHelp": {
                "dynamicRegistration": true,
                "signatureInformation": {
                    "documentationFormat": [
                        "markdown",
                        "plaintext"
                    ],
                    "parameterInformation": {
                        "labelOffsetSupport": true
                    }
                }
            },
            "definition": {
                "dynamicRegistration": true
            },
            "references": {
                "dynamicRegistration": true
            },
            "documentHighlight": {
                "dynamicRegistration": true
            },
            "documentSymbol": {
                "dynamicRegistration": true,
                "symbolKind": {
                    "valueSet": [
                        1,
                        2,
                        3,
                        4,
                        5,
                        6,
                        7,
                        8,
                        9,
                        10,
                        11,
                        12,
                        13,
                        14,
                        15,
                        16,
                        17,
                        18,
                        19,
                        20,
                        21,
                        22,
                        23,
                        24,
                        25,
                        26
                    ]
                }
            },
            "codeAction": {
                "dynamicRegistration": true,
                "codeActionLiteralSupport": {
                    "codeActionKind": {
                        "valueSet": [
                            "",
                            "quickfix",
                            "refactor",
                            "refactor.extract",
                            "refactor.inline",
                            "refactor.rewrite",
                            "source",
                            "source.organizeImports"
                        ]
                    }
                }
            },
            "codeLens": {
                "dynamicRegistration": true
            },
            "formatting": {
                "dynamicRegistration": true
            },
            "rangeFormatting": {
                "dynamicRegistration": true
            },
            "onTypeFormatting": {
                "dynamicRegistration": true
            },
            "rename": {
                "dynamicRegistration": true,
                "prepareSupport": true
            },
            "documentLink": {
                "dynamicRegistration": true
            },
            "typeDefinition": {
                "dynamicRegistration": true
            },
            "implementation": {
                "dynamicRegistration": true
            },
            "declaration": {
                "dynamicRegistration": true
            },
            "colorProvider": {
                "dynamicRegistration": true
            },
            "foldingRange": {
                "dynamicRegistration": true,
                "rangeLimit": 5000,
                "lineFoldingOnly": true
            }
        }
    },
    "initializationOptions": {
        "elixirLS": {
            "dialyzerEnabled": false
        }
    },
    "trace": "verbose",
    "workspaceFolders": [
        {
            "uri": "file:///Users/me/code/places/thing_adapter",
            "name": "thing_adapter"
        }
    ]
}


[Trace - 5:52:17 PM] Received notification 'window/logMessage'.
Params: {
    "message": "Started ElixirLS",
    "type": 4
}


Started ElixirLS
[Trace - 5:52:17 PM] Received notification 'window/logMessage'.
Params: {
    "message": "Elixir version: \"1.6.3 (compiled with OTP 19)\"",
    "type": 4
}


Elixir version: "1.6.3 (compiled with OTP 19)"
[Trace - 5:52:17 PM] Received notification 'window/logMessage'.
Params: {
    "message": "Erlang version: \"20\"",
    "type": 4
}


Erlang version: "20"
[Trace - 5:52:17 PM] Received response 'initialize - (0)' in 2013ms.
Result: {
    "capabilities": {
        "codeLensProvider": {
            "resolveProvider": false
        },
        "completionProvider": {
            "triggerCharacters": [
                ".",
                "@"
            ]
        },
        "definitionProvider": true,
        "documentFormattingProvider": true,
        "documentOnTypeFormattingProvider": {
            "firstTriggerCharacter": "\n"
        },
        "documentSymbolProvider": true,
        "executeCommandProvider": {
            "commands": [
                "spec"
            ]
        },
        "hoverProvider": true,
        "macroExpansion": true,
        "referencesProvider": true,
        "signatureHelpProvider": {
            "triggerCharacters": [
                "("
            ]
        },
        "textDocumentSync": 2
    }
}


[Trace - 5:52:17 PM] Sending notification 'initialized'.
Params: {}


[Trace - 5:52:17 PM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex",
        "languageId": "elixir",
        "version": 1,
        "text": "defmodule thingAdapter.Simulators.Battery do\n  @moduledoc \"\"\"\n  Intentionally over simplified battery simulator. Just generates a static power value.\n  Feel free to remove all of this code in favor of a more robust implementation.\n  \"\"\"\n\n  @typep asset_config :: %{remote_id: String.t()}\n\n  @polling_interval :timer.seconds(60)\n\n  @spec run(asset_config) :: no_return()\n  def run(config) do\n    recorded_at = DateTime.utc_now()\n\n    config\n    |> generate_telemetry(recorded_at)\n    |> thingAdapter.VppCommSims.send_telemetry()\n\n    Process.sleep(@polling_interval)\n    run(config)\n  end\n\n  def generate_telemetry(config, recorded_at) do\n    [\n      power_telemetry(config, recorded_at),\n      state_telemetry(config, recorded_at),\n      energy_telemetry(config, recorded_at)\n    ]\n  end\n\n  defp power_telemetry(%{remote_id: remote_id, rated_size: {:watts, rated_size}}, recorded_at) do\n    {:ok, %{status: :ok}} = AdapterCore.HostConnectionPool.get(\"/asset/#{remote_id}\")\n    power = Enum.random(-trunc(rated_size)..trunc(rated_size))\n\n    %{\n      power: {:watts, power},\n      remote_id: remote_id,\n      recorded_at: recorded_at\n    }\n  end\n\n  defp state_telemetry(%{remote_id: remote_id}, recorded_at) do\n    %{\n      category: :remote_state,\n      description: \"simulated remote state\",\n      recorded_at: recorded_at,\n      remote_id: remote_id,\n      value: :online\n    }\n  end\n\n  defp energy_telemetry(\n         %{\n           rated_storage: {:watt_hours, rated_storage},\n           remote_id: remote_id\n         },\n         recorded_at\n       ) do\n    energy = Enum.random([rated_storage | Enum.to_list(0..trunc(rated_storage))])\n\n    %{\n      energy: {:watt_hours, energy},\n      recorded_at: recorded_at,\n      remote_id: remote_id\n    }\n  end\nend\n"
    }
}


[Trace - 5:52:17 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [],
    "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex"
}


[Trace - 5:52:19 PM] Sending request 'textDocument/codeLens - (1)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex"
    }
}


[Trace - 5:52:19 PM] Received response 'textDocument/codeLens - (1)' in 13ms.
No result returned.


[Trace - 5:52:19 PM] Sending request 'textDocument/codeLens - (2)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex"
    }
}


[Trace - 5:52:19 PM] Received response 'textDocument/codeLens - (2)' in 12ms.
No result returned.


[Trace - 5:52:21 PM] Received notification 'window/logMessage'.
Params: {
    "message": "\n17:52:21.628 [warn]  Did not receive workspace/didChangeConfiguration notification after 5 seconds. Using default settings.",
    "type": 4
}



17:52:21.628 [warn]  Did not receive workspace/didChangeConfiguration notification after 5 seconds. Using default settings.
[Trace - 5:52:23 PM] Received notification 'window/logMessage'.
Params: {
    "message": "Compiling with Mix env test",
    "type": 4
}


Compiling with Mix env test
[Trace - 5:52:23 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Analyzing 0 modules: []",
    "type": 3
}


[Info  - 5:52:23 PM] [ElixirLS Dialyzer] Analyzing 0 modules: []
[Trace - 5:52:23 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Analysis finished in 73 milliseconds",
    "type": 3
}


[Info  - 5:52:23 PM] [ElixirLS Dialyzer] Analysis finished in 73 milliseconds
[Trace - 5:52:24 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "The pattern can never match the type since it covered by previous clauses.",
            "range": {
                "end": {
                    "character": 0,
                    "line": 0
                },
                "start": {
                    "character": 0,
                    "line": 0
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        },
        {
            "message": "The pattern can never match the type since it covered by previous clauses.",
            "range": {
                "end": {
                    "character": 0,
                    "line": 0
                },
                "start": {
                    "character": 0,
                    "line": 0
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/deps/timex/lib/l10n/gettext.ex"
}


[Trace - 5:52:24 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "Invalid type specification for function Conform.Parse.file/1.",
            "range": {
                "end": {
                    "character": 0,
                    "line": 31
                },
                "start": {
                    "character": 0,
                    "line": 31
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/deps/conform/lib/conform/parse.ex"
}


[Trace - 5:52:24 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "Invalid type specification for function thingAdapter.Simulators.Battery.run/1.",
            "range": {
                "end": {
                    "character": 40,
                    "line": 10
                },
                "start": {
                    "character": 2,
                    "line": 10
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex"
}


[Trace - 5:52:24 PM] Received notification 'window/logMessage'.
Params: {
    "message": "Compile took 1667 milliseconds",
    "type": 3
}


[Info  - 5:52:24 PM] Compile took 1667 milliseconds
[Trace - 5:52:24 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Checking for stale beam files",
    "type": 3
}


[Info  - 5:52:24 PM] [ElixirLS Dialyzer] Checking for stale beam files
[Trace - 5:52:24 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Writing manifest...",
    "type": 3
}


[Info  - 5:52:24 PM] [ElixirLS Dialyzer] Writing manifest...
[Trace - 5:52:25 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "The pattern can never match the type since it covered by previous clauses.",
            "range": {
                "end": {
                    "character": 0,
                    "line": 0
                },
                "start": {
                    "character": 0,
                    "line": 0
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        },
        {
            "message": "The pattern can never match the type since it covered by previous clauses.",
            "range": {
                "end": {
                    "character": 0,
                    "line": 0
                },
                "start": {
                    "character": 0,
                    "line": 0
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/deps/timex/lib/l10n/gettext.ex"
}


[Trace - 5:52:26 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "Invalid type specification for function Conform.Parse.file/1.",
            "range": {
                "end": {
                    "character": 0,
                    "line": 31
                },
                "start": {
                    "character": 0,
                    "line": 31
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/deps/conform/lib/conform/parse.ex"
}


[Trace - 5:52:26 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "Invalid type specification for function thingAdapter.Simulators.Battery.run/1.",
            "range": {
                "end": {
                    "character": 40,
                    "line": 10
                },
                "start": {
                    "character": 2,
                    "line": 10
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex"
}


[Trace - 5:52:26 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Analyzing 7 modules: [Inspect.Timex.Date, Inspect.Timex.DateTime, Timex, Timex.Comparable.Timex.Date, Timex.Comparable.Timex.DateTime, Timex.Convertable, Timex.Convertable.Map]",
    "type": 3
}


[Info  - 5:52:26 PM] [ElixirLS Dialyzer] Analyzing 7 modules: [Inspect.Timex.Date, Inspect.Timex.DateTime, Timex, Timex.Comparable.Timex.Date, Timex.Comparable.Timex.DateTime, Timex.Convertable, Timex.Convertable.Map]
[Trace - 5:52:28 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Analyzing 0 modules: []",
    "type": 3
}


[Info  - 5:52:28 PM] [ElixirLS Dialyzer] Analyzing 0 modules: []
[Trace - 5:52:28 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Analysis finished in 26 milliseconds",
    "type": 3
}


[Info  - 5:52:28 PM] [ElixirLS Dialyzer] Analysis finished in 26 milliseconds
[Trace - 5:52:28 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [
        {
            "message": "Invalid type specification for function thingAdapter.Simulators.Battery.run/1.",
            "range": {
                "end": {
                    "character": 40,
                    "line": 10
                },
                "start": {
                    "character": 2,
                    "line": 10
                }
            },
            "severity": 2,
            "source": "Dialyzer"
        }
    ],
    "uri": "file:///Users/me/code/places/thing_adapter/lib/simulators/battery.ex"
}


[Trace - 5:52:28 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [],
    "uri": "file:///Users/me/code/places/thing_adapter/deps/timex/lib/l10n/gettext.ex"
}


[Trace - 5:52:28 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
    "diagnostics": [],
    "uri": "file:///Users/me/code/places/thing_adapter/deps/conform/lib/conform/parse.ex"
}


[Trace - 5:52:29 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Writing manifest...",
    "type": 3
}


[Info  - 5:52:29 PM] [ElixirLS Dialyzer] Writing manifest...
[Trace - 5:52:32 PM] Received notification 'window/logMessage'.
Params: {
    "message": "[ElixirLS Dialyzer] Done writing manifest.",
    "type": 3
}


[Info  - 5:52:32 PM] [ElixirLS Dialyzer] Done writing manifest.

## Output channel: prettier

## Output channel: watchman
[Info  - 5:52:17 PM] watchman watching project: /Users/me/code/places/thing_adapter
[Info  - 5:52:17 PM] subscribing "**/{.prettierrc,.prettierrc.json,.prettierrc.yaml,.prettierrc.yml,.prettierrc.js,package.json,prettier.config.js}" in /Users/me/code/places/thing_adapter

## Output channel: snippets
[Info 3/13/2019] Loaded 20 snippets from /Users/me/.config/coc/extensions/node_modules/coc-java/snippets/java.json
[Info 3/13/2019] Loaded 13 snippets from /Users/me/.config/coc/extensions/node_modules/coc-rls/snippets/rust.json
[Info 3/13/2019] Loaded 28 snippets from /Users/me/.config/coc/extensions/node_modules/coc-tsserver/snippets/typescript.json
[Info 5:52:17 PM] Loaded 5 snippets from: /Users/me/.config/nvim/UltiSnips/css.snippets
[Info 5:52:17 PM] Loaded 29 snippets from: /Users/me/.config/nvim/UltiSnips/javascript.snippets
[Info 5:52:17 PM] Loaded 4 snippets from: /Users/me/.config/nvim/UltiSnips/elm.snippets
[Info 5:52:17 PM] Loaded 6 snippets from: /Users/me/.config/nvim/UltiSnips/markdown.snippets
[Info 5:52:17 PM] Loaded 7 snippets from: /Users/me/.config/nvim/UltiSnips/javascript-jest.snippets
[Info 5:52:17 PM] Loaded 0 snippets from: /Users/me/.config/nvim/UltiSnips/ruby-spec.snippets
[Info 5:52:17 PM] Loaded 8 snippets from: /Users/me/.config/nvim/UltiSnips/ruby.snippets
[Info 5:52:17 PM] Loaded 3 snippets from: /Users/me/.config/nvim/UltiSnips/snippet.snippets
[Info 5:52:17 PM] Loaded 0 snippets from: /Users/me/.config/nvim/UltiSnips/typescript-jest.snippets
[Info 5:52:17 PM] Loaded 0 snippets from: /Users/me/.config/nvim/UltiSnips/typescript.snippets
[Info 5:52:17 PM] Loaded 26 snippets from: /Users/me/.config/nvim/UltiSnips/typescriptreact.snippets
[Info 5:52:17 PM] Loaded 13 snippets from: /Users/me/.config/nvim/plugins/vim-phoenix/UltiSnips/elixir.snippets

## Output channel: highlight
[Info  - 5:52:17 PM] Highlight server running in node v10.15.3

Describe the bug
Unable to set the highlights for the floating hoverTarget or messageTarget for a diagnostic.

To Reproduce
Steps to reproduce the behavior:

  1. set "diagnostic.messageTarget": "float"
  2. set "coc.preferences.hoverTarget": "float"
  3. try altering the highlights for any/all of the following:
NormalFloat
CocFloating
CocPumFloating
CocPumFloatingDetail

Screenshots
Screenshot 2019-03-13 17 52 48

Most helpful comment

You need to define highlights for CocErrorFloat CocWarningFloat CocInfoFloat and CocHintFloat which linked to your sign highlight by default.

>All comments

You need to define highlights for CocErrorFloat CocWarningFloat CocInfoFloat and CocHintFloat which linked to your sign highlight by default.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lanox picture lanox  路  3Comments

andys8 picture andys8  路  3Comments

MacGuffinLife picture MacGuffinLife  路  4Comments

czepluch picture czepluch  路  3Comments

LinArcX picture LinArcX  路  4Comments