Skip to content

Refactor plugin shows "bug in srcspan parser" when trying to construct code action #4079

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

Closed
jhrcek opened this issue Feb 16, 2024 · 0 comments · Fixed by #4080
Closed

Refactor plugin shows "bug in srcspan parser" when trying to construct code action #4079

jhrcek opened this issue Feb 16, 2024 · 0 comments · Fixed by #4080
Labels
status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@jhrcek
Copy link
Collaborator

jhrcek commented Feb 16, 2024

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:
Screenshot from 2024-02-16 11-37-07

The error is coming from here:

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant