mirror of
https://github.com/atom/atom.git
synced 2026-01-14 17:38:03 -05:00
Upgrade to telepath 0.75.0 for custom object support
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
{Document, Model, Point, Range} = require 'telepath'
|
||||
{TelepathicObject, Model, Point, Range} = require 'telepath'
|
||||
|
||||
module.exports =
|
||||
_: require 'underscore-plus'
|
||||
BufferedNodeProcess: require '../src/buffered-node-process'
|
||||
BufferedProcess: require '../src/buffered-process'
|
||||
Directory: require '../src/directory'
|
||||
Document: Document
|
||||
TelepathicObject: TelepathicObject
|
||||
Document: TelepathicObject # Deprecated Shim
|
||||
File: require '../src/file'
|
||||
fs: require 'fs-plus'
|
||||
Git: require '../src/git'
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
"season": "0.14.0",
|
||||
"semver": "1.1.4",
|
||||
"space-pen": "2.0.2",
|
||||
"telepath": "0.74.0",
|
||||
"telepath": "0.75.0",
|
||||
"temp": "0.5.0",
|
||||
"underscore-plus": "0.5.0"
|
||||
},
|
||||
|
||||
@@ -10,7 +10,7 @@ app = remote.require 'app'
|
||||
|
||||
_ = require 'underscore-plus'
|
||||
telepath = require 'telepath'
|
||||
{Document, Model} = telepath
|
||||
{Model} = telepath
|
||||
fs = require 'fs-plus'
|
||||
|
||||
{$} = require './space-pen-extensions'
|
||||
@@ -160,7 +160,7 @@ class Atom extends Model
|
||||
TokenizedBuffer = require './tokenized-buffer'
|
||||
DisplayBuffer = require './display-buffer'
|
||||
Editor = require './editor'
|
||||
@registerModelClasses(Project, TextBuffer, TokenizedBuffer, DisplayBuffer, Editor)
|
||||
@registerRepresentationClasses(Project, TextBuffer, TokenizedBuffer, DisplayBuffer, Editor)
|
||||
|
||||
@windowEventHandler = new WindowEventHandler
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{Document, Model} = require 'telepath'
|
||||
{TelepathicObject, Model} = require 'telepath'
|
||||
|
||||
# Public: Manages the deserializers used for serialized state
|
||||
#
|
||||
@@ -30,7 +30,7 @@ class DeserializerManager
|
||||
if deserializer = @get(state)
|
||||
stateVersion = state.get?('version') ? state.version
|
||||
return if deserializer.version? and deserializer.version isnt stateVersion
|
||||
if (state instanceof Document) and not deserializer.acceptsDocuments
|
||||
if (state instanceof TelepathicObject) and not deserializer.acceptsDocuments
|
||||
state = state.toObject()
|
||||
deserializer.deserialize(state, params)
|
||||
else
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{$, View} = require './space-pen-extensions'
|
||||
telepath = require 'telepath'
|
||||
{TelepathicObject} = require 'telepath'
|
||||
|
||||
### Internal ###
|
||||
module.exports =
|
||||
@@ -10,7 +10,7 @@ class PaneAxis extends View
|
||||
new this(state)
|
||||
|
||||
initialize: (args...) ->
|
||||
if args[0] instanceof telepath.Document
|
||||
if args[0] instanceof TelepathicObject
|
||||
@state = args[0]
|
||||
@state.get('children').each (child, index) =>
|
||||
@addChild(atom.deserializers.deserialize(child), index, updateState: false)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{$, View} = require './space-pen-extensions'
|
||||
Pane = require './pane'
|
||||
telepath = require 'telepath'
|
||||
{TelepathicObject} = require 'telepath'
|
||||
|
||||
# Private: Manages the list of panes within a {WorkspaceView}
|
||||
module.exports =
|
||||
@@ -19,7 +19,7 @@ class PaneContainer extends View
|
||||
@div class: 'panes'
|
||||
|
||||
initialize: (state) ->
|
||||
if state instanceof telepath.Document
|
||||
if state instanceof TelepathicObject
|
||||
@state = state
|
||||
@setRoot(atom.deserializers.deserialize(@state.get('root')))
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{dirname} = require 'path'
|
||||
{$, View} = require './space-pen-extensions'
|
||||
_ = require 'underscore-plus'
|
||||
telepath = require 'telepath'
|
||||
{TelepathicObject} = require 'telepath'
|
||||
PaneRow = require './pane-row'
|
||||
PaneColumn = require './pane-column'
|
||||
|
||||
@@ -32,7 +32,7 @@ class Pane extends View
|
||||
# Private:
|
||||
initialize: (args...) ->
|
||||
@items = []
|
||||
if args[0] instanceof telepath.Document
|
||||
if args[0] instanceof TelepathicObject
|
||||
@state = args[0]
|
||||
@items = _.compact @state.get('items').map (item) ->
|
||||
item = atom.deserializers.deserialize(item)
|
||||
|
||||
@@ -39,7 +39,7 @@ class Project extends Model
|
||||
@setPath(@path)
|
||||
|
||||
# Private: Called by telepath.
|
||||
beforePersistence: ->
|
||||
willBePersisted: ->
|
||||
@destroyUnretainedBuffers()
|
||||
|
||||
# Public: Register an opener for project files.
|
||||
|
||||
@@ -48,7 +48,7 @@ class TextBuffer extends telepath.Model
|
||||
@load() if @loadWhenAttached
|
||||
|
||||
# Private: Called by telepath.
|
||||
beforePersistence: ->
|
||||
willBePersisted: ->
|
||||
@modifiedWhenLastPersisted = @isModified()
|
||||
@digestWhenLastPersisted = @file?.getDigest()
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ Q = require 'q'
|
||||
{$, $$, View} = require './space-pen-extensions'
|
||||
_ = require 'underscore-plus'
|
||||
fs = require 'fs-plus'
|
||||
telepath = require 'telepath'
|
||||
{TelepathicObject} = require 'telepath'
|
||||
EditorView = require './editor-view'
|
||||
Pane = require './pane'
|
||||
PaneColumn = require './pane-column'
|
||||
@@ -65,7 +65,7 @@ class WorkspaceView extends View
|
||||
|
||||
# Private:
|
||||
initialize: (state={}) ->
|
||||
if state instanceof telepath.Document
|
||||
if state instanceof TelepathicObject
|
||||
@state = state
|
||||
panes = atom.deserializers.deserialize(state.get('panes'))
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user