summaryrefslogtreecommitdiff
path: root/index.js
diff options
context:
space:
mode:
Diffstat (limited to 'index.js')
-rw-r--r--index.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/index.js b/index.js
index d9efb54..268753d 100644
--- a/index.js
+++ b/index.js
@@ -9,6 +9,20 @@ highlighter.requireGrammarsSync({
"modulePath": require.resolve('language-emacs-lisp/package.json'),
});
+const Selector = require('first-mate-select-grammar');
+const selector = Selector();
+function addExtensionsToGrammar(knownExtension,extraExtensions) {
+ let grammar = selector.selectGrammar(
+ highlighter.registry,
+ `some_file.${knownExtension}`,
+ "not much");
+ if (grammar) {
+ Array.prototype.push.apply(grammar.fileTypes,extraExtensions);
+ }
+}
+
+addExtensionsToGrammar('cpp',['ino']);
+
const server = http.createServer((req, res) => {
const filename = req.headers['filename'];
let buffer = '';