Insert new workspaceView into the dom


I’m developing a package that needs to be able to take a serialized workspace and load it into atom.

I have the workspace and workspaceView setup code working:

atom.workspace = Workspace.deserialize data.workspace
atom.workspaceView = new WorkspaceView atom.workspace

But I have been unable to find the correct method for re-rendering the atom workspaceView.

The atom test code calls atom.workspaceView.attachToDom() which doesn’t exist.

What is the proper way to achieve this.


attachToDom is definided here:


Ok, so that is a jasmine test specific method that just puts the content into the test environments dom.

So what method is there for having atom re-insert the workspaceView frag into the dom?

That is without having to use atom.reload()


Does this work?


No, using the code in my OP, nothing changes. I assume it’s because my new WorkspaceView isn’t in the dom yet.

By the way, I appreciate the help.


Using the method atom uses during boot(specifically deserialization & dom insertion), produces undesired results: src/

The left is a normal editor, the right was deserialized from the workspace on the left and inserted into the dom using the aforementioned method.


So my temporary solution until I find the proper method for this is fairly strait forward but not at all scalable.

atom.workspace = Workspace.deserialize data.workspace
atom.workspaceView = new WorkspaceView atom.workspace

$(atom.workspaceViewSelector).html atom.workspaceView

if atom.packages.isPackageLoaded('status-bar')
  if atom.packages.isPackageActive('status-bar')

if atom.packages.isPackageLoaded('tabs')
   if atom.packages.isPackageActive('tabs')