-
-
Notifications
You must be signed in to change notification settings - Fork 412
Description
Your environment
Which OS do you use?
Linux
Which version of GHC do you use and how did you install it?
9.4.8
How is your project built (alternative: link to the project)?
Which LSP client (editor/plugin) do you use?
VSCode
Which version of HLS do you use and how did you install it?
latest master
Have you configured HLS in any way (especially: a hie.yaml file)?
hie.yaml
This compiler error:
• Illegal term-level use of the type constructor or class ‘Id’
• imported from ‘PI.Core.Id’ at /home/jhrcek/Devel/github.com/Holmusk/PI/backend/src/PI/Db/CohortExplorer/Builder.hs:65:20-21
• Perhaps use variable ‘id’ (imported from Prelude)
Perhaps you want to add ‘Id’ to the import list in the import of
‘PI.Core.Id’
(/home/jhrcek/Devel/github.com/Holmusk/PI/backend/src/PI/Db/CohortExplorer/Builder.hs:65:1-22).
• In the second argument of ‘criteriaQuery’, namely
‘(Id 1 :: Id Cache)’
In the second argument of ‘($)’, namely
‘criteriaQuery diagnosisLookup (Id 1 :: Id Cache) criteria’
In a stmt of a 'do' block:
pure $ criteriaQuery diagnosisLookup (Id 1 :: Id Cache) criteria
leads to this error being shown in the clinet:

The error is coming from here:
haskell-language-server/plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs
Line 952 in e93528b
| _ -> error "bug in srcspan parser", |
After adding some tracing I see that srcspan that's being passed to the parser is this:
srcspan="/home/jhrcek/Devel/github.com/Holmusk/PI/backend/src/PI/Db/CohortExplorer/Builder.hs:65:1-22). \8226 In the second argument of \8216criteriaQuery\8217, namely \8216(Id 1 :: Id Cache)\8217 In the second argument of \8216($)\8217, namely \8216criteriaQuery diagnosisLookup (Id 1 :: Id Cache) criteria\8217 In a stmt of a 'do' block: pure $ criteriaQuery diagnosisLookup (Id 1 :: Id Cache"
which seems like the regex extracting the input for srcpan parser is consuming too much input.
I'll look into this later.