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

Native support for Happy's .y files and grammar language #4409

Open
anka-213 opened this issue Sep 23, 2024 · 1 comment
Open

Native support for Happy's .y files and grammar language #4409

anka-213 opened this issue Sep 23, 2024 · 1 comment
Labels
type: enhancement New feature or request

Comments

@anka-213
Copy link
Contributor

anka-213 commented Sep 23, 2024

Is your enhancement request related to a problem? Please describe.

Independent of the Haskell part of a Happy grammar (issue #689), there is also the grammar itself which would be nice to get some basic language server support for (like go to definition) to make it easier to navigate large grammars.

In this code

InlinePragma :: { Pragma }
InlinePragma
  : '{-#' 'INLINE' PragmaQName '#-}'
    { InlinePragma (getRange ($1,$2,$3,$4)) True $3 }

I would like to be able to go to definition for PragmaQName.

Describe the solution you'd like

I'd like some very basic language support for Happy's .y grammar files themselves integrated into HLS.

Describe alternatives you've considered

Another option would be to implement this as a completely separate language server and extension, since it is a separate language from Haskell, but that might make it more difficult to integrate with the inline Haskell parts (as well as inhibit discoverability). But maybe HLS's current architecture would make it difficult to add a non-haskell language, so it would be easier to make it separate anyways?

Additional context

@michaelpj
Copy link
Collaborator

I think this is doable - we have the cabal plugin which works on non-Haskell files, so you should be able to have a similar architecture. Actually working out what things are might be tricky, though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants