Commit Graph

238 Commits

Author SHA1 Message Date
Max Brunsfeld
6df058c7f3 Allow adding a root folder that's within another root folder 2015-08-26 15:26:02 -07:00
Ivan Žužak
d32f30780a Massage the message a bit more 2015-06-21 17:48:32 +02:00
Nathan Sobo
04c9567181 Massage message a bit 2015-06-10 01:30:12 +02:00
Nathan Sobo
5c57cb0cfe Show a warning prompt when opening files over 20MB
We still have some trouble on files this large. I want to show a
progress bar, but for now this is better than freezing without any
warning at all.
2015-06-09 00:02:36 +02:00
Machisté N. Quintana
0db3b70177 📝 Update Project::getRepositories() example 2015-06-08 10:59:34 -04:00
Nathan Sobo
de508db9b2 Implement basic large file mode for editor
* Don’t tokenize
* Don’t build metadata to support folds and soft wraps

Remaining issues:

* Max line length is hard coded
* Foldable indicators should be disabled
* Folding via API should be disallowed
2015-06-05 02:25:57 +02:00
Kevin Sawicki
4160a8c239 Merge pull request #6230 from mnquintana/coffeelint-plus
Lint for more styleguide errors
2015-04-08 12:07:23 -07:00
Kevin Sawicki
e71c6b1061 Remove unused require 2015-04-07 14:50:32 -07:00
Machiste Quintana
5d2392ea67 👕 Fix new coffeelint errors 2015-04-06 23:59:54 -04:00
Kevin Sawicki
b98c2a8fbb Only call Directory::off when including deprecated APIs 2015-04-06 11:02:14 -07:00
Kevin Sawicki
5aeffd49ab 🎨 2015-04-03 11:36:13 -07:00
Kevin Sawicki
50d7825200 Always assign paths 2015-04-03 11:29:16 -07:00
Kevin Sawicki
7d592c8b78 includeDeprecations -> includeDeprecatedAPIs 2015-04-03 11:29:16 -07:00
Kevin Sawicki
578bce1aaf 🎨 2015-04-03 11:29:15 -07:00
Kevin Sawicki
82c39a5af9 Use lighter Model in cursor, selection, and project 2015-04-03 11:29:15 -07:00
Kevin Sawicki
edf17f1fdb Conditionally include deprecations in Project 2015-04-03 11:29:14 -07:00
Kevin Sawicki
11a5b71fb3 Merge pull request #6047 from postcasio/project-deprecations
Fix deprecated calls and recommendations in deprecated methods
2015-03-23 09:24:07 -07:00
postcasio
c4ae567e8f Fix deprecated calls and recommendations in deprecated methods 2015-03-20 09:22:02 +00:00
Kevin Sawicki
590a4b0fd5 Add explicit return after for loop 2015-03-19 11:48:40 -07:00
Kevin Sawicki
2219abece1 Don't use deprecated buffer events 2015-03-16 16:44:52 -07:00
Kevin Sawicki
76df65b720 Deprecate all Project::on calls 2015-03-16 16:44:52 -07:00
Max Brunsfeld
587ebd7538 Fix Project::relativePath w/ URLs 2015-03-13 15:07:56 -07:00
Kevin Sawicki
85e87723b0 Mark Project::onDidChangePaths public 2015-03-05 12:45:50 -08:00
Michael Bolin
a0a4dac571 Fix a bug when a URI is passed to atom.project.removePath(). 2015-03-03 21:44:54 -08:00
Kevin Sawicki
2987d37373 🔥 ; 2015-03-02 14:16:09 -08:00
Max Brunsfeld
5f2a92f486 Remove public docs for Project::relativize 2015-02-26 08:46:14 -08:00
Max Brunsfeld
69b1a08ef5 Rename .splitPath -> .relativizePath 2015-02-26 08:46:00 -08:00
Max Brunsfeld
b307024218 Add API for getting paths relative to project dirs 2015-02-25 17:15:08 -08:00
Michael Bolin
bf9c4132b2 Create a comprehensive test for the new behavior in Project. 2015-02-19 21:02:31 -08:00
Michael Bolin
c728ad6d57 Introduce atom.directory-provider service.
A `Project` will always have a `DefaultDirectoryProvider` that
will be used if there are no other `DirectoryProvider` objects
that can produce a `Directory` for a path.
2015-02-19 17:57:18 -08:00
Max Brunsfeld
cf60855245 Don't destroy repo in ::removePath if it is still needed 2015-02-19 10:28:54 -08:00
Max Brunsfeld
d4298bf077 Add Project::removePath
The tree-view needs to be able to remove a path from
the project
2015-02-19 10:02:37 -08:00
Max Brunsfeld
a9adfa6a76 Fix bug in Project::relativize 2015-02-18 16:47:35 -08:00
Michael Bolin
5805bf9675 Try to set the Project's repo if it does not have one when a new RepositoryProvider is registered.
I tested this using my test `HgRepositoryProvider`. Now when I run the following from the
command line:

    atom <path-to-directory-with-hg-repository>

And then run the following in the console:

    atom.project.getRepositories()

I get an array with an `HgRepository` in it. Previously, I got an empty array because the
`Project`'s paths were set before my `HgRepositoryProvider` was registered.
2015-02-13 22:27:13 -08:00
Max Brunsfeld
f7e1629cfc Set multiple project paths for multiple cmd-line paths
Signed-off-by: Jessica Lord <jlord@github.com>
2015-02-12 21:18:18 -08:00
Max Brunsfeld
4ebfd22e3d Add Project::addPath 2015-02-12 21:16:26 -08:00
Max Brunsfeld
8ab4ad54d8 Allow Project::setPaths to handle multiple paths
Signed-off-by: Jessica Lord <jlord@github.com>
2015-02-12 21:16:15 -08:00
Max Brunsfeld
ce02c74b76 Remove unused instance variable
Signed-off-by: Jessica Lord <jlord@github.com>
2015-02-12 20:37:40 -08:00
Max Brunsfeld
723117a2dc 🎨 fix linter errors 2015-02-12 11:36:16 -08:00
Michael Bolin
5b03cfe878 Added unit test for Project::repositoryForDirectory and fixed the bug
that my unit test caught.
2015-02-11 22:38:02 -08:00
Michael Bolin
746fceb4ed s/repositoryPromisesByDirectory/repositoryPromisesByPath/g 2015-02-11 09:20:50 -08:00
Michael Bolin
1191db009e Addressing @nathansobo's feedback. 2015-02-11 09:17:25 -08:00
Michael Bolin
e04f17fe5f Set up the atom.repository-provider service and implement GitRepositoryProvider.
I tested this by creating a dummy implementation of an `HgRepositoryProvider`
(with the optional `createRepositorySync()` method implemented) and an `HgRepository`
in an Atom package with the following stanza in the `package.json`:

```
  "providedServices": {
    "atom.repository-provider": {
      "versions": {
        "0.1.0": "createHgRepositoryProvider"
      }
    }
  },
```

I opened a path with an Hg repository from the command line using Atom.
I verified that `atom.project.repositoryProviders` contains both a
`GitRepositoryProvider` and an `HgRepositoryProvider`.

I also verified that running the following printed out an `HgRepository`:

```
var Directory = require('pathwatcher').Directory;
atom.project.repositoryForDirectory(
    new Directory(atom.project.getPath(), /* symlink */ false)).then(
        function(repo) { console.log('repo: %o', repo); });
```

One thing that stands out to me about the current API for the
atom.repository-provider service is that the function used to create
a `RepositoryProvider` does not receive any arguments. If the creation
of the `GitRepositoryProvider` were done via the service, this would
be a problem because it needs a reference to `atom.project`, which is
not defined when it is created. (We work around this because it is
created in `Project`'s constructor, so it can pass `this` to
`new GitRepositoryProvider()`.)

We would have to create a `RepositoryProviderFactory` or something if
we wanted to specify arguments when creating a `RepositoryProvider`,
in general. Maybe that's too crazy / not an issue, in practice.

Though note that `GitRepository` cannot access `atom.project` lazily
because it uses it in its constructor to do the following:

```
if @project?
  @subscriptions.add @project.eachBuffer (buffer) => @subscribeToBuffer(buffer)
```

So long as we can guarantee that `atom.project` is defined before the
other providers are initialized, I think we should be OK.

Follow-up work:
* Replace the use of `RepositoryProvider.createRepositorySync()` with
`RepositoryProvider.repositoryForDirectory()` in `Project.setPaths()`.
* Replace all uses of `Project.getRepositories()` with
`Project.repositoryForDirectory()` in packages that are bundled with Atom
by default.
* Implement `Directory.exists()` and/or `Directory.existsSync()` and update
`git-repositor-provider.coffee`, as appropriate.
* Eliminate `GitRepositoryProvider.repositoryForDirectory()`'s use of
synchronous methods.
* Somewhat orthogonal to this diff, but the following fields need to be
removed from `Project` because they enforce the idea of a single root:
`path`, `rootDirectory`, and `repo`. This has implications around the
existing use of `@rootDirectory?.off()` and `@destroyRepo()`.
2015-02-10 21:46:02 -08:00
Kevin Sawicki
c378ef0649 Merge pull request #5044 from russlescai/rl-scoped-file-encoding
Allow scoped default File Encoding
2015-01-21 11:22:17 -08:00
Ben Ogle
2577843e51 Explicitly check if the path to be deserialized is a dir 2015-01-16 10:53:35 -08:00
Ben Ogle
97a55ba8c0 Only check read permission on read 2015-01-16 10:24:19 -08:00
Kevin Sawicki
b6b90c0270 💄 2015-01-16 09:33:42 -08:00
Kevin Sawicki
d736ebff38 Don't deserialize buffers with inaccessible paths 2015-01-16 09:33:42 -08:00
Kevin Sawicki
0cf180804c 💄 2015-01-16 09:33:42 -08:00
Kevin Sawicki
c0c5f46097 📝 Tweak catch comment 2015-01-16 09:33:42 -08:00