Minor JSONiq mode refactoring
This commit is contained in:
parent
6c38e136c1
commit
e87dfcce7a
2 changed files with 6 additions and 17 deletions
|
|
@ -129,19 +129,6 @@ oop.inherits(Mode, TextMode);
|
||||||
that.addMarkers(e.data, session);
|
that.addMarkers(e.data, session);
|
||||||
});
|
});
|
||||||
|
|
||||||
worker.on("highlight", function(tokens) {
|
|
||||||
that.$tokenizer.tokens = tokens.data.tokens;
|
|
||||||
that.$tokenizer.lines = session.getDocument().getAllLines();
|
|
||||||
|
|
||||||
var rows = Object.keys(that.$tokenizer.tokens);
|
|
||||||
for(var i=0; i < rows.length; i++) {
|
|
||||||
var row = parseInt(rows[i]);
|
|
||||||
delete session.bgTokenizer.lines[row];
|
|
||||||
delete session.bgTokenizer.states[row];
|
|
||||||
session.bgTokenizer.fireUpdateEvent(row, row);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
return worker;
|
return worker;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -73,9 +73,11 @@ var XQueryWorker = exports.XQueryWorker = function(sender) {
|
||||||
var that = this;
|
var that = this;
|
||||||
|
|
||||||
this.sender.on("complete", function(e){
|
this.sender.on("complete", function(e){
|
||||||
|
if(that.xqlint) {
|
||||||
var pos = { line: e.data.pos.row, col: e.data.pos.column };
|
var pos = { line: e.data.pos.row, col: e.data.pos.column };
|
||||||
var proposals = that.xqlint.getCompletions(pos);
|
var proposals = that.xqlint.getCompletions(pos);
|
||||||
that.sender.emit("complete", proposals);
|
that.sender.emit("complete", proposals);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.sender.on("setAvailableModuleNamespaces", function(e){
|
this.sender.on("setAvailableModuleNamespaces", function(e){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue