Skip to content

added completion for language to { -# LANGUAGE #2133

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
wants to merge 1 commit into from

Conversation

alexnaspo
Copy link
Contributor

fixes #681

@pepeiborra
Copy link
Collaborator

I'm not sure what's going on here, but we already have completions for pragmas and they seem to work for me:

validPragmas :: [(T.Text, T.Text)]
validPragmas =
[ ("LANGUAGE ${1:extension}" , "LANGUAGE")
, ("OPTIONS_GHC -${1:option}" , "OPTIONS_GHC")
, ("INLINE ${1:function}" , "INLINE")
, ("NOINLINE ${1:function}" , "NOINLINE")
, ("INLINABLE ${1:function}" , "INLINABLE")
, ("WARNING ${1:message}" , "WARNING")
, ("DEPRECATED ${1:message}" , "DEPRECATED")
, ("ANN ${1:annotation}" , "ANN")
, ("RULES" , "RULES")
, ("SPECIALIZE ${1:function}" , "SPECIALIZE")
, ("SPECIALIZE INLINE ${1:function}", "SPECIALIZE INLINE")
]

Perhaps you could look into refining the existing completion snippet so that it inserts the pragma close tokens #-} and/or characterise whether it works in all situations?

Screen.Recording.2021-08-28.at.12.23.02.mov

@alexnaspo
Copy link
Contributor Author

alexnaspo commented Aug 28, 2021

@pepeiborra - sure I can take a look at that. Do you think I should move the auto completions into the pragmas plugin?

The difference here is that it auto completes on "language" rather than "{-# LANGUAGE" as the ticket requests

@ndmitchell
Copy link
Collaborator

Haskell is case-insensitive for its pragmas, so lAnGuAgE works just fine. Perhaps the completions module just needs to be educated to that fact?

@pepeiborra
Copy link
Collaborator

@pepeiborra - sure I can take a look at that. Do you think I should move the auto completions into the pragmas plugin?

That would be great

@alexnaspo
Copy link
Contributor Author

alexnaspo commented Aug 28, 2021

@pepeiborra - sure I can take a look at that. Do you think I should move the auto completions into the pragmas plugin?

That would be great

I opened up a separate PR because it no longer closes the above ticket @pepeiborra
#2134

@jneira
Copy link
Member

jneira commented Aug 28, 2021

@alexnaspo so could we close this one, as it is included in #2134 iiuc?

@jneira jneira changed the title added completion for language to { -# LANGAUGE added completion for language to { -# LANGUAGE Aug 28, 2021
@alexnaspo alexnaspo closed this Aug 28, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A language pragma snippet would be very useful
5 participants