Skip to content

Commit

Permalink
fix: use correct colour for C hex constants, straighten some brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
robertrossmann committed Apr 15, 2020
1 parent 499c8b9 commit 3992712
Show file tree
Hide file tree
Showing 6 changed files with 424 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/generators/mktokens/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as tokens from './tokens'
function mktokens({ code, colours, tilts = false }) {
return [
...tokens.common({ code }),
...tokens.cc({ code }),
...tokens.cpp({ code }),
...tokens.csharp({ code }),
...tokens.css({ code, colours }),
Expand Down
29 changes: 29 additions & 0 deletions packages/generators/mktokens/tokens/cc.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import { cc as cscope } from '@remedy/tools/tmscopes'

function cc({ code }) {
const punctuation = {
scope: cscope([
'storage.modifier.array.bracket.square',
]),
settings: {
foreground: code.punctuation,
},
}

const primitives = {
scope: cscope([
'keyword.other.unit',
]),
settings: {
foreground: code.primitives,
},
}

return [
punctuation,
primitives,
]
}


export default cc
2 changes: 2 additions & 0 deletions packages/generators/mktokens/tokens/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import javascript from './javascript'
import java from './java'
import css from './css'
import csharp from './csharp'
import cc from './cc'
import cpp from './cpp'
import makefile from './makefile'
import markdown from './markdown'
Expand All @@ -17,6 +18,7 @@ export {
java,
css,
csharp,
cc,
cpp,
makefile,
markdown,
Expand Down
9 changes: 9 additions & 0 deletions packages/generators/mktokens/tokens/tilted/straights.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
json,
yaml,
makefile,
cc,
css,
cs,
} from '@remedy/tools/tmscopes'
Expand Down Expand Up @@ -48,10 +49,18 @@ const types = {
settings,
}

const punctuation = {
scope: [
...cc(['storage.modifier.array.bracket.square']),
],
settings,
}

export default [
stringkeys,
language,
functions,
constants,
types,
punctuation,
]
2 changes: 2 additions & 0 deletions packages/tools/tmscopes.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { mkscope } from '.'

const cc = mkscope(['source.c', 'meta.embedded.block.c'])
const cpp = mkscope(['source.cpp', 'meta.embedded.block.cpp'])
const cs = mkscope(['source.cs', 'meta.embedded.block.csharp'])
const css = mkscope(['source.css', 'meta.embedded.block.css', 'meta.embedded.block.less'])
Expand All @@ -21,6 +22,7 @@ const terraform = mkscope(['source.terraform', 'meta.embedded.block.terraform'])
const yaml = mkscope(['source.yaml', 'meta.embedded.block.yaml', 'meta.embedded.block.frontmatter'])

export {
cc,
cpp,
cs,
css,
Expand Down
Loading

0 comments on commit 3992712

Please sign in to comment.