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

Multi-line errors are created as multiple problems #2

Open
Tehnix opened this issue Apr 5, 2018 · 0 comments
Open

Multi-line errors are created as multiple problems #2

Tehnix opened this issue Apr 5, 2018 · 0 comments
Labels
enhancement New feature or request

Comments

@Tehnix
Copy link
Owner

Tehnix commented Apr 5, 2018

The problemMatcher in VSCode unfortunately cannot handle multi-line errors (microsoft/vscode#9635). This means that currently, if the problem matching tasks is used, it'll look something like this,

screenshot 2018-04-06 01 26 35

While this is digestable, preferably this would only be one line.

An idea, because I doubt VSCode is gonna fix this any time soon, would be to send the stack output through a parser, which would convert the problem text to a single line, and leave everything else in tact.

A couple of regex playgrounds for the test log below,

Ignoring that the GHCJS boot package "aeson" has a different version, 1.1.1.0, than the resolver's wanted version, 1.0.2.1
lens-4.15.1: configure
lens-4.15.1: build
lens-4.15.1: copy/register
common-0.1.0.0: configure (lib)
common-0.1.0.0: build (lib)
common-0.1.0.0: copy/register
frontend-0.1.0.0: configure (lib + exe + test)
Configuring frontend-0.1.0.0...
frontend-0.1.0.0: build (lib + exe + test)
Preprocessing library frontend-0.1.0.0...
[1 of 2] Compiling Frontend.Update  ( src/Frontend/Update.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/Frontend/Update.js_o )

/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/src/Frontend/Update.hs:3:1: warning: [-Wunused-imports]
    The import of ‘makeLenses’ from module ‘Control.Lens’ is redundant
[2 of 2] Compiling Paths_frontend   ( .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/autogen/Paths_frontend.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/Paths_frontend.js_o )
Preprocessing executable 'frontend' for frontend-0.1.0.0...
[1 of 1] Compiling Main             ( bin/Main.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/frontend/frontend-tmp/Main.js_o ) [Frontend.Update changed]
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/frontend/frontend.jsexe (Main)
Preprocessing test suite 'spec' for frontend-0.1.0.0...
[1 of 2] Compiling Frontend.UpdateSpec ( test/Frontend/UpdateSpec.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/spec/spec-tmp/Frontend/UpdateSpec.js_o ) [Frontend.Update changed]

/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/test/Frontend/UpdateSpec.hs:5:1: warning: [-Wunused-imports]
    The import of ‘Common.Model’ is redundant
      except perhaps to import instances from ‘Common.Model’
    To import instances alone, use: import Common.Model()

/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/test/Frontend/UpdateSpec.hs:6:1: warning: [-Wunused-imports]
    The import of ‘Frontend.Update’ is redundant
      except perhaps to import instances from ‘Frontend.Update’
    To import instances alone, use: import Frontend.Update()

/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/test/Frontend/UpdateSpec.hs:13:7: warning: [-Wtype-defaults]
    • Defaulting the following constraints to type ‘[Char]’
        (Show a0)
          arising from a use of ‘shouldBe’
          at test/Frontend/UpdateSpec.hs:13:7-60
        (Eq a0)
          arising from a use of ‘shouldBe’
          at test/Frontend/UpdateSpec.hs:13:7-60
        (Data.String.IsString a0)
          arising from the literal ‘"Not implemented yet"’
          at test/Frontend/UpdateSpec.hs:13:7-27
    • In a stmt of a 'do' block:
        "Not implemented yet" `shouldBe` "Not implemented yet"
      In the second argument of ‘($)’, namely
        ‘do { "Not implemented yet" `shouldBe` "Not implemented yet" }’
      In the second argument of ‘($)’, namely
        ‘it "just works..."
         $ do { "Not implemented yet" `shouldBe` "Not implemented yet" }’
[2 of 2] Compiling Main             ( test/Spec.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/spec/spec-tmp/Main.js_o ) [Test.Hspec changed]
Linking .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/spec/spec.jsexe (Frontend.UpdateSpec,Main)
frontend-0.1.0.0: copy/register
Installing library in
/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/.stack-work/install/x86_64-osx/lts-8.11/ghcjs-0.2.1.9008011_ghc-8.0.2/lib/x86_64-osx-ghcjs-0.2.1.9008011-ghc8_0_2/frontend-0.1.0.0-HK9srDkIBqEEHrW37I149C
Installing executable(s) in
/Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/.stack-work/install/x86_64-osx/lts-8.11/ghcjs-0.2.1.9008011_ghc-8.0.2/bin
Warning: the following files would be used as linker inputs, but linking is not being done: .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/frontend/frontend
Registering frontend-0.1.0.0...
frontend-0.1.0.0: test (suite: spec)

Progress: 3/4
Frontend.UpdateSpec
  Just a blank test
    just works...

Finished in 0.0200 seconds
1 example, 0 failures

frontend-0.1.0.0: Test suite spec passed
Completed 4 action(s).
ExitSuccess
Type help for available commands. Press enter to force a rebuild.

Log files have been written to: /Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/.stack-work/logs/
ExitSuccess
Type help for available commands. Press enter to force a rebuild.
Ignoring that the GHCJS boot package "aeson" has a different version, 1.1.1.0, than the resolver's wanted version, 1.0.2.1
frontend-0.1.0.0: unregistering (local file changes: src/Frontend/Update.hs)
frontend-0.1.0.0: build (lib + exe)
Log files have been written to: /Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/.stack-work/logs/

--  While building custom Setup.hs for package frontend-0.1.0.0 using:
      /Users/tehnix/.stack/setup-exe-cache/x86_64-osx/Cabal-simple_mPHDZzAJ_1.24.2.0_ghcjs-0.2.1.9008011_ghc-8.0.2 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs build lib:frontend exe:frontend --ghcjs-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: /Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/.stack-work/logs/frontend-0.1.0.0.log

    Preprocessing library frontend-0.1.0.0...
    [2 of 2] Compiling Frontend.Update  ( src/Frontend/Update.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.2.0_ghcjs/build/Frontend/Update.js_o )

    /Users/tehnix/GitHub/Tehnix/miso-isomorphic-stack/frontend/src/Frontend/Update.hs:17:43: error:
        • Variable not in scope: ri :: Miso.URI
        • Perhaps you meant one of these:
            ‘uri’ (line 17), ‘pi’ (imported from Prelude),
            ‘Common.uri’ (imported from Common.Model)
Type help for available commands. Press enter to force a rebuild.
@Tehnix Tehnix added the enhancement New feature or request label Apr 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant