Skip to content

Conversation

gracjan
Copy link
Contributor

@gracjan gracjan commented Mar 28, 2016

Fixes #899.

@gracjan
Copy link
Contributor Author

gracjan commented Mar 28, 2016

So it currently looks like this:

font-lock-types

font-lock-types-case

@gracjan gracjan changed the title Font lock types in their own color [WIP] Font lock types in their own color Mar 28, 2016
@gracjan
Copy link
Contributor Author

gracjan commented Mar 28, 2016

Todo:

  • multiline cases do not refresh properly, possibly use font-lock-extend-region-functions
  • handle class and instance with functional deps
  • handle data ... where (looks easy)
  • handle normal data X1 = X2 Int String (this is hard, has to know that X2 is constructor but Int and String are types )
  • write lots of unit cases
  • handle module (...) header (very hard)
  • patterns? views?
  • handle type MyInt = Int (hard, has to cross equal sign)
  • handle data family and type family
  • handle data X = Int :+: String | String :-: Int
  • handle data X a b = Either a Int :+: Either String b | Either a String :-: Either Int b

@gracjan
Copy link
Contributor Author

gracjan commented Mar 29, 2016

In case of data X = X1 Int | X2 String everything is a type except uppercase constructors directly following equals or vertical bar.

@geraldus
Copy link
Contributor

Nice solution (:

@gracjan
Copy link
Contributor Author

gracjan commented Mar 29, 2016

So both patterns and views work only with constructors.

haskell-mode.el Outdated
((and (member (match-string-no-properties 0)
'("<-" "=" "<-" "" "," ";"
")" "]" "}" "|"
"case" "class" "data" "default" "deriving" "do"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can haskell-font-lock--reverved-ids be re-used here? (:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorta maybe. I mean I'm too tired to make sure that all keywords end types. Is forall a keyword? is there other keyword that can happen in types?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And, btw, thanks for reading this. It wasn't easy to write so I'm grateful for all the help.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always read everything, PRs, issues, and code (: But, unfortunately most of the time I have nothing to add ):

@gracjan gracjan changed the title [WIP] Font lock types in their own color Font lock types in their own color Mar 29, 2016
@gracjan
Copy link
Contributor Author

gracjan commented Mar 29, 2016

Mostly done. Lets give it a couple of days lying here and then we merge.

@gracjan gracjan merged commit c4c74ba into haskell:master Apr 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants