-
-
Notifications
You must be signed in to change notification settings - Fork 369
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
Completion / highlighting for default-extensions in package.yaml (hpack / stack) #3590
Comments
I should maybe note that the current behavior is "HLS stops responding, you won't know till you |
HLS provides no diagnostics for However, we ought to show the stack output error... You should be able to see a red squiggle in the first line of the file, do you not? |
Thank you for mentioning hls-cabal-plugin :) I checked again, and there is some message - though hidden up in the first line of the .hs file [{
"resource": "/home/artur/projects/snip/src/Lib.hs",
"owner": "Haskell (snip)",
"severity": 8,
"message": "target ‘-XExplicitForall’ is not a module name or a source file",
"source": "compiler",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 2,
"endColumn": 1
}] I've the following thoughts on that:
Maybe HLS could show a pop-up / toast in such cases (cases where further compiler diagnostics are not possible / make no sense)? I also noticed HLS reloads when I add to Would a hls-hpack-plugin contribution be welcome? |
The error is obtained from
Notifications in LSP are basically unformatted. The only thing reliable about them are newlines. I don't think it is better than having a diagnostic at the top.
HLS reloads on any changes to
I am not sure what an |
My main issue though is "an error is hidden up the top of my file, far from the last places I've edited (package.yaml, .hs file in question). There's no feedback at the cursor, even when I attempt introducing more errors. Did HLS get stuck? [open errors list] Oh no, the error is at line 1" In this case, the issue could've been avoided by having package.yaml checked, or by having the diagnostic from line 1 in the file brought up as a popup :)
I double checked, indeed it reloads when I introduce the error in
Love that idea :) I found sol/hpack#521, but no schema has been developed so far. This could be used until it lands in https://www.schemastore.org/json/ Installing the YAML extension could also be proposed by Haskell extension when visiting package.yaml, for all this to make sense?
|
We used to underline the whole file with a red squiggly line, but that was deemed a bit too aggressive :)
Welp, that's a bug then. The configuration file reload logic was always a tad unreliable.
I have no experience with your proposed change, but it looks good to me and like something we want.
this is a bit confusing to me, in theory, we should show the same error as stack. |
As long as the popup makes me check the global error list - I'm set :) One heuristic that comes to mind, is: when build config is borked, multiple (basically all) files have the same / similar diagnostic at line 1. So maybe a workaround would be: This doesn't address the bigger issue of diagnostics/feedback being far from the place we're editing at. Requested outputs:
|
Not sure if this is a HLS issue, but I'd love to get a squiggly warning in package.yaml whenever I misspell a language extension, e.g.:
Completion would be nice as well, but is secondary. Thanks! :)
The text was updated successfully, but these errors were encountered: