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

Missing keywords: data and type families, pattern synonyms, deriving via #72

Closed
sheaf opened this issue Nov 5, 2018 · 4 comments
Closed

Comments

@sheaf
Copy link
Collaborator

sheaf commented Nov 5, 2018

Here are some examples of missing keywords:

the keywords "family", "instance" and "where" in type/data families, e.g.:
type family
open_type_family

"via" from the deriving via extension:
deriving_via_keyword
(Note also that the type variable in the standalone deriving declaration is not highlighted correctly.)

"pattern" for a pattern synonym declaration
pattern_synonyms

JustusAdam added a commit that referenced this issue Apr 22, 2020
See #72

We still need support for multi-line deriving via
@sheaf
Copy link
Collaborator Author

sheaf commented Apr 26, 2020

Excellent, the addition of highlighting for type families and pattern synonyms is very much appreciated. Thanks!

The code for highlighting type families should be extended to work with data families too:
data_family_highlighting
Changing data to type in the above makes the highlighting work properly, so it seems it's just a case of allowing the data keyword.

For pattern synonyms, multiple patterns are not currently highlighted properly:
multiple_pattern_synonyms_highlighting
If that's annoying to fix then no big deal of course. (I'm not sure why False is not getting highlighted properly there; I've reported that separately in #122.)

As seen in this screenshot, it would also be nice to support the keywords for the three built-in deriving strategies: stock, newtype and anyclass.

Finally, the highlighting for the single-line deriving via that is currently implemented seems to always require parentheses:
deriving_via_highlighting

Sorry for including all this in this single ticket; I can split it out into other issues if you would prefer.
I have a few other bugs to report, but let me be clear that I am very appreciative of the effort you have put in, and don't in any way mean to discourage. Thanks again.

sheaf added a commit to sheaf/language-haskell that referenced this issue Apr 26, 2020
sheaf added a commit to sheaf/language-haskell that referenced this issue Apr 26, 2020
@sheaf
Copy link
Collaborator Author

sheaf commented Apr 27, 2020

I realise now that defining multiple patterns at once in a pattern synonym is actually already supported, but it's #122 that makes it look otherwise.

JustusAdam added a commit that referenced this issue Apr 27, 2020
@JustusAdam
Copy link
Owner

Okay, I think I got them all now?

Thanks for the diligent reporting!

@sheaf
Copy link
Collaborator Author

sheaf commented Apr 30, 2020

All the keywords mentioned in this ticket are now supported, so I'm closing this issue.

Some highlighting issues still remain, e.g. type families aren't correctly highlighting types (highlighting them as values instead). This is being tracked separately in #133.

@sheaf sheaf closed this as completed Apr 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants