├── .gitignore ├── LICENSE ├── README.md ├── cmd.js ├── index.js ├── package-lock.json ├── package.json └── test ├── empty-array.tmTheme ├── empty-plist.tmTheme ├── global.ref.json ├── global.tmTheme ├── multiscope.ref.json ├── multiscope.tmTheme ├── multistyle.ref.json ├── multistyle.tmTheme ├── scoped.ref.json ├── scoped.tmTheme └── test.js /.gitignore: -------------------------------------------------------------------------------- 1 | notes/ 2 | typings/ 3 | node_modules/ 4 | test/try.js 5 | obj/ 6 | bin/ 7 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Kalman Keri 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # tmtheme-to-json 2 | 3 | Converts a `.tmTheme` file into an equivalent JSON representation to be used 4 | with Visual Studio Code. 5 | 6 | *If all you want is to use a theme with VS Code, you don't need 7 | to convert it. VS Code can consume `.tmTheme` files directly, 8 | although you may find it easier to edit your theme in JSON format.* 9 | 10 | All optional and custom properties are preserved during conversion. 11 | The theme is not validated by the tool. 12 | Please check the theme file if it doesn't function as expected. 13 | 14 | ## Installation 15 | 16 | ~~~ 17 | npm install -g tmtheme-to-json 18 | ~~~ 19 | 20 | ## Usage on the command line 21 | 22 | ~~~ 23 | tmtheme-to-json my.tmTheme 24 | ~~~ 25 | 26 | This will create `my.tmTheme.json` in the same directory. 27 | 28 | You can even specify multiple input files (globs are not supported on Windows). 29 | 30 | ## Usage in code 31 | 32 | ~~~js 33 | var fs = require('fs') 34 | var convertTheme = require('tmtheme-to-json').convertTheme 35 | 36 | var theme = convertTheme(fs.readFileSync('my.tmTheme', 'utf-8')) 37 | fs.writeFileSync('my.tmTheme.json', JSON.stringify(theme, null, 2)) 38 | ~~~ 39 | -------------------------------------------------------------------------------- /cmd.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | var fs = require('fs') 4 | var parseArgs = require('minimist') 5 | var convertTheme = require('./index').convertTheme 6 | 7 | var argv = parseArgs(process.argv.slice(2)); 8 | 9 | for (var file of argv._) { 10 | var theme = convertTheme(fs.readFileSync(file, 'utf-8')) 11 | fs.writeFileSync(file + '.json', JSON.stringify(theme, null, 2)) 12 | } 13 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | var plist = require('plist') 2 | 3 | /** 4 | * Converts a loaded tmTheme file into a theme in VS Code format. 5 | * The returned object can be passed to `JSON.stringify()` to produce a valid 6 | * VS Code theme file. 7 | * @return a javascript object 8 | * @param {String} str - xml string (in plist format) 9 | */ 10 | function convertTheme(str) { 11 | var theme = plist.parse(str) 12 | theme.settings = convertArray(theme.settings) 13 | return theme 14 | } 15 | 16 | function convertArray(a) { 17 | for (var i = 0; i < a.length; i++) { 18 | a[i] = convertObject(a[i]) 19 | } 20 | return a 21 | } 22 | 23 | function convertObject(o) { 24 | if (o.scope != null) { 25 | return convertScopedSettings(o) 26 | } else { 27 | return o 28 | } 29 | } 30 | 31 | function convertScopedSettings(o) { 32 | if (o.scope.includes(',')) { 33 | o.scope = o.scope.split(',').map(function(s) { 34 | return s.trim() 35 | }) 36 | } 37 | return o 38 | } 39 | 40 | exports.convertTheme = convertTheme -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tmtheme-to-json", 3 | "version": "0.1.3", 4 | "lockfileVersion": 1, 5 | "dependencies": { 6 | "assert": { 7 | "version": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", 8 | "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", 9 | "dev": true 10 | }, 11 | "balanced-match": { 12 | "version": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", 13 | "integrity": "sha1-yz8+PHMtwPAe5wtAPzAuYddwmDg=", 14 | "dev": true 15 | }, 16 | "base64-js": { 17 | "version": "https://registry.npmjs.org/base64-js/-/base64-js-1.1.2.tgz", 18 | "integrity": "sha1-1kAMrBxMZgl22Q0HoENR2JOV9eg=" 19 | }, 20 | "brace-expansion": { 21 | "version": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.7.tgz", 22 | "integrity": "sha1-Pv/DxQ4ABTH7cg6v+A8K6O8jz1k=", 23 | "dev": true 24 | }, 25 | "browser-stdout": { 26 | "version": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", 27 | "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", 28 | "dev": true 29 | }, 30 | "commander": { 31 | "version": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", 32 | "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", 33 | "dev": true 34 | }, 35 | "concat-map": { 36 | "version": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", 37 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", 38 | "dev": true 39 | }, 40 | "crlf": { 41 | "version": "1.1.0", 42 | "resolved": "https://registry.npmjs.org/crlf/-/crlf-1.1.0.tgz", 43 | "integrity": "sha1-B1NKc/DnxXsGOv0dGvZqnBP8iJA=", 44 | "dev": true 45 | }, 46 | "debug": { 47 | "version": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", 48 | "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", 49 | "dev": true 50 | }, 51 | "diff": { 52 | "version": "https://registry.npmjs.org/diff/-/diff-1.4.0.tgz", 53 | "integrity": "sha1-fyjS657nsVqX79ic5j3P2qPMur8=", 54 | "dev": true 55 | }, 56 | "escape-string-regexp": { 57 | "version": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", 58 | "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", 59 | "dev": true 60 | }, 61 | "fs.realpath": { 62 | "version": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 63 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 64 | "dev": true 65 | }, 66 | "glob": { 67 | "version": "https://registry.npmjs.org/glob/-/glob-7.0.5.tgz", 68 | "integrity": "sha1-tCAqaQmbu00pKnwblbZoK2fr3JU=", 69 | "dev": true 70 | }, 71 | "glub": { 72 | "version": "1.0.3", 73 | "resolved": "https://registry.npmjs.org/glub/-/glub-1.0.3.tgz", 74 | "integrity": "sha1-VsFkMpiuJQZcYxUAMze7pp0vuGY=", 75 | "dev": true, 76 | "dependencies": { 77 | "glob": { 78 | "version": "5.0.15", 79 | "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", 80 | "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", 81 | "dev": true 82 | } 83 | } 84 | }, 85 | "graceful-readlink": { 86 | "version": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", 87 | "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", 88 | "dev": true 89 | }, 90 | "growl": { 91 | "version": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", 92 | "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", 93 | "dev": true 94 | }, 95 | "has-flag": { 96 | "version": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", 97 | "integrity": "sha1-nZ55MWXOAXoA8AQYxD+UKnsdEfo=", 98 | "dev": true 99 | }, 100 | "inflight": { 101 | "version": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 102 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 103 | "dev": true 104 | }, 105 | "inherits": { 106 | "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 107 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 108 | "dev": true 109 | }, 110 | "json3": { 111 | "version": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", 112 | "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", 113 | "dev": true 114 | }, 115 | "lodash._baseassign": { 116 | "version": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", 117 | "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", 118 | "dev": true 119 | }, 120 | "lodash._basecopy": { 121 | "version": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", 122 | "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", 123 | "dev": true 124 | }, 125 | "lodash._basecreate": { 126 | "version": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", 127 | "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", 128 | "dev": true 129 | }, 130 | "lodash._getnative": { 131 | "version": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", 132 | "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=", 133 | "dev": true 134 | }, 135 | "lodash._isiterateecall": { 136 | "version": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", 137 | "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", 138 | "dev": true 139 | }, 140 | "lodash.create": { 141 | "version": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", 142 | "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", 143 | "dev": true 144 | }, 145 | "lodash.isarguments": { 146 | "version": "https://registry.npmjs.org/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz", 147 | "integrity": "sha1-L1c9hcaiQon/AGY7SRwdM4/zRYo=", 148 | "dev": true 149 | }, 150 | "lodash.isarray": { 151 | "version": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-3.0.4.tgz", 152 | "integrity": "sha1-eeTriMNqgSKvhvhEqpvNhRtfu1U=", 153 | "dev": true 154 | }, 155 | "lodash.keys": { 156 | "version": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-3.1.2.tgz", 157 | "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", 158 | "dev": true 159 | }, 160 | "minimatch": { 161 | "version": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", 162 | "integrity": "sha1-Kk5AkLlrLbBqnX3wEFWmKnfJt3Q=", 163 | "dev": true 164 | }, 165 | "minimist": { 166 | "version": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", 167 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" 168 | }, 169 | "mkdirp": { 170 | "version": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", 171 | "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", 172 | "dev": true, 173 | "dependencies": { 174 | "minimist": { 175 | "version": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", 176 | "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", 177 | "dev": true 178 | } 179 | } 180 | }, 181 | "mocha": { 182 | "version": "https://registry.npmjs.org/mocha/-/mocha-3.2.0.tgz", 183 | "integrity": "sha1-fcT0XlCIB1FxpoiWgU5q6et6heM=", 184 | "dev": true 185 | }, 186 | "ms": { 187 | "version": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", 188 | "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=", 189 | "dev": true 190 | }, 191 | "once": { 192 | "version": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 193 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 194 | "dev": true 195 | }, 196 | "os-tmpdir": { 197 | "version": "1.0.2", 198 | "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", 199 | "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", 200 | "dev": true 201 | }, 202 | "path-is-absolute": { 203 | "version": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", 204 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", 205 | "dev": true 206 | }, 207 | "plist": { 208 | "version": "https://registry.npmjs.org/plist/-/plist-2.0.1.tgz", 209 | "integrity": "sha1-CjLKlIGxw2TpLhjcVch23p0B2os=", 210 | "dependencies": { 211 | "xmlbuilder": { 212 | "version": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-8.2.2.tgz", 213 | "integrity": "sha1-aSSGc0ELS6QuGmE2VR0pIjNap3M=" 214 | } 215 | } 216 | }, 217 | "supports-color": { 218 | "version": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", 219 | "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", 220 | "dev": true 221 | }, 222 | "transform-file": { 223 | "version": "1.0.1", 224 | "resolved": "https://registry.npmjs.org/transform-file/-/transform-file-1.0.1.tgz", 225 | "integrity": "sha1-f5WYSs0j1Ov4q7R+6dg74WbRJoc=", 226 | "dev": true 227 | }, 228 | "util": { 229 | "version": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", 230 | "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", 231 | "dev": true, 232 | "dependencies": { 233 | "inherits": { 234 | "version": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", 235 | "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", 236 | "dev": true 237 | } 238 | } 239 | }, 240 | "wrappy": { 241 | "version": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 242 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 243 | "dev": true 244 | }, 245 | "xmldom": { 246 | "version": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", 247 | "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" 248 | } 249 | } 250 | } 251 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "tmtheme-to-json", 3 | "version": "0.1.3", 4 | "description": "Convert Textmate theme files to JSON for use with Visual Studio Code.", 5 | "main": "index.js", 6 | "bin": "./cmd.js", 7 | "repository": { 8 | "type": "git", 9 | "url": "https://github.com/kkeri/tmtheme-to-json" 10 | }, 11 | "keywords": [ 12 | "theme", 13 | "tmtheme", 14 | "textmate", 15 | "vscode", 16 | "json" 17 | ], 18 | "author": "Kalman Keri", 19 | "license": "MIT", 20 | "dependencies": { 21 | "minimist": "^1.2.0", 22 | "plist": "^2.0.1" 23 | }, 24 | "devDependencies": { 25 | "assert": "^1.4.1", 26 | "crlf": "^1.1.0", 27 | "mocha": "^3.2.0" 28 | }, 29 | "scripts": { 30 | "test": "mocha", 31 | "preversion": "npm test", 32 | "prepare": "crlf --set=LF cmd.js" 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /test/empty-array.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/empty-plist.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /test/global.ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "settings": [ 4 | { 5 | "settings": { 6 | "background": "#1c1818", 7 | "caret": "#b0b0b0", 8 | "foreground": "#b0b0b0", 9 | "invisibles": "#3d3536", 10 | "lineHighlight": "#1c1818", 11 | "selection": "#443736" 12 | } 13 | } 14 | ], 15 | "colorSpaceName": "sRGB", 16 | "semanticClass": "theme.dark.test" 17 | } -------------------------------------------------------------------------------- /test/global.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | name 5 | test 6 | settings 7 | 8 | 9 | settings 10 | 11 | background 12 | #1c1818 13 | caret 14 | #b0b0b0 15 | foreground 16 | #b0b0b0 17 | invisibles 18 | #3d3536 19 | lineHighlight 20 | #1c1818 21 | selection 22 | #443736 23 | 24 | 25 | 26 | colorSpaceName 27 | sRGB 28 | semanticClass 29 | theme.dark.test 30 | 31 | -------------------------------------------------------------------------------- /test/multiscope.ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "settings": [ 4 | { 5 | "name": "Comment", 6 | "scope": [ 7 | "comment", 8 | "punctuation.definition.comment" 9 | ], 10 | "settings": { 11 | "fontStyle": "italic", 12 | "foreground": "#967164" 13 | } 14 | } 15 | ], 16 | "colorSpaceName": "sRGB", 17 | "semanticClass": "theme.dark.test" 18 | } -------------------------------------------------------------------------------- /test/multiscope.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | name 5 | test 6 | settings 7 | 8 | 9 | name 10 | Comment 11 | scope 12 | comment, punctuation.definition.comment 13 | settings 14 | 15 | fontStyle 16 | italic 17 | foreground 18 | #967164 19 | 20 | 21 | 22 | colorSpaceName 23 | sRGB 24 | semanticClass 25 | theme.dark.test 26 | 27 | -------------------------------------------------------------------------------- /test/multistyle.ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "settings": [ 4 | { 5 | "name": "Comment", 6 | "scope": [ 7 | "comment", 8 | "punctuation.definition.comment" 9 | ], 10 | "settings": { 11 | "fontStyle": "italic bold", 12 | "foreground": "#967164" 13 | } 14 | } 15 | ], 16 | "colorSpaceName": "sRGB", 17 | "semanticClass": "theme.dark.test" 18 | } -------------------------------------------------------------------------------- /test/multistyle.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | name 5 | test 6 | settings 7 | 8 | 9 | name 10 | Comment 11 | scope 12 | comment, punctuation.definition.comment 13 | settings 14 | 15 | fontStyle 16 | italic bold 17 | foreground 18 | #967164 19 | 20 | 21 | 22 | colorSpaceName 23 | sRGB 24 | semanticClass 25 | theme.dark.test 26 | 27 | -------------------------------------------------------------------------------- /test/scoped.ref.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "test", 3 | "settings": [ 4 | { 5 | "name": "Comment", 6 | "scope": "comment", 7 | "settings": { 8 | "fontStyle": "italic", 9 | "foreground": "#967164" 10 | } 11 | } 12 | ], 13 | "colorSpaceName": "sRGB", 14 | "semanticClass": "theme.dark.test" 15 | } -------------------------------------------------------------------------------- /test/scoped.tmTheme: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | name 5 | test 6 | settings 7 | 8 | 9 | name 10 | Comment 11 | scope 12 | comment 13 | settings 14 | 15 | fontStyle 16 | italic 17 | foreground 18 | #967164 19 | 20 | 21 | 22 | colorSpaceName 23 | sRGB 24 | semanticClass 25 | theme.dark.test 26 | 27 | -------------------------------------------------------------------------------- /test/test.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs') 2 | var path = require('path') 3 | var util = require('util') 4 | var assert = require('assert') 5 | var convertTheme = require('../index').convertTheme 6 | 7 | 8 | describe('empty plist', function() { 9 | it('throws', function () { 10 | assert.throws(function () { testFile('empty-plist')}) 11 | }) 12 | }) 13 | 14 | describe('empty array', function() { 15 | it('throws', function () { 16 | assert.throws(function () { testFile('empty-array')}) 17 | }) 18 | }) 19 | 20 | describe('global', function() { 21 | it('matches', function () { 22 | testFile('global') 23 | }) 24 | }) 25 | 26 | describe('scoped', function() { 27 | it('matches', function () { 28 | testFile('scoped') 29 | }) 30 | }) 31 | 32 | describe('multiscope', function() { 33 | it('matches', function () { 34 | testFile('multiscope') 35 | }) 36 | }) 37 | 38 | describe('multistyle', function() { 39 | it('matches', function () { 40 | testFile('multistyle') 41 | }) 42 | }) 43 | 44 | 45 | function testFile(fname) { 46 | fname = __dirname + '/' + fname 47 | var theme = convertTheme(fs.readFileSync(fname + '.tmTheme', 'utf-8')) 48 | //fs.writeFileSync(fname + '.out.json', JSON.stringify(theme, null, 2)) 49 | ref = JSON.parse(fs.readFileSync(fname + '.ref.json', 'utf-8')) 50 | assert.deepEqual(theme, ref) 51 | } 52 | --------------------------------------------------------------------------------