Skip to content

No warnings even if correct options are set in cabal file #494

Closed
@hasrthur

Description

@hasrthur

Subject of the issue

There are no warning in vscode though when running cabal run they are present

Your environment

  • Output of haskell-language-server --probe-tools or haskell-language-server-wrapper --probe-tools
    haskell-language-server version: 0.5.0.0 (GHC: 8.10.2) (PATH: /Users/arthur/Library/Application Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.5.0-darwin-8.10.2) (GIT hash: 14497f2)
    Tool versions found on the $PATH
    cabal: 3.2.0.0
    stack: 2.3.3
    ghc: 8.10.2
  • Which lsp-client do you use
    • VS Code
  • Link to the project: https://github.com/arthurborisow/hls-warnings

Steps to reproduce

Create a function which should generate warning about in-exhaustive pattern matching.
Output of cabal run:

Resolving dependencies...
Build profile: -w ghc-8.10.2 -O1
In order, the following will be built (use -v for more details):
 - test-patterns-0.1.0.0 (exe:test-patterns) (first run)
Configuring executable 'test-patterns' for test-patterns-0.1.0.0..
Warning: The 'license-file' field refers to the file 'LICENSE' which does not
exist.
Preprocessing executable 'test-patterns' for test-patterns-0.1.0.0..
Building executable 'test-patterns' for test-patterns-0.1.0.0..
[1 of 1] Compiling Main             ( Main.hs, /Users/arthur/Projects/haskell/test-patterns/dist-newstyle/build/x86_64-osx/ghc-8.10.2/test-patterns-0.1.0.0/x/test-patterns/build/test-patterns/test-patterns-tmp/Main.o )

Main.hs:7:1: warning: [-Wincomplete-patterns]
    Pattern match(es) are non-exhaustive
    In an equation for ‘f’:
        Patterns not matched:
            Just p where p is not one of {1}
            Nothing
  |
7 | f (Just 1) = 1
  | ^^^^^^^^^^^^^^
Linking /Users/arthur/Projects/haskell/test-patterns/dist-newstyle/build/x86_64-osx/ghc-8.10.2/test-patterns-0.1.0.0/x/test-patterns/build/test-patterns/test-patterns ...
Hello, Haskell!

Expected behaviour

VS Code should notify about incomplete pattern matching

Actual behaviour

VS Code ignores all warnings

Include debug information

Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:

Debug output:
haskell-language-server version: 0.5.0.0 (GHC: 8.10.2) (PATH: /Users/arthur/Library/Application Support/Code/User/globalStorage/haskell.haskell/haskell-language-server-0.5.0-darwin-8.10.2) (GIT hash: 14497f2503a2a0d389fabf3b146d674b9af41a34)
(haskell-language-server)Ghcide setup tester in /Users/arthur/Projects/haskell/test-patterns.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.3.3
ghc:		8.10.2


Step 1/4: Finding files to test in /Users/arthur/Projects/haskell/test-patterns
Found 2 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "Main.hs"
NotShowMessage (NotificationMessage {_jsonrpc = "2.0", _method = WindowShowMessage, _params = ShowMessageParams {_xtype = MtWarning, _message = "No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for Main.hs.\n Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie)"}})
Output from setting up the cradle Cradle {cradleRootDir = "/Users/arthur/Projects/haskell/test-patterns", cradleOptsProg = CradleAction: Cabal}
> Resolving dependencies...
> Build profile: -w ghc-8.10.2 -O1
> In order, the following will be built (use -v for more details):
>  - test-patterns-0.1.0.0 (exe:test-patterns) (configuration changed)
> Configuring executable 'test-patterns' for test-patterns-0.1.0.0..
> Warning: The 'license-file' field refers to the file 'LICENSE' which does not
> exist.
> Preprocessing executable 'test-patterns' for test-patterns-0.1.0.0..
[INFO] Using interface files cache dir: /Users/arthur/.cache/ghcide/main-debebe56737ad4428bdced1c874fb949b0c8f90a
[INFO] Making new HscEnv[main]
[INFO] Consulting the cradle for "Setup.hs"
NotShowMessage (NotificationMessage {_jsonrpc = "2.0", _method = WindowShowMessage, _params = ShowMessageParams {_xtype = MtWarning, _message = "No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for Setup.hs.\n Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie)"}})
Output from setting up the cradle Cradle {cradleRootDir = "/Users/arthur/Projects/haskell/test-patterns", cradleOptsProg = CradleAction: Cabal}
File:     /Users/arthur/Projects/haskell/test-patterns/Setup.hs
Hidden:   no
Range:    1:0-2:0
Source:   cradle
Severity: DsError
Message: 
  Multi Cradle: No prefixes matched
  pwd: /Users/arthur/Projects/haskell/test-patterns
  filepath: /Users/arthur/Projects/haskell/test-patterns/Setup.hs
  prefixes:
  ("./Main.hs",Cabal {component = Just "test-patterns:exe:test-patterns"})
Files that failed:
 * /Users/arthur/Projects/haskell/test-patterns/Setup.hs

[INFO] finish: User TypeCheck (took 0.07s)Completed (1 file worked, 1 file failed)

Metadata

Metadata

Assignees

No one assigned

    Labels

    component: ghcidetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions