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

Spago doesn't tell what is a warning and what is an error #1148

Open
flip111 opened this issue Dec 24, 2023 · 2 comments
Open

Spago doesn't tell what is a warning and what is an error #1148

flip111 opened this issue Dec 24, 2023 · 2 comments

Comments

@flip111
Copy link
Contributor

flip111 commented Dec 24, 2023

A warning

[395/395 UnusedName] src/Websocket.purs:377:7

  377        otherwise      -> pure unit
             ^^^^^^^^^

  Name otherwise was introduced but not used.
  in value declaration receiveServerEvent

An error

[2/2 UnknownImport] src/Websocket.purs:39:26

  39  import Data.Array.Extra (firstMaybe)
                               ^^^^^^^^^^

  Cannot import value firstMaybe from module Data.Array.Extra
  It either does not exist or the module does not export it.

The only way to tell that it is a warning or an error is by the color. But now we immediately see the problem, as soon as you copy paste and lose terminal colors the information is gone. I would suggest the following:
395 Warning UnusedName in src/Websocket.purs:377:7

The /395 and the brackets [, ] don't really add much but i would be ok if they stayed

@f-f
Copy link
Member

f-f commented Dec 24, 2023

Ah indeed - the output of the compiler is going through PSA, so I think we should be able to patch it there? (cc @JordanMartinez)

@JordanMartinez
Copy link
Collaborator

Yeah, this part would need to be updated if one wanted to add support for this: https://github.com/purescript/spago/blob/master/src/Spago/Psa/Printer.purs#L73-L90. I don't personally see the need, so I'm not interested in implementing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants