nwolverson / purescript-language-server

MIT License
184 stars 41 forks source link

Output of build tool errors #150

Closed wclr closed 2 years ago

wclr commented 3 years ago
spago build -u --json-errors

May output such error message:

[error] The following packages do not exist in your package set:
[error]   - simple-json

Due to this LS outputs not very informative notification:

Problem running build: didn't find JSON output

I believe for DX it would be better to output particular errors produced by the build tool.

How do you think it would be better to handle it? Some small problems I see here:

nwolverson commented 3 years ago

Right, there are 2 categories of failed build where the build tool exists but doesn't provide those JSON errors from the compiler

And the error really does point more strongly to the 1st one than it should.

So the actual error is in the output panel, maybe a possibly truncated version in the notification could be good. Could actually provide an action to show the output panel to see the full error.

Now that the compiler outputs the JSON output to stdout, stderr on an error return code should be a better approximation of a message to show.

wclr commented 3 years ago

Could actually provide an action to show the output panel to see the full error.

I believe such things editor-specific things are not available through LSP api. It could be handled specially for vscode though, it could be another method of displaying the message (e.g., a dialog window).

nwolverson commented 3 years ago

You're right, I was mistakenly looking at the vscode extension API rather than the LSP spec, there is no output channel concept, just window/logMessage. It would need to be a custom message and some config/capability to determine if the action should be available - not worth it.

nwolverson commented 2 years ago

Made a change to simply output (truncated) stderr output on error, if no JSON output is found.

Errors that result in something useful on stderr output, but still produce JSON from the compiler build, can't really be distinguished for a regular failed build, so I can't see any improvement there.

Any specific examples to improve welcome, at least the original case is better now.