-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Open
carlwr
wants to merge
19
commits into
catppuccin:main
Choose a base branch
from
carlwr:add-haskell
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
85ca553
feat(syntax): add support for Haskell (#360)
carlwr 033cc66
fix(haskell): remove rosewater override for imports
sgoudham 4ad1aed
fix(haskell): be specific for type constructors
sgoudham 0909328
chore: remove whitespace
sgoudham 3bc2962
Merge branch 'main' into add-haskell
sgoudham 6631b41
style(haskell): normalize formatting, adjust names
carlwr e876706
fix(haskell): remove use of never-assigned scopes
carlwr 02e2535
fix(haskell): remove module name override
carlwr 3941682
fix(haskell): make all selectors haskell-specific
carlwr 6724286
refactor(haskell): split preprocessor rule
carlwr 61fb57e
fix(haskell): use style guide colors for preprocessor
carlwr 95bfca6
feat(haskell): anticipate lavender properties
carlwr c84978d
feat(haskell): add styling of pattern synonyms
carlwr 4b7172a
fix(haskell): make italics styling consistent
carlwr 8c5d5dc
chore(haskell): adjust and extend leading comment
carlwr bc32838
feat(haskell): add general improvements and fixes
carlwr a570d8d
Merge branch 'main' into add-haskell
sgoudham 3af0f46
fix(haskell): adjust pragmas, preprocessor styling
carlwr 8743c23
Merge branch 'main' into add-haskell
carlwr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
import type { TextmateColors, ThemeContext } from "@/types"; | ||
|
||
const tokens = (context: ThemeContext): TextmateColors => { | ||
const { palette } = context; | ||
|
||
/* | ||
should preferrably appear visually distinct: | ||
- data constructors -> use blue | ||
- type constructors -> use yellow+italic | ||
- typeclasses -> use yellow | ||
*/ | ||
|
||
return [ | ||
{ | ||
name: "data constructors", | ||
scope: [ | ||
"variable.other.enummember", | ||
"meta.declaration.data constant.other", | ||
"constant.other", | ||
], | ||
settings: { foreground: palette.blue }, | ||
// like functions (capitalized -> still visually distinct) | ||
}, | ||
{ | ||
name: "type constructors", | ||
scope: ["entity.name.type", "storage.type"], | ||
settings: { | ||
foreground: palette.yellow, | ||
fontStyle: "italic", | ||
}, | ||
}, | ||
{ | ||
name: "typeclasses", | ||
scope: ["entity.name.type.class"], | ||
settings: { | ||
foreground: palette.yellow, | ||
fontStyle: "", | ||
}, | ||
}, | ||
sgoudham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
name: "module name", | ||
scope: "meta.declaration.module.haskell entity.name.namespace.haskell", | ||
settings: { | ||
foreground: palette.peach, // as in Rust | ||
}, | ||
}, | ||
{ | ||
name: "imports", | ||
scope: ["entity.name.namespace"], | ||
settings: { foreground: palette.rosewater }, | ||
}, | ||
{ | ||
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 }, | ||
}, | ||
sgoudham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
name: "fix else keyword", | ||
scope: ["keyword.control.else.haskell"], | ||
settings: { foreground: palette.mauve }, | ||
// catppuccin default sets to yellow considering it preprocessor-like, which it is not for Haskell | ||
}, | ||
]; | ||
}; | ||
|
||
export default tokens; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.