Add missing $id to those Modes that are missing it.

I've found that the set of modes in this PR did not set their `$id`.
The side-effect of that is that when one of these modes is the current
mode of an EditSession, and one calls `session.getOption('mode')` the
returned value was incorrect.  It goes up the prototype chain so you'd
get something like 'ace/mode/text' or 'ace/mode/html' in most cases.

This fixes that so that if, for example, the mode is set to
'ace/mode/django', the value returned by the option will be
'ace/mode/django'
This commit is contained in:
rmsmith 2014-01-21 09:41:15 +02:00
commit 6e1aefff56
8 changed files with 23 additions and 1 deletions

View file

@ -55,6 +55,7 @@ oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "#";
this.$id = "ace/mode/apache_conf";
// Extra logic goes here.
}).call(Mode.prototype);

View file

@ -112,5 +112,9 @@ var Mode = function() {
};
oop.inherits(Mode, HtmlMode);
(function() {
this.$id = "ace/mode/django";
}).call(Mode.prototype);
exports.Mode = Mode;
});

View file

@ -49,5 +49,9 @@ var Mode = function() {
};
oop.inherits(Mode, CMode);
(function() {
this.$id = "ace/mode/glsl";
}).call(Mode.prototype);
exports.Mode = Mode;
});

View file

@ -9,6 +9,7 @@ define(function(require, exports, module){
if (that = require('../mode/matching_brace_outdent')) {
this.$outdent = new that.MatchingBraceOutdent;
}
this.$id = "ace/mode/livescript";
}
indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
prototype.getNextLineIndent = function(state, line, tab){

View file

@ -17,5 +17,9 @@ var Mode = function() {
};
oop.inherits(Mode, HtmlMode);
(function() {
this.$id = "ace/mode/luapage";
}).call(Mode.prototype);
exports.Mode = Mode;
});

View file

@ -12,5 +12,9 @@ var Mode = function() {
oop.inherits(Mode, TextMode);
(function() {
this.$id = "ace/mode/lucene";
}).call(Mode.prototype);
exports.Mode = Mode;
});

View file

@ -49,7 +49,7 @@ oop.inherits(Mode, TextMode);
this.lineCommentStart = "//";
this.blockComment = {start: "/*", end: "*/"};
this.$id = "ace/mode/mel";
}).call(Mode.prototype);
exports.Mode = Mode;

View file

@ -41,5 +41,9 @@ var Mode = function() {
};
oop.inherits(Mode, TextMode);
(function() {
this.$id = "ace/mode/properties";
}).call(Mode.prototype);
exports.Mode = Mode;
});