Skip to content

Commit

Permalink
Style pragmas
Browse files Browse the repository at this point in the history
  • Loading branch information
brandon-leapyear committed Sep 25, 2021
1 parent de7f649 commit a9d43b1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions Syntaxes/Haskell++.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ contexts:
scope: keyword.other.pragma.haskell
pragmas-annotation:
- meta_scope: comment.block.pragma.annotation.haskell
- match: \b(type|module)\b
scope: keyword.other.annotation.haskell
- include: expressions
Expand Down
8 changes: 6 additions & 2 deletions Syntaxes/syntax_test_comments
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Test test test
-- <- comment.block.pragma.haskell punctuation.definition.comment
-- <- comment.block.pragma.haskell punctuation.definition.comment
--^^^^^^^^^^^^^^^^^^^^ comment.block.pragma.haskell
-- ^^^^^^^^^^^^^^ comment.block.pragma.annotation.haskell
--^ punctuation.definition.comment
-- ^^^ keyword.other.pragma.haskell
-- ^^^^ variable.other.function.haskell
Expand All @@ -70,7 +71,8 @@ Test test test
{-# ANN module "foo" #-}
-- <- comment.block.pragma.haskell punctuation.definition.comment
-- <- comment.block.pragma.haskell punctuation.definition.comment
--^^^^^^^^^^^^^^^^^^^^ comment.block.pragma.haskell
--^^^^^^^^^^^^^^^^^^^^^^ comment.block.pragma.haskell
-- ^^^^^^^^^^^^^^^^ comment.block.pragma.annotation.haskell
--^ punctuation.definition.comment
-- ^^^ keyword.other.pragma.haskell
-- ^^^^^^ keyword.other.annotation.haskell
Expand All @@ -80,7 +82,8 @@ Test test test
{-# ANN type MyList "foo" #-}
-- <- comment.block.pragma.haskell punctuation.definition.comment
-- <- comment.block.pragma.haskell punctuation.definition.comment
--^^^^^^^^^^^^^^^^^^^^ comment.block.pragma.haskell
--^^^^^^^^^^^^^^^^^^^^^^^^^^^ comment.block.pragma.haskell
-- ^^^^^^^^^^^^^^^^^^^^^ comment.block.pragma.annotation.haskell
--^ punctuation.definition.comment
-- ^^^ keyword.other.pragma.haskell
-- ^^^^ keyword.other.annotation.haskell
Expand All @@ -92,6 +95,7 @@ Test test test
-- <- comment.block.pragma.haskell punctuation.definition.comment
-- <- comment.block.pragma.haskell punctuation.definition.comment
--^^^^^^^^^^^^^^^^^^^ comment.block.pragma.haskell
-- ^^^^^^^^^^^^^ comment.block.pragma.annotation.haskell
--^ punctuation.definition.comment
-- ^^^ keyword.other.pragma.haskell
-- ^^^ variable.other.type.haskell
Expand Down
16 changes: 16 additions & 0 deletions Themes/Haskell++.sublime-color-scheme
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"cyan": "#2fbfbf",
"gold": "#bfa72f",
"green": "#8dbc2f",
"purple": "#ac5ebc",
"red": "#bf472f",
"teal": "color(var(cyan) blend(var(green) 50%))",
"yellow": "#e6db74",
Expand All @@ -33,6 +34,21 @@
{ "scope": "keyword", "foreground": "var(red)" },
{ "scope": "invalid", "foreground": "var(red)" },

// Pragmas
{
"scope": "comment.block.pragma",
"foreground": "var(purple)",
},
{
"scope": "comment.block.pragma.annotation",
// TODO: cancel comment style and let normal expression colors work
"foreground": "var(gold)",
},
{
"scope": "keyword.other.annotation",
"foreground": "color(var(purple) blend(var(red) 50%))",
},

// Imports
{
"scope": "keyword.control.import, keyword.other.import",
Expand Down

0 comments on commit a9d43b1

Please sign in to comment.