Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve syntax highlighting in the editor #181

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

andrewdonkin
Copy link

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.

image

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");

Adds an editing mode to Ace for sequence diagrams.
}
.call(u.prototype),
t.Mode = u
})

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

this.$id = "ace/mode/sequencebramp"
}
.call(u.prototype),
t.Mode = u

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

r.inherits(u, i),
function() {
this.type = "text",
this.$id = "ace/mode/sequencebramp"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

, i = e("./text").Mode
, s = e("./sequencebramp_highlight_rules").SequencebrampHighlightRules
, u = function() {
this.HighlightRules = s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

"use strict";
var r = e("../lib/oop")
, i = e("./text").Mode
, s = e("./sequencebramp_highlight_rules").SequencebrampHighlightRules

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading line break before ','; readers may interpret this as an expression boundary.

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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading line break before ','; readers may interpret this as an expression boundary.

]};
};
r.inherits(s, i),
t.SequencebrampHighlightRules = s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

, s = function() {
function t(e) {
var t = /\w/.test(e) ? "\\b" : "(?:\\B|^)";
return t + e + "[^" + e + "].*?" + e + "(?![\\w*])"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

@@ -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")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Misleading line break before ','; readers may interpret this as an expression boundary.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comma warnings can be turned off with 'laxcomma'.
Misleading line break before ','; readers may interpret this as an expression boundary.

@bramp
Copy link
Owner

bramp commented Sep 23, 2017

Excellent @andrewdonkin I'll happily accept this! Would you mind resolving the issues that hound bot found.

.call(u.prototype),
t.Mode = u
}
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

this.$id = "ace/mode/sequencebramp"
}
.call(u.prototype),
t.Mode = u

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.
Missing semicolon.

i = e("./text").Mode,
s = e("./sequencebramp_highlight_rules").SequencebrampHighlightRules,
u = function() {
this.HighlightRules = s

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing semicolon.

};
};
r.inherits(s, i),
t.SequencebrampHighlightRules = s;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expected an assignment or function call and instead saw an expression.

@andrewdonkin
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants