How to extend and open TextEditorView programmatically?


#1

I currently have a view that extends TextEditorView in order to take advantage of syntax highlighting and the gutter. I have an opener for the uri and uses atom.workspace.open(uri) to trigger the creation of the view. However, I have been getting errors such as,

TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.
  at TypeError (native)
  at atom-pane.PaneElement.activeItemChanged (/Applications/Atom.app/Contents/Resources/app/src/pane-element.js:198:24)
  at Emitter.module.exports.Emitter.emit (/Applications/Atom.app/Contents/Resources/app/node_modules/event-kit/lib/emitter.js:71:11)
  at Pane.module.exports.Pane.setActiveItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:254:22)
  at Pane.module.exports.Pane.activateItem (/Applications/Atom.app/Contents/Resources/app/src/pane.js:300:21)
  at /Applications/Atom.app/Contents/Resources/app/src/workspace.js:447:16
  at _fulfilled (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:787:54)
  at self.promiseDispatch.done (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:816:30)
  at Promise.promise.promiseDispatch (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:749:13)
  at /Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:810:14
  at flush (/Applications/Atom.app/Contents/Resources/app/node_modules/q/q.js:108:17)
  at process._tickCallback (node.js:378:11)

I have been playing around and digging through Atom source code for a while but wasn’t able to make any progress. I’m wondering if anyone has any idea and can help me out.

The package I’m referring to is coffee-compile.

Thanks in advance!


#2

My guess is that it is expecting to find the class TextEditor but finding your class name instead.