Enable concourse editor for task files.

This commit is contained in:
Kris De Volder
2017-01-26 10:04:46 -08:00
parent 1306dbac98
commit 6fc28357aa
14 changed files with 177 additions and 69 deletions

View File

@@ -27,16 +27,19 @@ public class TextDocument implements IDocument {
ILineTracker lineTracker = new DefaultLineTracker();
private static final Pattern NEWLINE = Pattern.compile("\\r|\\n|\\r\\n|\\n\\r");
private final String languageId;
private final String uri;
private Text text = new Text("");
public TextDocument(String uri) {
public TextDocument(String uri, String languageId) {
this.uri = uri;
this.languageId = languageId;
}
private TextDocument(TextDocument other) {
this.uri = other.uri;
this.languageId = other.getLanguageId();
this.text = other.text;
this.lineTracker.set(text.toString());
}
@@ -59,7 +62,7 @@ public class TextDocument implements IDocument {
this.text = new Text(text);
this.lineTracker.set(text);
}
public void apply(TextDocumentContentChangeEvent change) throws BadLocationException {
Range rng = change.getRange();
if (rng==null) {
@@ -249,4 +252,8 @@ public class TextDocument implements IDocument {
}
}
public String getLanguageId() {
return languageId;
}
}