-
-
Notifications
You must be signed in to change notification settings - Fork 68
feat(syntax): add support for Haskell (#360) #559
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
Sorry for the wait on this @carlwr, I wanted to get around to reviewing this soon but I've pre-occupied with other parts of the organisation in my spare time. Will try to get to this next weekend (23rd/24th Aug) ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to raise this PR!
I've tested it out locally and it does look much better. One change I made was to remove rosewater
imports and leave it to the default.
I tried making some other changes to better align with the style guide but those ended up having side effects that made the theme look worse overall, so happy to approve and merge this now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Realised that we won't be able to merge without some more changes, sorry!
{ | ||
name: "typeclasses", | ||
scope: ["entity.name.type.class"], | ||
settings: { | ||
foreground: palette.yellow, | ||
fontStyle: "", | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in this file should be specific to haskell in the textmate scopes. This generic scope will affect other languages outside of haskell and should be carefully introduced in the index.ts
file if need be.
I'd like to see this removed in favour of a more specific scope.
{ | ||
name: "type parameters", | ||
scope: ["entity.name.type.parameter", "variable.other.generic-type"], | ||
settings: { foreground: palette.maroon }, | ||
}, | ||
{ | ||
name: "pragma keywords", | ||
scope: [" keyword.other.preprocessor"], | ||
settings: { foreground: palette.red }, | ||
}, | ||
{ | ||
name: "pragma arguments", | ||
scope: [" keyword.other.preprocessor.extension"], | ||
settings: { foreground: palette.peach }, | ||
}, | ||
{ | ||
name: "preprocessor directives", | ||
scope: ["meta.preprocessor"], | ||
settings: { foreground: palette.rosewater }, | ||
}, | ||
|
||
{ | ||
name: "type families", | ||
scope: ["entity.name.type.interface"], | ||
settings: { foreground: palette.pink }, | ||
// we need something distinct from typeclasses | ||
// -> pick pink which is used for meta-variables in Rust | ||
}, | ||
{ | ||
name: "getters in data constructors/records", | ||
scope: ["variable.other.property", "variable.other.member"], | ||
settings: { foreground: palette.blue }, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything in this file should be specific to haskell in the textmate scopes. These generic scope will affect other languages outside of haskell and should be carefully introduced in the index.ts
file if need be.
I'd like to see this removed in favour of a more specific scope.
Considerably improves the colorization of Haskell code.
Notes:
Suitable Haskell sample code to check how this PR colors, and the code used for the screenshots:
https://github.com/catppuccin/catppuccin/blob/main/samples/haskell.hs
Screenshots