Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
hasrthur opened this issue Oct 11, 2020 · 2 comments
Closed

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

hasrthur opened this issue Oct 11, 2020 · 2 comments
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@hasrthur
Copy link

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)
@fendor
Copy link
Collaborator

fendor commented Oct 12, 2020

Hi, thanks for the bug report!
Looks like a duplicate of #96

@fendor fendor added the type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. label Oct 12, 2020
@jneira
Copy link
Member

jneira commented Oct 12, 2020

As commented in #96 the ghcide issue is https://github.com/haskell/ghcide/issues/107 and it was closed by haskell/ghcide#836 son only left bump the ghcide submodule to include it: #463

Closing this, you can follow #96 for updates.

@jneira jneira closed this as completed Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

3 participants