From 03257b17e23b55315c5c66bcfed91aa567eb8ee8 Mon Sep 17 00:00:00 2001 From: Jonah Stiennon Date: Wed, 22 Jun 2016 15:38:51 -0700 Subject: [PATCH 1/2] :memo: Mention how models must implement getTitle() [ci skip] --- src/view-registry.coffee | 3 +++ src/workspace.coffee | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/view-registry.coffee b/src/view-registry.coffee index 5fbfba729..f5f8651df 100644 --- a/src/view-registry.coffee +++ b/src/view-registry.coffee @@ -15,6 +15,9 @@ AnyConstructor = Symbol('any-constructor') # application logic and is the primary point of API interaction. The view # just handles presentation. # +# Note: Models can be any object, but must implement a `getTitle()` function +# if they are to be displayed in a {Pane} +# # View providers inform the workspace how your model objects should be # presented in the DOM. A view provider must always return a DOM node, which # makes [HTML 5 custom elements](http://www.html5rocks.com/en/tutorials/webcomponents/customelements/) diff --git a/src/workspace.coffee b/src/workspace.coffee index c2ed18705..d64898169 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -589,7 +589,10 @@ class Workspace extends Model # Public: Register an opener for a uri. # - # An {TextEditor} will be used if no openers return a value. + # Atom loops through opener functions until one returns a value for a given uri. + # Openers are expected to return an object that inherits from HTMLElement or + # a model which has an associated view in the {ViewRegistry}. + # A {TextEditor} will be used if no openers return a value. # # ## Examples # From 7b16e40fa8e8bd4a7ab2a1ffd6e5dc1e781fac55 Mon Sep 17 00:00:00 2001 From: Jonah Date: Tue, 28 Jun 2016 17:52:53 -0700 Subject: [PATCH 2/2] :memo: better docs for workspace.addOpener --- src/workspace.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index d64898169..bde2a62d3 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -589,10 +589,11 @@ class Workspace extends Model # Public: Register an opener for a uri. # - # Atom loops through opener functions until one returns a value for a given uri. + # When a URI is opened via {Workspace::open}, Atom loops through its registered + # opener functions until one returns a value for the given uri. # Openers are expected to return an object that inherits from HTMLElement or # a model which has an associated view in the {ViewRegistry}. - # A {TextEditor} will be used if no openers return a value. + # A {TextEditor} will be used if no opener returns a value. # # ## Examples #