Skip to content

Commit

Permalink
customizations to elixir support
Browse files Browse the repository at this point in the history
- added defstruct and defguard to keywords
- added class for improved display of module references
- customized atom-one-dark theme for displaying module references
  • Loading branch information
brainlid committed Feb 15, 2020
1 parent d326a07 commit 092fdd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/languages/elixir.js
Expand Up @@ -12,7 +12,7 @@ export default function(hljs) {
var ELIXIR_KEYWORDS =
'and false then defined module in return redo retry end for true self when ' +
'next until do begin unless nil break not case cond alias while ensure or ' +
'include use alias fn quote require import with|0';
'include use alias fn quote require import defstruct defguard with|0';
var SUBST = {
className: 'subst',
begin: '#\\{', end: '}',
Expand Down Expand Up @@ -137,6 +137,10 @@ export default function(hljs) {
className: 'variable',
begin: '(\\$\\W)|((\\$|\\@\\@?)(\\w+))'
},
{ // Usage of a module, struct, etc. Customized and paired with atom-one-dark.css customization
className: ['module-reference'],
begin: '([A-Z][a-zA-z0-9_]+)'
},
{
begin: '->'
},
Expand Down
4 changes: 4 additions & 0 deletions src/styles/atom-one-dark.css
Expand Up @@ -62,6 +62,10 @@ hue-6-2: #e6c07b
.hljs-class .hljs-title {
color: #e6c07b;
}
/* Customization to make module usage appear nice */
.hljs-module-reference {
color: #e6c07b;
}

.hljs-attr,
.hljs-variable,
Expand Down

0 comments on commit 092fdd4

Please sign in to comment.