Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Add API to atom.packages #19

Closed
weskinner opened this issue Mar 4, 2014 · 3 comments
Closed

Add API to atom.packages #19

weskinner opened this issue Mar 4, 2014 · 3 comments

Comments

@weskinner
Copy link

It would be great to be able to access the fuzzy-finder lib off of an api on atom.packages for reuse in other packages.

@kevinsawicki
Copy link
Contributor

What part of it are you trying to reuse?

You should be able to open it by triggering commands from your package, and the UI is largely done by extending SelectListView.

@weskinner
Copy link
Author

I would like to extend the ProjectView class for a package I am writing.

@kevinsawicki
Copy link
Contributor

If you want to require the ProjectView directly you can use the following code:

path = require 'path'
packagePath = atom.packages.resolvePackagePath('fuzzy-finder')
ProjectView = require path.join(packagePath, 'lib', 'project-view')

You probably want to wrap the require in a try/catch in case the fuzzy-finder package is disabled or not installed.

I think once this package matures a bit more we can explore exporting the classes directly on the package object.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants