Skip to content

Warnings in Cabal files #196

Open
Open
@dschrempf

Description

@dschrempf

When activating lsp-mode in Haskell Cabal files, I receive numerous warnings (I tried GHC 9.10.1, HLS 2.9.0.0 and HLS 2.10.0.0):

LSP :: Error from the Language Server: No plugins are available to handle this SMethod_TextDocumentDocumentHighlight request.
 Plugins installed for this method, but not available to handle this request are:
ghcide-hover-and-symbols does not support .cabal filetypes). (Method not Found)

A temporary fix is

(add-hook 'haskell-cabal-mode-hook
            ;; Document highlight is not supported for Cabal files.
            (lambda () (setq-local lsp-enable-symbol-highlighting nil)))

There are still some warnings about code lenses, but they are less prominent, and do not disturb the workflow.

EDIT:
For Cabal project files, we get more warnings:

pragmas-suggest does not support .project filetypes).
ghcide-code-actions-bindings does not support .project filetypes).
cabalHaskellIntegration does not support .project filetypes).
explicit-fields does not support .project filetypes).
ghcide-code-actions-type-signatures does not support .project filetypes).
ghcide-code-actions-fill-holes does not support .project filetypes).
changeTypeSignature does not support .project filetypes).
ghcide-code-actions-imports-exports does not support .project filetypes).
cabal does not support .project filetypes).
overloaded-record-dot does not support .project filetypes).
gadt does not support .project filetypes).
importLens does not support .project filetypes).
class does not support .project filetypes).
qualifyImportedNames does not support .project filetypes).
alternateNumberFormat does not support .project filetypes).
pragmas-disable does not support .project filetypes).

I guess this is to be expected. Do you think it is worth adding support for cabal and cabal.project files? Where do we need to start? What do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions