Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 426642

Summary: Script error loading a file with text mate styles
Product: [ECD] Orion Reporter: Chris McGee <cbmcgee>
Component: EditorAssignee: Grant Gayed <grant_gayed>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: ken_walker, simon_kaegi
Version: 5.0   
Target Milestone: 5.0 M2   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Chris McGee CLA 2014-01-25 09:41:42 EST
When opening a file that uses the text mate styler for syntax highlighting I get an error immediately on page load. No editor contents are shown.

I traced the problem to the getStyleAccessor() method in editorView.js:

getStyleAccessor: function() {
	var styleAccessor = null;
	var styler = this.syntaxHighlighter.getStyler();
	if (styler) {
		styleAccessor = styler.getStyleAccessor(); /* ERROR, there is no getStyleAccessor() on the text mate styler object */
	}
	return styleAccessor;
}

A simple workaround is to change the method to this:

getStyleAccessor: function() {
	var styleAccessor = null;
	var styler = this.syntaxHighlighter.getStyler();
	if (styler && styler.getStyleAccessor) {
		styleAccessor = styler.getStyleAccessor();
	}
	return styleAccessor;
}
Comment 1 Grant Gayed CLA 2014-01-26 02:30:30 EST
Thanks for looking into this, the simple fix is fine.  Fixed > 20140126, commit: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=2b8cc21d5db7220bd296af9af5fd47728f2f9258 .