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

Different colors for record names in data with record syntax #38

Closed
shlok opened this issue Jul 9, 2017 · 1 comment
Closed

Different colors for record names in data with record syntax #38

shlok opened this issue Jul 9, 2017 · 1 comment
Labels

Comments

@shlok
Copy link

shlok commented Jul 9, 2017

Note the different colors:

data

@JustusAdam
Copy link
Owner

Yes, I was aware of this already.

The reason for this bug is that the record fields and their type signatures actually have no special parsing.
They are handled like any other line of code.
It just so happens that fields which are not preceded by a comma (or curly brace) on the same line look like signature definitions of functions, thus the field label has the same color as a function and the other labels look like inline type signatures, hence no special highlighting for the field.

There are two ways to fix this.

  1. (quick and dirty) Don't highlight function names in signature definitions
  2. Add special treatment for a data definition by writing proper parse rules for it.

As I'll want to do Nr 2 at some point anyways to properly distinguish types and constructors in data definitions at some point I think I'll go with that.
Not sure yet when I'll get around to it though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants