/ src / null-grammar.js
null-grammar.js
 1  const { Disposable } = require('event-kit');
 2  
 3  module.exports = {
 4    name: 'Null Grammar',
 5    scopeName: 'text.plain.null-grammar',
 6    scopeForId(id) {
 7      if (id === -1 || id === -2) {
 8        return this.scopeName;
 9      } else {
10        return null;
11      }
12    },
13    startIdForScope(scopeName) {
14      if (scopeName === this.scopeName) {
15        return -1;
16      } else {
17        return null;
18      }
19    },
20    endIdForScope(scopeName) {
21      if (scopeName === this.scopeName) {
22        return -2;
23      } else {
24        return null;
25      }
26    },
27    tokenizeLine(text) {
28      return {
29        tags: [
30          this.startIdForScope(this.scopeName),
31          text.length,
32          this.endIdForScope(this.scopeName)
33        ],
34        ruleStack: null
35      };
36    },
37    onDidUpdate(callback) {
38      return new Disposable(noop);
39    }
40  };
41  
42  function noop() {}