Is there a way to call workspace::open in a synchronous way, or, is there a way to put a callback on the open method?



As stated in the docs:

    (Editor) — Returns a promise that resolves to the Editor for the file URI.

Which mean you can hook onto the resulting promise like this:

promise = 'sample.js'
promise.then (editor) ->
  # do something with the new editor

Hope it helps


@abe this is exactly what I was looking for, I didn’t understood what was a promise. Thanks for your help :smile: