Represents a project that’s opened in Atom.
An instance of this class is always available as the atom.project
global.
Invoke the given callback when the project paths change.
Argument | Description |
---|---|
|
Function to be called after the project paths change. |
|
Return values |
---|
Returns a Disposable on which |
Invoke the given callback when a text buffer is added to the project.
Argument | Description |
---|---|
|
Function to be called when a text buffer is added. |
|
A TextBuffer item. |
Return values |
---|
Returns a Disposable on which |
Invoke the given callback with all current and future text buffers in the project.
Argument | Description |
---|---|
|
Function to be called with current and future text buffers. |
|
A TextBuffer item. |
Return values |
---|
Returns a Disposable on which |
Get an Array of GitRepositorys associated with the project’s directories.
This method will be removed in 2.0 because it does synchronous I/O. Prefer the following, which evaluates to a Promise that resolves to an Array of Repository objects:
Promise.all(atom.project.getDirectories().map(
atom.project.repositoryForDirectory.bind(atom.project)))
Get the repository for a given directory asynchronously.
Argument | Description |
---|---|
|
Directory for which to get a Repository. |
Return values |
---|
Returns a Promise that resolves with either:
|
Add a path to the project’s list of root paths
Argument | Description |
---|---|
|
String The path to the directory to add. |
remove a path from the project’s list of root paths.
Argument | Description |
---|---|
|
String The path to remove. |
Determines whether the given path (real or symbolic) is inside the project’s directory.
This method does not actually check if the path exists, it just checks their locations relative to each other.
Argument | Description |
---|---|
|
String path |
Return values |
---|
Returns whether the path is inside the project’s root directory. |