Improve syntax highlighting in the editor#181
Improve syntax highlighting in the editor#181andrewdonkin wants to merge 4 commits intobramp:masterfrom
Conversation
Adds an editing mode to Ace for sequence diagrams.
src/mode-sequencebramp.js
Outdated
| } | ||
| .call(u.prototype), | ||
| t.Mode = u | ||
| }) |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
src/mode-sequencebramp.js
Outdated
| this.$id = "ace/mode/sequencebramp" | ||
| } | ||
| .call(u.prototype), | ||
| t.Mode = u |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
src/mode-sequencebramp.js
Outdated
| r.inherits(u, i), | ||
| function() { | ||
| this.type = "text", | ||
| this.$id = "ace/mode/sequencebramp" |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
src/mode-sequencebramp.js
Outdated
| , i = e("./text").Mode | ||
| , s = e("./sequencebramp_highlight_rules").SequencebrampHighlightRules | ||
| , u = function() { | ||
| this.HighlightRules = s |
src/mode-sequencebramp.js
Outdated
| "use strict"; | ||
| var r = e("../lib/oop") | ||
| , i = e("./text").Mode | ||
| , s = e("./sequencebramp_highlight_rules").SequencebrampHighlightRules |
There was a problem hiding this comment.
Misleading line break before ','; readers may interpret this as an expression boundary.
src/mode-sequencebramp.js
Outdated
| define("ace/mode/sequencebramp", ["require", "exports", "module", "ace/lib/oop", "ace/mode/text", "ace/mode/sequencebramp_highlight_rules", "ace/mode/folding/sequencebramp"], | ||
| function(e, t, n) { | ||
| "use strict"; | ||
| var r = e("../lib/oop") |
There was a problem hiding this comment.
Misleading line break before ','; readers may interpret this as an expression boundary.
src/mode-sequencebramp.js
Outdated
| ]}; | ||
| }; | ||
| r.inherits(s, i), | ||
| t.SequencebrampHighlightRules = s |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
src/mode-sequencebramp.js
Outdated
| , s = function() { | ||
| function t(e) { | ||
| var t = /\w/.test(e) ? "\\b" : "(?:\\B|^)"; | ||
| return t + e + "[^" + e + "].*?" + e + "(?![\\w*])" |
src/mode-sequencebramp.js
Outdated
| @@ -0,0 +1,56 @@ | |||
| define("ace/mode/sequencebramp_highlight_rules", ["require", "exports", "module", "ace/lib/oop"], function(e, t, n) { | |||
| "use strict"; | |||
| var r = e("../lib/oop") | |||
There was a problem hiding this comment.
Misleading line break before ','; readers may interpret this as an expression boundary.
src/mode-sequencebramp.js
Outdated
| define("ace/mode/sequencebramp_highlight_rules", ["require", "exports", "module", "ace/lib/oop"], function(e, t, n) { | ||
| "use strict"; | ||
| var r = e("../lib/oop") | ||
| , i = e("./text_highlight_rules").TextHighlightRules |
There was a problem hiding this comment.
Comma warnings can be turned off with 'laxcomma'.
Misleading line break before ','; readers may interpret this as an expression boundary.
|
Excellent @andrewdonkin I'll happily accept this! Would you mind resolving the issues that hound bot found. |
| .call(u.prototype), | ||
| t.Mode = u | ||
| } | ||
| ) |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
src/mode-sequencebramp.js
Outdated
| this.$id = "ace/mode/sequencebramp" | ||
| } | ||
| .call(u.prototype), | ||
| t.Mode = u |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
Missing semicolon.
src/mode-sequencebramp.js
Outdated
| i = e("./text").Mode, | ||
| s = e("./sequencebramp_highlight_rules").SequencebrampHighlightRules, | ||
| u = function() { | ||
| this.HighlightRules = s |
| }; | ||
| }; | ||
| r.inherits(s, i), | ||
| t.SequencebrampHighlightRules = s; |
There was a problem hiding this comment.
Expected an assignment or function call and instead saw an expression.
|
Done. I'd squash them if I could. Didn't know what I was doing but there are no console errors and the bot has shut up. |
Adds a highlighting mode to Ace for the sequence diagram language.
This is a bit nasty, a quick copy/paste/hack of asciidoc, but it makes the editor look a little better.
It feels like this should be a PR on Ace instead, but I thought it might reach the people who need it better if it was part of js-sequence-diagrams.
To use it, put mode-sequencebramp.js in js/ace and change your index.html to
editor.getSession().setMode("ace/mode/sequencebramp");