Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Create the GrammarStatusView. Pull out of status bar#2

Merged
benogle merged 1 commit intomasterfrom
bo-use-sb-api
Nov 20, 2013
Merged

Create the GrammarStatusView. Pull out of status bar#2
benogle merged 1 commit intomasterfrom
bo-use-sb-api

Conversation

@benogle
Copy link
Copy Markdown
Contributor

@benogle benogle commented Nov 20, 2013

Use the status-bar api to add the selector link to the status bar. This seems to be the first time one package is reliant on another package. Couple things:

I dont like the method of waiting for the status bar.

The grammar selector could be activated before the status bar. So I have this:

createStatusEntry = ->
  view = new GrammarStatusView(atom.rootView.statusBar)
  atom.rootView.statusBar.appendLeft(view)

if atom.rootView.statusBar
  createStatusEntry()
else
  atom.packages.once 'activated', ->
    createStatusEntry()

Would be nice to put something in the package manager or the root view to make this easier. The status-bar can put it in the rootView? Not sure what that looks like yet.

Testing the addition to the status bar

I cant load the status-bar package from the specs (though it will load the language grammars, so maybe something else is going on??). So I am mocking the status bar. Not a huge amount of code, but it would be nice to use the real one in case of api or behavior changes. How do you guys feel about using the real package vs using a mock??

benogle added a commit that referenced this pull request Nov 20, 2013
Create the GrammarStatusView. Pull out of status bar
@benogle benogle merged commit 57abbd3 into master Nov 20, 2013
@kevinsawicki kevinsawicki deleted the bo-use-sb-api branch January 8, 2014 23:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant