ant-monaco
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -9,2 +9,4 @@ 'use strict'; | ||
exports.generateTokensCSSForColorMap = generateTokensCSSForColorMap; | ||
var _vscodeTextmate = require('vscode-textmate'); | ||
@@ -22,2 +24,48 @@ | ||
function generateTokensCSSForColorMap(colorMap) { | ||
var rules = []; | ||
for (var i = 1, len = colorMap.length; i < len; i += 1) { | ||
var color = colorMap[i]; | ||
rules[i] = '.mtk' + i + ' { color: ' + color.toString() + '; }'; | ||
} | ||
rules.push('.mtki { font-style: italic; }'); | ||
rules.push('.mtkb { font-weight: bold; }'); | ||
rules.push('.mtku { text-decoration: underline; }'); | ||
return rules.join('\n'); | ||
} | ||
var rebuildMtkColors = function rebuildMtkColors(cssRules) { | ||
var head = document.head; | ||
var tokennColor = document.createElement('style'); | ||
var monacoColor = document.createElement('style'); | ||
tokennColor.innerHTML = '' + cssRules; | ||
monacoColor.innerHTML = '' + lightTheme; | ||
head.appendChild(tokennColor); | ||
head.appendChild(monacoColor); | ||
return true; | ||
}; | ||
var globalLanguageMap = { | ||
javascript: { | ||
scope: 'source.js', | ||
config: jsConfig, | ||
extensions: ['.js', '.jsx'] | ||
}, | ||
css: { | ||
scope: 'source.css', | ||
config: cssConfig, | ||
extensions: ['.acss', '.css'] | ||
}, | ||
json: { | ||
scope: 'source.json', | ||
config: jsonConfig, | ||
extensions: ['.json', '.bowerrc', '.jshintrc', '.jscsrc', '.eslintrc', '.babelrc', '.webmanifest'] | ||
}, | ||
html: { | ||
scope: 'text.html.basic', | ||
config: htmlConfig, | ||
extensions: ['.axml', '.html'] | ||
} | ||
}; | ||
var buildCompletionItemProvider = function buildCompletionItemProvider(languageId) { | ||
@@ -176,3 +224,2 @@ switch (languageId) { | ||
GrammarRegistry: GrammarRegistry | ||
}; | ||
module.exports = exports['default']; | ||
}; |
{ | ||
"name": "ant-monaco", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "ant monaco with vscode-textmate", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
21563889
99576