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

Font-lock fails for type expressions #35

Closed
ghost opened this issue Feb 4, 2015 · 2 comments
Closed

Font-lock fails for type expressions #35

ghost opened this issue Feb 4, 2015 · 2 comments

Comments

@ghost
Copy link

ghost commented Feb 4, 2015

Font-lock rules seems to be failing to apply to type expressions in many cases.

These cases fail for me:

(* type signatures never work *)
val x : int
val f : int -> int
(* inline function type signatures - parameters seem to break it *)
let f x : int = x + 1

Only non-function values declared with let and type definitions work.

@Chris00
Copy link
Member

Chris00 commented Feb 4, 2015

If you are talking about the types not being highlighted, that is a design decision. I try to highlight the types when they are introduced, not so much when they are used — although I do in some cases such as (x: t). Highlighting all the signatures after val was not completely reliable — it is hard to know when they finish with regexps — and, IMHO, not very useful — val and the function name are highlighted, what follows is necessarily a signature. For the case let f x : t =, I could highlight t since it is "lost" inside another expression and coloring it may help readability.

Chris00 added a commit that referenced this issue Feb 4, 2015
@ghost
Copy link
Author

ghost commented Feb 4, 2015

For consistency, the let case is important to have, and it does help readability. I also think highlighting val types would also be more consistent. But it's not as useful, so I won't push it.

Thanks for adding this, though.

@ghost ghost closed this as completed Feb 4, 2015
This issue was closed.
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

No branches or pull requests

1 participant