Comparar commits

..

349 Commits

Autor SHA1 Mensagem Data
Kevin Sawicki 9105348c8c Merge pull request #5424 from atom/ks-handle-save-errors-in-pane
Show custom notifications for more save errors
2015-02-05 16:22:26 -08:00
Kevin Sawicki 30419027a8 Show notification on config save failures 2015-02-05 15:34:17 -08:00
Kevin Sawicki 5de95759cd Spy on editor.save 2015-02-05 15:24:00 -08:00
Kevin Sawicki f7502d8508 Handle UNKNOWN save errors 2015-02-05 15:17:23 -08:00
Kevin Sawicki c9f13afb72 Remove stray logging 2015-02-05 15:12:20 -08:00
Kevin Sawicki e51c8f3407 Add specs for save/saveAs error handling 2015-02-05 15:07:42 -08:00
Kevin Sawicki 63ee46023d Remove profiling 2015-02-05 14:57:09 -08:00
Kevin Sawicki 68e5839b14 Add missing error var 2015-02-05 14:44:16 -08:00
Kevin Sawicki 477801ba52 Remove save error reporting from Workspace 2015-02-05 14:43:50 -08:00
Kevin Sawicki 3850550345 Handle save errors in Pane 2015-02-05 14:42:21 -08:00
Kevin Sawicki 728a8049d9 ⬆️ markdown-preview@0.134 2015-02-05 13:42:55 -08:00
Kevin Sawicki 77741b6f3f Set ATOM_HOME as early as possible in render process
Moves it from window-bootstrap.coffee to index.js so it runs before
the coffee cache is registered.

Refs #5412
2015-02-05 12:18:51 -08:00
Kevin Sawicki 4597dd5594 Add render process check for ATOM_HOME
Setting it in the browser process does not seem to make it into
the render processes on Linux.

Closes #5412
2015-02-05 12:11:13 -08:00
Kevin Sawicki 04d015a7e0 Use app.getHomeDir 2015-02-05 11:39:58 -08:00
Kevin Sawicki 4bd07be7d8 ⬆️ timecop@0.29 2015-02-05 10:55:06 -08:00
Kevin Sawicki 40de6a7114 Add executable value to desktop file template
Closes #5419
2015-02-05 10:12:30 -08:00
Kevin Sawicki 9100d20dc4 Merge pull request #5417 from atom/iz-fix-semver
Fix atom engine semver in upgrading docs
2015-02-05 08:55:35 -08:00
Ivan Žužak 4361b67214 Fix atom engine semver in upgrading docs 2015-02-05 15:07:16 +01:00
Kevin Sawicki 83c8d904cf 🎨 Add space before arrow 2015-02-04 17:44:33 -08:00
Kevin Sawicki 3257d17fc0 Merge pull request #5408 from atom/add-csharp
Add language-csharp to core packages
2015-02-04 17:28:19 -08:00
Kevin Sawicki fd1d872840 Prompt split editors to save on close
Previously an editor that was split into multiple panes would not
prompt to save correctly when the window was unloading.

This adds a new `windowCloseRequested` option passed through from the
beforeunload handler to the editor so that it can specially handle this
case.

Closes #5257
2015-02-04 17:14:46 -08:00
Kevin Sawicki c5b6b90c88 Normalize opened paths to handle ~
Closes #3829
2015-02-04 16:39:25 -08:00
Kevin Sawicki 9618ec45cf Remove unused require 2015-02-04 15:35:41 -08:00
Kevin Sawicki 6e3d41f433 Suppress deprecations in BufferedNodeProcess
This keeps it consistent with the render process which also suppresses
deprecations

Closes #5383
2015-02-04 15:27:17 -08:00
Kevin Sawicki 6f438ca7da ⬆️ language-csharp@0.5 2015-02-04 14:44:49 -08:00
Daniel Hengeveld c629eb73b2 Add language-csharp to core packages 2015-02-04 14:16:01 -08:00
Kevin Sawicki cbe5eff04c Tweak chocolatey instructions
chocolatey now uses the new installer
2015-02-04 13:35:47 -08:00
Ben Ogle 01bf346d0f ⬆️ metrics@0.42.0 to fix error 2015-02-04 11:36:44 -08:00
Kevin Sawicki c3bd501b84 Merge pull request #5385 from atom/ks-portable
Respect ATOM_HOME env var for portability
2015-02-04 11:22:09 -08:00
Kevin Sawicki 556bb5b65e Merge pull request #5403 from eestrada/rpmbuild
Let Linux packages fully determine executable path
2015-02-04 11:21:37 -08:00
Kevin Sawicki de1c6d1a5d Remove unused require 2015-02-04 10:54:25 -08:00
Kevin Sawicki a985942b16 Use realpath to maintain old behavior 2015-02-04 10:52:32 -08:00
Kevin Sawicki 9ba106192d 📝 Add missing in 2015-02-04 10:49:28 -08:00
Kevin Sawicki 83568a1d85 📝 Mention ATOM_HOME 2015-02-04 10:46:58 -08:00
Kevin Sawicki 71333bbc93 Remove custom Windows behavior 2015-02-04 10:42:13 -08:00
Kevin Sawicki 4e10ea0b10 Remove unused Subscriber mixin 2015-02-04 10:35:57 -08:00
Kevin Sawicki 888d6dfab5 Inline compile cache path 2015-02-04 10:35:57 -08:00
Kevin Sawicki 622b396111 Guard against no LOCALAPPDATA env var 2015-02-04 10:35:57 -08:00
Kevin Sawicki 0f2943989f 📝 Fix comment typos 2015-02-04 10:35:57 -08:00
Kevin Sawicki 63e618cf74 Add missing rootAtomFolder var 2015-02-04 10:35:57 -08:00
Kevin Sawicki 76f37277d9 Use sibling .atom when non-standard installer location 2015-02-04 10:35:57 -08:00
Kevin Sawicki 745e9c8284 📝 Default -> Defaults 2015-02-04 10:35:57 -08:00
Kevin Sawicki 456e511031 📝 Doc ATOM_HOME 2015-02-04 10:35:57 -08:00
Kevin Sawicki 390be558e2 Use ATOM_HOME when setting configDirPath 2015-02-04 10:35:57 -08:00
Kevin Sawicki 4acd5951f5 Use ATOM_HOME for nohup.out location 2015-02-04 10:35:57 -08:00
Kevin Sawicki 8cd7d7dc0c ⬆️ apm@0.135 2015-02-04 10:35:57 -08:00
Kevin Sawicki a127240f4f Use ATOM_HOME as config dir path 2015-02-04 10:35:56 -08:00
Kevin Sawicki c0ab2c4ac8 Use ATOM_HOME when building cache path 2015-02-04 10:35:56 -08:00
Kevin Sawicki 4c534606c2 Use inherited ATOM_HOME env var 2015-02-04 10:35:56 -08:00
Kevin Sawicki f330e207b4 Set ATOM_HOME env var at startup 2015-02-04 10:35:56 -08:00
Ethan Estrada d05a3f370e Have atom.desktop use PATH to find executable
Currently for RPM build only.
2015-02-04 11:20:52 -07:00
Ethan Estrada 08edcf23c9 Let Linux packages fully determine executable path
It is no longer hard coded into the atom.desktop.in file; the
individual grunt tasks now determine how the executable is accessed.
2015-02-04 11:06:20 -07:00
Kevin Sawicki dc4640eee0 ⬆️ markdown-preview@0.133 2015-02-04 09:13:52 -08:00
Kevin Sawicki 33073ea270 Merge pull request #5399 from eestrada/rpmbuild
Reverted atom.desktop.in
2015-02-04 09:05:30 -08:00
Ethan Estrada 449acc7ced Reverted atom.desktop.in
I realize the debian package build depends on this. Although it
probably won't break anything, I would rather implement a solution
that doesn't change the behavior of the debian installer.
2015-02-04 10:01:47 -07:00
Kevin Sawicki dde253160c Merge pull request #5392 from eestrada/rpmbuild
Make atom.spec.in actually use grunt variables
2015-02-04 08:59:47 -08:00
Ethan Estrada c547039f1d Automated rpm package builds to '/usr'
This is instead of the default of '/usr/local'. Targeting '/usr'
is more in line with what most RPM distros expect.
2015-02-04 01:42:52 -07:00
Ethan Estrada afb795d8cc mkrpm honors the '--install-dir' option of grunt
Also, atom.spec now uses the description provided by grunt instead
of hardcoding its own description.
2015-02-03 22:43:18 -07:00
Ethan Estrada ef8a493b9a Remove some hardcoded paths from atom.spec.in
Also, fix a couple lines in atom.spec.in that either weren't
really doing anything or were inconsistent with the rest of the
script.
2015-02-03 22:03:49 -07:00
Ethan Estrada c738145dc7 Revert "Fixes RPM install path and icon location"
This reverts commit b92e6f5a2d.
2015-02-03 21:37:14 -07:00
Nathan Sobo 86991bbec2 Merge branch 'driskell-bugs/ident_guide_whitespace_only' 2015-02-03 21:26:25 -07:00
Nathan Sobo 973d7ebf13 Add spec coverage for indent guides + invisibles on blank lines 2015-02-03 21:26:01 -07:00
Ethan Estrada 93c67b670a Merge pull request #1 from atom/sm-linux-icons
Add Linux icons
2015-02-03 21:25:21 -07:00
Kevin Sawicki c7315e2be6 Merge pull request #5342 from paulcbetts/deltas
Delta Packages for Windows + Update Squirrel.Windows
2015-02-03 17:14:36 -08:00
Kevin Sawicki a4976c32ae Remove release notes from event payload
The release notes are provided by Squirrel on Mac but not by Squirrel for
Windows and the release notes package pulls them down manually anyway
so this field is no longer needed.

Checking for the presence of the release notes previously was preventing the
event from firing on Windows which would cause old release notes to show in
the package.

Closes #3757
2015-02-03 14:57:33 -08:00
Kevin Sawicki 37a85bcdd0 ⬆️ language-css@0.27 2015-02-03 13:50:45 -08:00
Kevin Sawicki 47bd093d68 🐎 Load 6to5 version directly from package.json
This prevents the entire library from being required just to check the
cache so when 6to5 is being used and all files are cached it should shave
~250ms off startup.
2015-02-03 13:36:26 -08:00
Kevin Sawicki a788a7e9b7 ⬆️ language-xml@0.28 2015-02-03 10:53:29 -08:00
Kevin Sawicki 9101da11ce ⬆️ update-package-dependencies@0.8 2015-02-03 10:41:26 -08:00
Max Brunsfeld f7159181ac 📝 Tweak docs for new service APIs 2015-02-03 10:21:23 -08:00
Kevin Sawicki 1784a7f726 ⬆️ Upgrade one themes 2015-02-03 10:20:23 -08:00
Kevin Sawicki a28a8447a7 ⬆️ language-json@0.12 2015-02-03 10:18:25 -08:00
Kevin Sawicki 197e74f18d Prepare 0.178 2015-02-03 09:43:05 -08:00
Kevin Sawicki 5cae6f20c4 Merge pull request #5368 from atom/ld-jasmine-ref-fix
Fix link to wrong version of Jasmine
2015-02-03 09:06:11 -08:00
Kevin Sawicki 6ad704c1e4 Defer requiring 6to5 until it is used
It seems to have a require time of ~250ms
2015-02-03 09:05:34 -08:00
Ben Ogle 2b0cb11df3 Merge pull request #5374 from atom/ld-doc-composed-commands
Add section on "composed" commands to Advanced Keymap document
2015-02-03 09:04:29 -08:00
Lee Dohm 9aee7d4b38 📝 Add section about composed commands
Fix #5357

This is intended to address the commonly-asked question about making a keybinding execute multiple commands.
2015-02-03 04:50:38 -08:00
Lee Dohm b6c86ea217 📝 Update command example for CommandRegistry 2015-02-03 04:31:23 -08:00
Lee Dohm 0d169f0516 Fix link to wrong version of Jasmine
Applies to #5354
2015-02-02 20:26:35 -08:00
simurai 740e6de5f3 Add Linux icons 2015-02-03 12:47:30 +09:00
Kevin Sawicki 5dea6e7d12 Link to all guides
Closes #5332
2015-02-02 18:20:53 -08:00
Kevin Sawicki 312e4e0e8a Be graceful about pathsToOpen string value
Gently convert it to an array of strings before opening

Closes #5340
2015-02-02 18:17:15 -08:00
Kevin Sawicki 853ad9cee3 Re-throw stylesheet compile errors
This makes it consistent with other read errors. Previously a Notification
was returned in the error case causing errors downstream where the package's
stylesheets array was assumed to be a path/content tuple.

Closes atom/deprecation-cop#22
2015-02-02 17:55:36 -08:00
Max Brunsfeld a5ccfa6299 Merge pull request #5346 from atom/ld-doc-updates
Some documentation updates
2015-02-02 17:26:08 -08:00
Lee Dohm 800ca5a37a 📝 Add a missing comma 2015-02-02 17:22:53 -08:00
Lee Dohm 23b8b15261 📝 Fix broken json-schema.org link 2015-02-02 17:22:29 -08:00
Lee Dohm 959aa08d62 📝 Atom 1.0 API is now frozen 2015-02-02 17:22:29 -08:00
Lee Dohm 6eed4e461f 📝 Give stronger recommendation on deactivate
Many packages don't clean up properly on update, causing strange
behavior until restart. Simply stating that the `deactivate` method is
optional is enough to let people know that it isn't required for the
common case.
2015-02-02 17:22:29 -08:00
Lee Dohm 00b79e69f1 📝 activationEvents are now activationCommands 2015-02-02 17:22:29 -08:00
Max Brunsfeld 3739995ddb Merge pull request #5277 from atom/mb-package-json-services
Allow packages to specify services in their package.json files
2015-02-02 17:07:41 -08:00
Max Brunsfeld f942bafe54 📝 Fix typo in 'Creating Package' docs 2015-02-02 16:47:33 -08:00
Kevin Sawicki 5fa230e71a ⬆️ apm@0.134 2015-02-02 14:17:19 -08:00
Kevin Sawicki 9858916c31 🎨 2015-02-02 14:10:53 -08:00
Kevin Sawicki 18ed76f111 Add transpiler name dir segment 2015-02-02 14:09:49 -08:00
Kevin Sawicki feb35e710c Make 6to5 first cache segment
Makes it easier to blow away if needed.
2015-02-02 14:08:50 -08:00
Kevin Sawicki 2e989b502a Remove unneeded try/catch 2015-02-02 14:08:35 -08:00
Kevin Sawicki 434c9e60a8 Remove console logging 2015-02-02 14:08:00 -08:00
Kevin Sawicki 84453d5441 Ignore errors writing to the cache 2015-02-02 14:07:39 -08:00
Kevin Sawicki 9e11914b8b Add helper to cache without requiring 2015-02-02 14:07:11 -08:00
Kevin Sawicki f9f7cf6d34 Add more 6to5 specs 2015-02-02 13:29:20 -08:00
Kevin Sawicki c7b206f5ca Add core-js license override 2015-02-02 13:22:08 -08:00
Kevin Sawicki 3b8b569d0c 🎨 2015-02-02 13:13:39 -08:00
Kevin Sawicki 8365ccb064 Merge pull request #5299 from bolinfest/6to5
Transpile all .js files beginning with the "use 6to5"; pragma with 6to5.
2015-02-02 13:11:33 -08:00
Kevin Sawicki fee8e4a75a Merge pull request #5335 from xfq/semicolon
📝 Minor punctuation fix.
2015-02-02 11:29:48 -08:00
Max Brunsfeld edd8714bbf 📝 Document provision and consumption of services 2015-02-02 11:18:52 -08:00
Kevin Sawicki 56adf8cc32 ⬆️ markdown-preview@0.132 2015-02-02 10:31:59 -08:00
Kevin Sawicki d3956da8e5 ⬆️ event-kit@1.0.2 2015-02-02 10:10:55 -08:00
Max Brunsfeld b24b338b2c Add deprecated shim for atom.services global 2015-02-02 10:01:57 -08:00
Max Brunsfeld 14969c0522 Avoid using private serviceHub in package manager test
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-02 10:01:56 -08:00
Max Brunsfeld 65f2ffa55e Rename service keys in package.json
* serviceProvisions -> providedServices
* serviceDependencies -> consumedServices

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-02 10:01:50 -08:00
Max Brunsfeld 5638c7fb6a Remove atom.services global
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-02-02 10:01:34 -08:00
Max Brunsfeld cb8b254502 Use version-ranges in fixture package with service deps 2015-02-02 10:00:53 -08:00
Max Brunsfeld 027ebc78c4 Respect service{Provisions,Dependencies} in packages' metadata 2015-02-02 10:00:53 -08:00
Max Brunsfeld d9fb54ad6f Reset atom.services between specs 2015-02-02 10:00:53 -08:00
Jason Woods 2e72790e72 🐛 Fix ident guides missing on whitespace only lines with invis chars 2015-02-01 18:13:39 +00:00
Paul Betts 8fcd71f207 Publish delta packages 2015-02-01 01:51:49 -08:00
Paul Betts 776eedd473 Set us up to download the current release so we can create deltas 2015-02-01 01:51:48 -08:00
Paul Betts 62c515e4e7 ⬆️ grunt-atom-shell-installer@0.21.0 2015-02-01 01:51:42 -08:00
Ethan Estrada 223334181b Place atom.png icons in standard system locations
This is so that the atom.desktop file will be able to find the
"atom" icon when requested. This adds the dependency of ImageMagick
to convert atom.png to varying resolutions, although, only during
the rpm build process (not during actual install). So the result
is ultimatly no different for the end user.

Also, fixed an absolute path from the rpm build process and made
it relative. It was hardcoded in the spec file to
"/tmp/atom-build/Atom/*", so builds that were made elsewhere would
have broken when attempting to package into an rpm. Now rpm packaging
should work from a build made anywhere. Also needed to modify
script/mkrpm so that it copies the build files in such a way that
they can more easily be dealt with in the spec file in a relative
way.
2015-01-31 22:14:07 -07:00
Ethan Estrada a7e18b05d3 Depend on $PATH to find executable in atom.desktop
With the atom atom executable now located in /usr/bin instead
of /usr/local/bin, it should always be available as part of the
system PATH. Thus hardcoding the filepath is not needed. Also, this
increase the flexibility of relocating the rpm at installation time
(not just build time) since the user or sys admin need only make
sure that the atom executable is in the system PATH and the
atom.desktop file will work correctly.
2015-01-31 22:12:26 -07:00
Edgard Castro b92e6f5a2d Fixes RPM install path and icon location
This makes Atom a better desktop citizen relocating to where the usual install
directory is (like on the debian package) and also fix the icon using absolute
paths, breaking icon-themes.
2015-01-31 15:04:24 -02:00
Xue Fuqiao 2170e917bd 📝 Minor punctuation fix. 2015-01-31 23:59:35 +08:00
Ivan Žužak 7add4af585 Merge pull request #5334 from xfq/https
Change HTTP to HTTPS
2015-01-31 11:42:56 +01:00
Ivan Žužak 5076e2c8b3 Merge pull request #5333 from xfq/devtools-link
Update the URI of DevTools tutorial in docs
2015-01-31 11:41:52 +01:00
Ivan Žužak b56d73cd74 Merge pull request #5330 from xfq/broken-link
📝 Fix a broken link.
2015-01-31 11:40:37 +01:00
Ivan Žužak 6c5a0e3670 Merge pull request #5329 from xfq/install-theme
📝 Fix theme docs.
2015-01-31 11:39:42 +01:00
Ivan Žužak 791f89216b Merge pull request #5327 from xfq/osx-fix
Change Mac OS X to OS X.
2015-01-31 11:38:53 +01:00
Xue Fuqiao f6067cb629 📝 Fix previous change. 2015-01-31 18:08:13 +08:00
Xue Fuqiao 22158031bf Change HTTP to HTTPS.
Change HTTP to HTTPS to avoid plaintext HTTP connections.
2015-01-31 17:59:45 +08:00
Xue Fuqiao 8ac3fada4e 📝 Update the URI of DevTools tutorial. 2015-01-31 17:11:09 +08:00
Xue Fuqiao a03d5bc288 📝 Fix a broken link.
Fix a broken link in `docs/creating-a-theme.md`.
2015-01-31 14:10:39 +08:00
Xue Fuqiao cc489e5663 📝 Fix theme docs. 2015-01-31 13:51:40 +08:00
Xue Fuqiao cd3f7f73a0 Change Mac OS X to OS X.
Apple has renamed Mac OS X to OS X.
2015-01-31 12:36:35 +08:00
Ben Ogle 9cb67a6def 📝 Fix doc reference in config 2015-01-30 16:52:19 -08:00
Kevin Sawicki 786e8c558a Merge pull request #5314 from eestrada/master
Make rpm install package a little more flexible
2015-01-30 11:12:50 -08:00
Ethan Estrada bfeeddea4d Make rpm package installs relocatable 2015-01-29 22:55:41 -07:00
Ethan Estrada 1589b8b192 Make apm symlink relative for rpm spec 2015-01-29 22:35:11 -07:00
Ben Ogle b02d0e3df3 Merge pull request #5280 from atom/bo-schema-on-load
Reset all user config values when the schema changes
2015-01-29 18:06:18 -08:00
Ben Ogle d3f29c4580 🎨 Fix wording 2015-01-29 17:54:41 -08:00
Ben Ogle 7263ca8faa 🎨 Fix spec title 2015-01-29 17:54:41 -08:00
Ben Ogle cd812e7a65 Transact on resetting the settings when a schema changes 2015-01-29 17:54:41 -08:00
Ben Ogle 4e6e636b8b 🎨 Reorder args to be consistent with other methods 2015-01-29 17:54:41 -08:00
Ben Ogle 083bafdb33 Handle unschema’d items in objects.
This is required for packages that still use configDefaults
2015-01-29 17:54:41 -08:00
Ben Ogle adbe151c5d Fix up the linter error 2015-01-29 17:54:41 -08:00
Ben Ogle 26b450fe49 🎨 Clean up spec naming 2015-01-29 17:54:41 -08:00
Ben Ogle 5d273d0ee6 Add a bit more coverage to the specs 2015-01-29 17:54:41 -08:00
Ben Ogle b9b2b4bca2 Adhere to the schemas when loading the user’s config 2015-01-29 17:54:41 -08:00
Ben Ogle 79094ee889 Reset all user config values when the schema changes. 2015-01-29 17:54:40 -08:00
Michael Bolin 52f2c0ec69 rename esnext to 6to5 2015-01-29 17:29:02 -08:00
Kevin Sawicki d2f485a1ab ⬆️ deprecation-cop@0.34 2015-01-29 16:44:33 -08:00
Kevin Sawicki c12002a0ba ⬆️ bracket-matcher@0.71 2015-01-29 16:41:22 -08:00
Michael Bolin fed2bd6ab8 fixed a bug in updateDigestForJsonValue with how null was handled 2015-01-29 12:33:14 -08:00
Michael Bolin d29b5b20cd Prefer Object.defineProperty() 2015-01-29 12:27:31 -08:00
Michael Bolin a0bb9d88e0 remove parens 2015-01-29 12:21:59 -08:00
Michael Bolin 32b3c4076f More fixes for @kevinsawicki 2015-01-29 12:15:10 -08:00
Michael Bolin acd1d31480 Address @kevinsawicki's comments. 2015-01-29 12:10:25 -08:00
Michael Bolin 242fce3d79 Transpile all .js files with 6to5.
In the spirit of supporting JavaScript development for Atom packages,
this adds default support for es.next transpilation support in the way
that Atom already has default support for CoffeeScript transpilation.
There are many new features in ES6+ that make JavaScript development
easier and more enjoyable, particularly in terms of support for async code.

For reference, this was a much faster way to iterate on this than running `./script/build`
each time:

```
cp /Users/mbolin/src/atom/static/index.js /Applications/Atom.app/Contents/Resources/app/static/index.js
coffee --output /Applications/Atom.app/Contents/Resources/app/src --compile /Users/mbolin/src/atom/src/esnext.coffee
```

Run the following in the console to see how warm the cache was after startup:

```
global.require('../src/esnext/').getCacheHits()
global.require('../src/esnext/').getCacheMisses()
```
2015-01-29 11:56:32 -08:00
Kevin Sawicki e0bac77fa5 ⬆️ season@5.1.2
Closes atom/snippets#101
2015-01-29 11:31:11 -08:00
Kevin Sawicki c4c13375e4 ⬆️ language-todo@0.16 2015-01-29 09:41:06 -08:00
Kevin Sawicki 83f0104c46 Merge pull request #5305 from mnquintana/patch-3
Fix broken npm package.json link in creating-a-package.md
2015-01-29 09:15:11 -08:00
Machiste N. Quintana a0a3c93b1d 📝 Fix broken npm package.json link
In creating-a-package.md
Fixes #5304
2015-01-29 10:52:46 -05:00
Nathan Sobo 98a874808e ⬆️ react-atom-fork for @bolinfest's changes 2015-01-29 08:24:00 -07:00
Ben Ogle e7b790c5b9 Merge pull request #5300 from nextPrime/patch-1
http://github.com -> https://github.com
2015-01-28 18:45:27 -08:00
nextPrime 4988293400 http://github.com -> https://github.com
Change http://github.com to https://github.com to avoid plaintext HTTP connections.
2015-01-28 21:17:29 -05:00
Kevin Sawicki 0d51c3b871 ⬆️ apm@0.133 2015-01-28 16:42:13 -08:00
Kevin Sawicki 8316183fa0 ⬇️ apm@0.131 2015-01-28 16:37:43 -08:00
simurai 8e617ff4e2 📝 Update Shadow DOM selector 2015-01-29 09:27:17 +09:00
Kevin Sawicki 3ca5495690 Merge pull request #5279 from paulcbetts/patch-1
Enable DirectWrite
2015-01-28 16:11:15 -08:00
Kevin Sawicki 5c47ae0cbc ⬆️ apm@0.132 2015-01-28 16:05:31 -08:00
Cheng Zhao 6a86a00c66 Merge pull request #5282 from atom/chrome40
Upgrade to Chrome40
2015-01-28 15:52:20 -08:00
Cheng Zhao 1abe64e73e styleguide@0.43.0 2015-01-28 14:35:45 -08:00
Cheng Zhao bb9150340d ⬆️ markdown-preview@0.131.0 2015-01-28 14:32:55 -08:00
Cheng Zhao c3f5c43694 ⬆️ link@0.30.0 2015-01-28 14:24:29 -08:00
Cheng Zhao 1678016ae4 ⬆️ image-view@0.48.0 2015-01-28 14:22:43 -08:00
Cheng Zhao f50e402de3 ⬆️ bracket-matcher@0.70.0 2015-01-28 14:20:08 -08:00
Cheng Zhao e6363150dd ⬆️ pathwatcher@3.1.0 2015-01-28 14:16:16 -08:00
Cheng Zhao 5f024bfd69 ⬆️ markdown-preview@0.130.0 2015-01-28 14:06:29 -08:00
Cheng Zhao 76adb58fea ⬆️ scandal@2.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 53d5e61b23 ⬆️ atom-keymap@3.1.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 499c09fc25 ⬆️ first-mate@3.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 7891595fed ⬆️ text-buffer@4.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 604f2a951f ⬆️ scroller-style@2.0.0 2015-01-28 14:06:15 -08:00
Cheng Zhao c1b6b716b1 ⬆️ archive-view@0.46.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 4d861a68d1 ⬆️ dev-live-reload@0.41.0 2015-01-28 14:06:15 -08:00
Cheng Zhao a831688ce1 ⬆️ snippets@0.72.0 2015-01-28 14:06:15 -08:00
Cheng Zhao 1cbac24cee ⬆️ tree-view@0.154.0 2015-01-28 14:06:15 -08:00
Cheng Zhao afa5f73094 ⬆️ spell-check@0.54.0 2015-01-28 14:06:15 -08:00
Cheng Zhao a142e23f49 ⬆️ nslog@2.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao f1b7536d06 ⬆️ oniguruma@4.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 397e61a0d8 ⬆️ git-utils@3.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao af22e45f70 ⬆️ runas@2.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao e6a12530a1 ⬆️ symbols-view@0.81.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 896c98b7a0 ⬆️ pathwatcher@3.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 3201a05672 ⬆️ apm@0.131.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 93181d8a54 Array::find is undefined in Chrome 40 2015-01-28 14:06:14 -08:00
Cheng Zhao 661f1f822a ⬆️ atom-keymap@3.0.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 678306317d ⬆️ text-buffer@3.11.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 8dd5f17609 ⬆️ scrollbar-style@1.1.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 13e069b45d ⬆️ scandal@1.1.0 2015-01-28 14:06:14 -08:00
Cheng Zhao e61cc5eb13 ⬆️ tree-view@0.152.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 9e92952ad0 ⬆️ symbols-view@0.80.0 2015-01-28 14:06:14 -08:00
Cheng Zhao a8d778781c ⬆️ snippets@v0.71.0 2015-01-28 14:06:14 -08:00
Cheng Zhao da17679ec7 ⬆️ dev-live-preview@0.40.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 1cf663714e ⬆️ archive-view@0.45.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 05963c4e57 ⬆️ spell-check@0.53.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 965a18f7e2 ⬆️ nslog@1.1.0 2015-01-28 14:06:14 -08:00
Cheng Zhao 58c45f87e6 ⬆️ oniguruma@3.1.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 21e609ffac ⬆️ pathwatcher@2.7.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 93befc986f ⬆️ git-utils@2.3.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 3321d77264 ⬆️ runas@1.2.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 84761563f0 ⬆️ apm@0.129.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 014cf19723 ⬆️ atom-shell@0.21.0 2015-01-28 14:06:13 -08:00
Cheng Zhao 2a42ed4aaa ⬆️ markdown-preview@0.129.0 2015-01-28 14:05:17 -08:00
Kevin Sawicki 34b1615782 Lower limit to 175 2015-01-28 12:09:43 -08:00
Kevin Sawicki 87db2760b8 ⬆️ autocomplete@0.44 2015-01-28 09:40:42 -08:00
Max Brunsfeld b4dd0f4f73 ⬆️ language-c 2015-01-28 09:35:20 -08:00
Max Brunsfeld 9d655fd642 ⬆️ language-javascript 2015-01-28 09:12:38 -08:00
Max Brunsfeld 4700edf439 ⬆️ markdown-preview 2015-01-28 08:50:32 -08:00
Cheng Zhao 87c2f4496f 🐧 Set window icon, fixes #5281 2015-01-27 20:34:36 -08:00
Ben Ogle 2741445d95 ⬆️ background-tips@0.22.0 2015-01-27 18:32:32 -08:00
Kevin Sawicki ed90c5e6c2 ⬆️ less-cache@0.21 2015-01-27 17:32:13 -08:00
Kevin Sawicki 0bf2a3f480 ⬆️ apm@0.130 2015-01-27 17:24:03 -08:00
Paul Betts a743e8d058 Enable DirectWrite
Chrome 39 proper now has DirectWrite as the default renderer, which makes a huge difference in text clarity, especially on High DPI monitors.
2015-01-27 14:38:50 -08:00
Kevin Sawicki ddc607c760 ⬆️ tree-view@0.151 2015-01-27 14:30:28 -08:00
Kevin Sawicki cbc8ad1467 Merge pull request #5201 from wyand/master
🍎 try ~/Applications before using mdfind
2015-01-27 14:09:52 -08:00
Kevin Sawicki 1a1eb4380a ⬆️ tabs@0.65 2015-01-27 14:06:28 -08:00
Kevin Sawicki 535b49f60c ⬆️ tree-view@0.150 2015-01-27 13:43:09 -08:00
Kevin Sawicki b5e60f7aa0 ⬆️ spell-check@0.52 2015-01-27 13:33:04 -08:00
Kevin Sawicki ce29060d2d ⬆️ first-mate@2.2.5 2015-01-27 09:30:24 -08:00
Ben Ogle 7d1c23b561 ⬆️ git-diff@0.50.0 2015-01-26 17:39:30 -08:00
Ben Ogle 9e2799db27 ⬆️ status-bar@0.58.0 2015-01-26 15:56:50 -08:00
Daniel Hengeveld 040f6deb1e Merge pull request #5263 from atom/bump-tree-view
⬆️ bump tree view for new sort option
2015-01-26 14:31:53 -08:00
Kevin Sawicki 33d2debf5f Prepare 0.177 2015-01-26 13:59:57 -08:00
Daniel Hengeveld 6de40e21c7 bump tree view to include version with new sort option 2015-01-26 13:05:37 -08:00
Cheng Zhao 6169caa1fb Merge pull request #5235 from atom/atom-shell-v0.20.7
Upgrade to atom-shell v0.20.7
2015-01-26 12:58:06 -08:00
Cheng Zhao b4e25137a2 "screen" is now a browser side module 2015-01-26 11:28:00 -08:00
Cheng Zhao 05aaace387 Do not set window icon, fixes #4811 2015-01-26 11:28:00 -08:00
Cheng Zhao a32daecf5f ⬆️ atom-shell@0.20.7 2015-01-26 11:28:00 -08:00
Kevin Sawicki 6db43d85c4 Remove CI node_modules cleaning 2015-01-26 11:01:42 -08:00
Kevin Sawicki 53e06b8680 Clean out node_modules on Linux CI 2015-01-26 10:44:06 -08:00
Kevin Sawicki 9ab2500970 Clean out node_modules on Windows CI 2015-01-26 10:15:37 -08:00
Kevin Sawicki 697e70d47c ⬆️ apm@0.128 2015-01-26 09:43:42 -08:00
Daniel Hengeveld ffd1f8520c Merge pull request #5240 from mnquintana/less-rename
📝 Rename LESS to Less
2015-01-25 11:48:12 -08:00
Machiste Quintana 9132859757 📝 LESS -> Less 2015-01-24 09:49:53 -05:00
Kevin Sawicki 6af2e1649c ⬆️ legal-eagle@0.9 2015-01-23 13:33:25 -08:00
Kevin Sawicki 0962918a82 ⬆️ timecop@0.28 2015-01-23 11:51:41 -08:00
Kevin Sawicki 6b963a562f Track coffee cache hits correctly 2015-01-23 11:48:19 -08:00
Ben Ogle db41b022c2 Merge pull request #5228 from atom/bo-fix-wait-promise
Make waitsForPromise() work with es6 promises as well as Q promises
2015-01-23 10:33:20 -08:00
Kevin Sawicki d4084b305b ⬆️ season@5.1.1 2015-01-23 09:57:48 -08:00
Kevin Sawicki b81c1f408f Track coffee cache hits/misses 2015-01-23 09:41:26 -08:00
Kevin Sawicki 97bdb84122 ⬆️ season@5.1 2015-01-23 09:41:26 -08:00
Kevin Sawicki 87e8720269 ⬆️ less-cache@0.20 2015-01-23 09:41:26 -08:00
Max Brunsfeld 160c32384c ⬆️ markdown-preview@0.126.0 2015-01-23 08:33:44 -08:00
Ben Ogle 33299ec774 ⬆️ notifications@0.26.0 2015-01-22 18:15:50 -08:00
Max Brunsfeld d4cc549a01 Add jasmine.useRealClock
This is the only way to unmock the _.now function uses
by _.debounce and _.throttle, since package specs don't
necessarily have access to core's copy of underscore-plus

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-22 17:59:18 -08:00
Ben Ogle 76a5da8be8 Make waitsForPromise() work with es6 promises as well as Q promises. 2015-01-22 17:26:15 -08:00
Ben Ogle 0b0cbe11dc 📝 Fix BufferedProcess docs 2015-01-22 17:24:56 -08:00
Nathan Sobo 86d730a3a9 Always forceUpdate when editor component is visible
Fixes #5187. Giving up after 90 minutes on producing a failing test case
because this is all changing soon anyway and getting simpler. I’m
willing to risk this regressing to solve it now and move on.
2015-01-22 17:28:02 -07:00
Kevin Sawicki 99ff482afe ⬆️ apm@0.127 2015-01-22 15:36:04 -08:00
Kevin Sawicki 84be87324e Always deepClone since it supports colors now 2015-01-22 14:41:55 -08:00
Kevin Sawicki d1ecafc69f ⬆️ apm@0.125 2015-01-22 14:12:58 -08:00
Kevin Sawicki 235f602002 Merge pull request #5220 from atom/ks-bundle-one-themes
Bundle the one themes
2015-01-22 14:11:37 -08:00
Kevin Sawicki 1ee4240b7e ⬆️ one-dark-ui@0.2 2015-01-22 13:49:42 -08:00
Kevin Sawicki a46c4ed30e ⬆️ one-light-syntax@0.2 2015-01-22 13:49:42 -08:00
Kevin Sawicki 023b9d18e1 ⬆️ one-dark-syntax@0.2 2015-01-22 13:49:42 -08:00
Kevin Sawicki 5b992d1397 Warm cache with one themes 2015-01-22 13:49:42 -08:00
Kevin Sawicki 1ad25f4a56 Bundle one themes 2015-01-22 13:49:42 -08:00
Kevin Sawicki 4baea35c23 ⬆️ apm@0.124 2015-01-22 11:33:57 -08:00
Kevin Sawicki 63335f6b60 Return Color object when in cloned objects
This adds a custom deepClone that clones any Color objects
correctly.
2015-01-22 10:48:07 -08:00
Nathan Sobo f691c20d68 Revert "Add license override for emoji-images"
This reverts commit 36d28235fa.
2015-01-22 10:58:51 -07:00
Max Brunsfeld 45ca1c6762 Merge pull request #5189 from atom/mb-simpler-auto-indent-on-paste
Preserve relative indentation of pasted lines when auto-indenting
2015-01-22 08:44:18 -08:00
Max Brunsfeld 528267b7d7 Preserve relative indentation of pasted lines when auto-indenting 2015-01-22 08:34:20 -08:00
Max Brunsfeld 5cdeb7bc18 Fix comment for Selection::adjustIndent 2015-01-22 08:34:20 -08:00
Nathan Sobo 36d28235fa Add license override for emoji-images 2015-01-22 08:40:53 -07:00
Dan Wyand 3b13e4f502 🍎 try ~/Applications before using mdfind 2015-01-21 23:01:37 -05:00
Kevin Sawicki f7ecc3e2a3 Don't log npm install warnings
Closes #5194
2015-01-21 17:10:21 -08:00
Kevin Sawicki 89a5469151 📝 Mention apm install --check
Refs atom/apm#265
2015-01-21 15:33:19 -08:00
Kevin Sawicki 77e8f5c9ac ⬆️ markdown-preview@0.125 2015-01-21 13:41:37 -08:00
Kevin Sawicki 1fc597ca22 🎨 2015-01-21 11:23:28 -08:00
Kevin Sawicki 5c62eb0253 ⬆️ wrap-guide@0.31 2015-01-21 11:22:29 -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
Nathan Sobo 12982027f2 ⬆️ release-notes 2015-01-21 12:19:37 -07:00
Kevin Sawicki 36a9e3f76e ⬆️ deprecation-cop@0.33 2015-01-21 11:11:42 -08:00
Kevin Sawicki a9d215970f Remove fs patches that are now fixed in Atom Shell 2015-01-21 10:39:08 -08:00
Kevin Sawicki 0daee2c2c2 Prepare 0.176 2015-01-21 10:12:57 -08:00
Kevin Sawicki f9fe317298 ⬆️ apm@0.123 2015-01-21 09:53:34 -08:00
Max Brunsfeld ce46991600 ⬆️ language-javascript
Fixes #5180
2015-01-21 09:52:17 -08:00
Nathan Sobo e1d9838a28 ⬆️ markdown-preview 2015-01-21 10:46:19 -07:00
Kevin Sawicki 0c057dbbd5 ⬆️ encoding-selector@0.17 2015-01-21 09:23:51 -08:00
Kevin Sawicki aad393618e Merge pull request #5175 from atom/ks-shorten-apm-paths
Shorten apm paths in bundle
2015-01-21 09:23:09 -08:00
Kevin Sawicki ccaffb1c28 Add fall back apm path for dev mode 2015-01-21 09:07:26 -08:00
Kevin Sawicki 47b1d3e90f Use new apm.cmd path 2015-01-21 09:07:26 -08:00
Kevin Sawicki 9df7ea91db Use new apm path on all platforms 2015-01-21 09:07:26 -08:00
Kevin Sawicki 5bf0e53c01 Shorten apm paths on Windows 2015-01-21 09:07:26 -08:00
Nathan Sobo c052b03793 ⬆️ markdown-preview 2015-01-21 10:05:43 -07:00
Nathan Sobo 22cf142473 Add license override for cheerio@0.15.0
Newer versions of the library have the license added, but this is easier
than upgrading for now.
2015-01-21 09:02:25 -07:00
Max Brunsfeld 1d6db875ff ⬆️ text-buffer
To fix exception contributing to #5169
2015-01-21 07:20:50 -08:00
Nathan Sobo b2a71ecd36 ⬆️ packages to fix deprecations 2015-01-21 07:47:29 -07:00
Kevin Sawicki 432b531c07 Include fallback vars when warming less cache 2015-01-20 18:45:14 -08:00
Kevin Sawicki 3190f7578f ⬆️ keybinding-resolve@0.27 2015-01-20 18:02:34 -08:00
Ben Ogle db49d4da31 Merge pull request #5157 from postcasio/da-handle-erofs
Handle EROFS errors when saving
2015-01-20 15:39:19 -08:00
Ben Ogle 9fb1edbc54 Fix inconsistent keybindings in first package guide
Closes #3863
2015-01-20 15:11:39 -08:00
Kevin Sawicki 5a2365cead ⬆️ apm@0.122 2015-01-20 10:14:35 -08:00
Kevin Sawicki 3619e6acaf ⬆️ language-sql@0.14 2015-01-20 10:14:23 -08:00
Kevin Sawicki 936ab1c898 Merge pull request #5118 from nullstyle/fix-addOpener-doc-typo
Fix typo in addOpener doc
2015-01-20 10:03:31 -08:00
Nathan Sobo b961ed416e Merge pull request #5152 from atom/sm-docs-upgrading-syntax-theme
Update atom-text-editor selector example
2015-01-20 09:54:13 -07:00
postcasio 867f920329 Handle EROFS errors when saving 2015-01-20 09:56:00 +00:00
simurai 6f4107fe5d 📝 Update text-editor example 2015-01-20 16:03:47 +09:00
Ben Ogle 323ce940f9 Merge pull request #5143 from avrahamruderman/master
typo
2015-01-19 10:49:34 -08:00
Avi 1fe452776d typo
the the
2015-01-19 22:11:31 +11:00
Scott Fleckenstein d263205a9a 📝 Fix typo in addOpener doc 2015-01-16 18:39:54 -08:00
Nathan Sobo 60970d6cec ⬆️ markdown-preview to debug flaky spec 2015-01-16 16:15:47 -07:00
Kevin Sawicki 32f6ab717e Merge pull request #5117 from rachelmyers/patch-1
Replace the lipstick emoji for formatting changes
2015-01-16 14:16:35 -08:00
Rachel Myers 4f871f1331 s/💄/🎨 as emoji for formatting changes
Fixes #5111
2015-01-16 14:08:33 -08:00
Max Brunsfeld c2107fa9b3 ⬆️ settings-view
For more deprecation fixes
2015-01-16 12:25:17 -08:00
Max Brunsfeld 96d4c1c41b Save config when deprerecated Config::set signature is used 2015-01-16 12:24:32 -08:00
Ben Ogle bac10d60c4 Merge pull request #5114 from atom/bo-readonly
Allow opening of readonly files
2015-01-16 11:41:30 -08:00
Ben Ogle 828b841f17 Roll two whens into one 2015-01-16 11:24:24 -08:00
Ben Ogle 11bda1b47a Add error handling for EBUSY as well 2015-01-16 11:07:32 -08:00
Ben Ogle 2577843e51 Explicitly check if the path to be deserialized is a dir 2015-01-16 10:53:35 -08:00
Max Brunsfeld e0e821e7a4 ⬆️ service-hub@0.2.0 2015-01-16 10:50:47 -08:00
Ben Ogle 93f109fbba Add a better message for EPERM errors. 2015-01-16 10:45:48 -08:00
Ben Ogle 97a55ba8c0 Only check read permission on read 2015-01-16 10:24:19 -08:00
Max Brunsfeld 0a59d13d56 Fix Config::unset with no scope-selector
Closes #5095
2015-01-16 10:23:12 -08:00
Kevin Sawicki 20dbc4cfd3 ⬆️ apm@0.121 2015-01-16 09:47:43 -08:00
Kevin Sawicki 6efaf91ff9 Merge pull request #5086 from atom/ks-deserialize-buffer-error
Check if files are accessible during deserialization
2015-01-16 09:47:01 -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
Kevin Sawicki 16cc9f76c4 📝 Tweak spec description 2015-01-16 09:33:42 -08:00
Kevin Sawicki 6ad8aa7e5c Ignore buffer errors when the path is a directory
This would previously cause Atom to fail to launch if a buffer's
serialized path was now a directory on launch.
2015-01-16 09:33:42 -08:00
Kevin Sawicki 67fc2b9af5 ⬆️ pathwatcher@2.6.1 2015-01-16 09:33:42 -08:00
Nathan Sobo b8b58b25da ⬆️ dev-live-reload 2015-01-16 09:38:14 -07:00
simurai 696c795b50 🐛 Fix overflow of mini editors
Issue #4400
2015-01-16 20:12:53 +09:00
Kevin Sawicki 97d697f195 Guard against no cwd when resolving
Refs #5074
2015-01-15 17:02:23 -08:00
Kevin Sawicki 57d020ff65 Ensure resolving paths to open uses strings
Refs #5074
2015-01-15 16:58:08 -08:00
Kevin Sawicki 3e56822968 ⬆️ oniguruma@3.0.6 2015-01-15 16:48:05 -08:00
Max Brunsfeld d46d797f87 ⬆️ snippets@0.70 2015-01-15 16:26:02 -08:00
Max Brunsfeld fa6a826a37 ⬆️ language-gfm 2015-01-15 14:16:41 -08:00
Ben Ogle e598856db5 Fix the version number in the upgrade guide 2015-01-15 14:00:37 -08:00
Ben Ogle 380fee33ef ⬆️ metrics@0.41.0 2015-01-15 14:00:37 -08:00
Kevin Sawicki d524d25a43 Prepare 0.175 2015-01-15 12:56:02 -08:00
Russell Lescai c538857cfa Removed unnecessary braces. 2015-01-15 08:57:25 +10:30
Russell Lescai 6716e544f0 Fix spec it function. 2015-01-14 15:07:42 +10:30
Russell Lescai 2f3a9c9e35 Updated js scope selector. 2015-01-14 14:08:23 +10:30
Russell Lescai 3d1baaf3f3 Added spec. Changed argument order for config get/set. 2015-01-14 13:46:21 +10:30
Russell Lescai b819f681aa Moved setEncoding to TextEditor constructor. 2015-01-14 13:05:20 +10:30
Russell Lescai e30b2f1c73 Allow scoped default File Encoding 2015-01-14 11:51:21 +10:30
105 arquivos alterados com 1404 adições e 476 exclusões
+2 -2
Ver Arquivo
@@ -36,7 +36,7 @@ many packages and themes that are stored in other repos under the
[tabs](https://github.com/atom/tabs),
[find-and-replace](https://github.com/atom/find-and-replace),
[language-javascript](https://github.com/atom/language-javascript), and
[atom-light-ui](http://github.com/atom/atom-light-ui).
[atom-light-ui](https://github.com/atom/atom-light-ui).
For more information on how to work with Atom's official packages, see
[Contributing to Atom Packages](https://atom.io/docs/latest/contributing-to-packages.html)
@@ -74,7 +74,7 @@ For more information on how to work with Atom's official packages, see
* Limit the first line to 72 characters or less
* Reference issues and pull requests liberally
* Consider starting the commit message with an applicable emoji:
* :lipstick: `:lipstick:` when improving the format/structure of the code
* :art: `:art:` when improving the format/structure of the code
* :racehorse: `:racehorse:` when improving performance
* :non-potable_water: `:non-potable_water:` when plugging memory leaks
* :memo: `:memo:` when writing docs
+4 -14
Ver Arquivo
@@ -1,6 +1,6 @@
![Atom](https://cloud.githubusercontent.com/assets/72919/2874231/3af1db48-d3dd-11e3-98dc-6066f8bc766f.png)
Atom is a hackable text editor for the 21st century, built on [atom-shell](http://github.com/atom/atom-shell), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
Atom is a hackable text editor for the 21st century, built on [atom-shell](https://github.com/atom/atom-shell), and based on everything we love about our favorite editors. We designed it to be deeply customizable, but still approachable using the default configuration.
Visit [atom.io](https://atom.io) to learn more or visit the [Atom forum](https://discuss.atom.io).
@@ -9,7 +9,7 @@ about the Atom 1.0 roadmap.
## Installing
### Mac OS X
### OS X
Download the latest [Atom release](https://github.com/atom/atom/releases/latest).
@@ -24,18 +24,8 @@ Atom will automatically update when a new release is available.
You can also download an `atom-windows.zip` file from the [releases page](https://github.com/atom/atom/releases/latest).
The `.zip` version will not automatically update.
#### Uninstalling Chocolatey Version
The recommended installation of Atom on Windows used to be using [Chocolatey](https://chocolatey.org/packages/Atom/).
This is no longer recommended now that the Atom Windows installer & auto-updater
exists.
To switch from Chocolatey to the new installer:
* Upgrade to Atom 0.155 or above by running `cup Atom`
* Run `cuninst Atom` to uninstall the Chocolatey version of Atom
* This will not delete any of your installed packages or Atom config files.
* Download the latest [AtomSetup.exe installer](https://github.com/atom/atom/releases/latest).
* Double-click the downloaded file to install Atom
Using [chocolatey](https://chocolatey.org/)? Run `cinst Atom` to install
the latest version of Atom.
### Debian Linux (Ubuntu)
+1 -1
Ver Arquivo
@@ -6,6 +6,6 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "0.120.0"
"atom-package-manager": "0.135.0"
}
}
+19 -13
Ver Arquivo
@@ -45,18 +45,24 @@ if [ $REDIRECT_STDERR ]; then
fi
if [ $OS == 'Mac' ]; then
ATOM_PATH="${ATOM_PATH:-/Applications}" # Set ATOM_PATH unless it is already set
ATOM_APP_NAME=Atom.app
# If ATOM_PATH isn't a executable file, use spotlight to search for Atom
if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
fi
if [ -z "${ATOM_PATH}" ]; then
# If ATOM_PATH isnt set, check /Applications and then ~/Applications for Atom.app
if [ -x "/Applications/$ATOM_APP_NAME" ]; then
ATOM_PATH="/Applications"
elif [ -x "$HOME/Applications/$ATOM_APP_NAME" ]; then
ATOM_PATH="$HOME/Applications"
else
# We havent found an Atom.app, use spotlight to search for Atom
ATOM_PATH="$(mdfind "kMDItemCFBundleIdentifier == 'com.github.atom'" | grep -v ShipIt | head -1 | xargs -0 dirname)"
# Exit if Atom can't be found
if [ -z "$ATOM_PATH" ]; then
echo "Cannot locate Atom.app, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing Atom.app."
exit 1
# Exit if Atom can't be found
if [ ! -x "$ATOM_PATH/$ATOM_APP_NAME" ]; then
echo "Cannot locate Atom.app, it is usually located in /Applications. Set the ATOM_PATH environment variable to the directory containing Atom.app."
exit 1
fi
fi
fi
if [ $EXPECT_OUTPUT ]; then
@@ -69,9 +75,9 @@ elif [ $OS == 'Linux' ]; then
SCRIPT=$(readlink -f "$0")
USR_DIRECTORY=$(readlink -f $(dirname $SCRIPT)/..)
ATOM_PATH="$USR_DIRECTORY/share/atom/atom"
DOT_ATOM_DIR="$HOME/.atom"
ATOM_HOME="${ATOM_HOME:-$HOME/.atom}"
mkdir -p "$DOT_ATOM_DIR"
mkdir -p "$ATOM_HOME"
: ${TMPDIR:=/tmp}
@@ -82,9 +88,9 @@ elif [ $OS == 'Linux' ]; then
exit $?
else
(
nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$DOT_ATOM_DIR/nohup.out" 2>&1
nohup "$ATOM_PATH" --executed-from="$(pwd)" --pid=$$ "$@" > "$ATOM_HOME/nohup.out" 2>&1
if [ $? -ne 0 ]; then
cat "$DOT_ATOM_DIR/nohup.out"
cat "$ATOM_HOME/nohup.out"
exit $?
fi
) &
+1
Ver Arquivo
@@ -207,6 +207,7 @@ module.exports = (grunt) ->
loadingGif: path.resolve(__dirname, '..', 'resources', 'win', 'loading.gif')
iconUrl: 'https://raw.githubusercontent.com/atom/atom/master/resources/win/atom.ico'
setupIcon: path.resolve(__dirname, '..', 'resources', 'win', 'atom.ico')
remoteReleases: 'https://atom.io/api/updates'
shell:
'kill-atom':
+3 -3
Ver Arquivo
@@ -1,13 +1,13 @@
# VERSION: 0.1
# DESCRIPTION: Create the atom editor in a container
# DESCRIPTION: Create the atom editor in a container
# AUTHOR: Jessica Frazelle <jessie@docker.com>
# COMMENTS:
# This file describes how to build the atom editor
# This file describes how to build the atom editor
# in a container with all dependencies installed.
# Tested on Debian Jessie.
# USAGE:
# # Download atom Dockerfile
# wget http://raw.githubusercontent.com/atom/atom/master/Dockerfile
# wget https://raw.githubusercontent.com/atom/atom/master/Dockerfile
#
# # Build atom image
# docker build -t atom .
+2 -2
Ver Arquivo
@@ -12,7 +12,7 @@
"fs-plus": "2.x",
"github-releases": "~0.2.0",
"grunt": "~0.4.1",
"grunt-atom-shell-installer": "^0.20.0",
"grunt-atom-shell-installer": "^0.21.0",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
"grunt-contrib-coffee": "~0.12.0",
@@ -24,7 +24,7 @@
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",
"harmony-collections": "~0.3.8",
"legal-eagle": "~0.8.0",
"legal-eagle": "~0.9.0",
"minidump": "~0.8",
"npm": "~1.4.5",
"rcedit": "~0.3.0",
+4 -1
Ver Arquivo
@@ -144,7 +144,10 @@ module.exports = (grunt) ->
cp 'spec', path.join(appDir, 'spec')
cp 'src', path.join(appDir, 'src'), filter: /.+\.(cson|coffee)$/
cp 'static', path.join(appDir, 'static')
cp 'apm', path.join(appDir, 'apm'), filter: filterNodeModule
cp path.join('apm', 'node_modules', 'atom-package-manager'), path.join(appDir, 'apm'), filter: filterNodeModule
if process.platform isnt 'win32'
fs.symlinkSync(path.join('..', '..', 'bin', 'apm'), path.join(appDir, 'apm', 'node_modules', '.bin', 'apm'))
if process.platform is 'darwin'
grunt.file.recurse path.join('resources', 'mac'), (sourcePath, rootDirectory, subDirectory='', filename) ->
+2 -2
Ver Arquivo
@@ -47,9 +47,9 @@ module.exports = (grunt) ->
{description} = grunt.file.readJSON('package.json')
iconName = path.join(shareDir, 'resources', 'app', 'resources', 'atom.png')
installDir = path.join(installDir, '.') # To prevent "Exec=/usr/local//share/atom/atom"
executable = path.join(shareDir, 'atom')
template = _.template(String(fs.readFileSync(desktopFile)))
filled = template({description, installDir, iconName})
filled = template({description, iconName, executable})
grunt.file.write(desktopInstallFile, filled)
+7
Ver Arquivo
@@ -35,6 +35,10 @@ module.exports =
MIT/X11
"""
'cheerio@0.15.0':
repository: "https://github.com/cheeriojs/cheerio"
license: 'MIT'
source: 'https://github.com/cheeriojs/cheerio/blob/master/package.json'
'specificity@0.1.3':
repository: 'https://github.com/keeganstreet/specificity'
license: 'MIT'
@@ -75,3 +79,6 @@ module.exports =
LGPL
"""
'core-js@0.4.10':
license: 'MIT'
source: 'http://rock.mit-license.org linked in source files and bower.json says MIT'
+2 -1
Ver Arquivo
@@ -36,8 +36,9 @@ module.exports = (grunt) ->
maintainer = 'GitHub <atom@github.com>'
installDir = '/usr'
iconName = 'atom'
executable = path.join(installDir, 'share', 'atom', 'atom')
getInstalledSize buildDir, (error, installedSize) ->
data = {name, version, description, section, arch, maintainer, installDir, iconName, installedSize}
data = {name, version, description, section, arch, maintainer, installDir, iconName, installedSize, executable}
controlFilePath = fillTemplate(path.join('resources', 'linux', 'debian', 'control'), data)
desktopFilePath = fillTemplate(path.join('resources', 'linux', 'atom.desktop'), data)
icon = path.join('resources', 'atom.png')
+2 -1
Ver Arquivo
@@ -33,8 +33,9 @@ module.exports = (grunt) ->
installDir = grunt.config.get('atom.installDir')
shareDir = path.join(installDir, 'share', 'atom')
iconName = path.join(shareDir, 'resources', 'app', 'resources', 'atom.png')
executable = 'atom'
data = {name, version, description, installDir, iconName}
data = {name, version, description, installDir, iconName, executable}
specFilePath = fillTemplate(path.join('resources', 'linux', 'redhat', 'atom.spec'), data)
desktopFilePath = fillTemplate(path.join('resources', 'linux', 'atom.desktop'), data)
+1 -1
Ver Arquivo
@@ -10,7 +10,7 @@ module.exports = (grunt) ->
fullPath = path.join(relativePath, fileName)
else
fullPath = fileName
longPaths.push(fullPath) if fullPath.length >= 200
longPaths.push(fullPath) if fullPath.length >= 175
longPaths.sort (longPath1, longPath2) -> longPath2.length - longPath1.length
+31 -2
Ver Arquivo
@@ -8,14 +8,35 @@ module.exports = (grunt) ->
prebuiltConfigurations = [
['atom-dark-ui', 'atom-dark-syntax']
['atom-dark-ui', 'atom-light-syntax']
['atom-dark-ui', 'one-dark-syntax']
['atom-dark-ui', 'one-light-syntax']
['atom-dark-ui', 'solarized-dark-syntax']
['atom-dark-ui', 'base16-tomorrow-dark-theme']
['atom-dark-ui', 'base16-tomorrow-light-theme']
['atom-light-ui', 'atom-light-syntax']
['atom-light-ui', 'atom-dark-syntax']
['atom-light-ui', 'one-dark-syntax']
['atom-light-ui', 'one-light-syntax']
['atom-light-ui', 'solarized-dark-syntax']
['atom-light-ui', 'base16-tomorrow-dark-theme']
['atom-light-ui', 'base16-tomorrow-light-theme']
['one-dark-ui', 'one-dark-syntax']
['one-dark-ui', 'one-light-syntax']
['one-dark-ui', 'atom-dark-syntax']
['one-dark-ui', 'atom-light-syntax']
['one-dark-ui', 'solarized-dark-syntax']
['one-dark-ui', 'base16-tomorrow-dark-theme']
['one-dark-ui', 'base16-tomorrow-light-theme']
['one-light-ui', 'one-light-syntax']
['one-light-ui', 'one-dark-syntax']
['one-light-ui', 'atom-light-syntax']
['one-light-ui', 'atom-dark-syntax']
['one-light-ui', 'solarized-dark-syntax']
['one-light-ui', 'base16-tomorrow-dark-theme']
['one-light-ui', 'base16-tomorrow-light-theme']
]
directory = path.join(grunt.config.get('atom.appDir'), 'less-compile-cache')
@@ -42,10 +63,18 @@ module.exports = (grunt) ->
resourcePath: path.resolve('.')
importPaths: importPaths
cssForFile = (file) ->
baseVarImports = """
@import "variables/ui-variables";
@import "variables/syntax-variables";
"""
less = fs.readFileSync(file, 'utf8')
lessCache.cssForFile(file, [baseVarImports, less].join('\n'))
for file in @filesSrc
grunt.verbose.writeln("File #{file.cyan} created in cache.")
lessCache.readFileSync(file)
cssForFile(file)
for file in themeMains
grunt.verbose.writeln("File #{file.cyan} created in cache.")
lessCache.readFileSync(file)
cssForFile(file)
+1 -1
Ver Arquivo
@@ -68,7 +68,7 @@ getAssets = ->
]
when 'win32'
assets = [{assetName: 'atom-windows.zip', sourcePath: 'Atom'}]
for squirrelAsset in ['AtomSetup.exe', 'RELEASES', "atom-#{version}-full.nupkg"]
for squirrelAsset in ['AtomSetup.exe', 'RELEASES', "atom-#{version}-full.nupkg", "atom-#{version}-delta.nupkg"]
cp path.join(buildDir, 'installer', squirrelAsset), path.join(buildDir, squirrelAsset)
assets.push({assetName: squirrelAsset, sourcePath: assetName})
assets
+31 -9
Ver Arquivo
@@ -49,19 +49,17 @@ can be expressed as keystroke patterns separated by spaces.
Commands are custom DOM events that are triggered when a keystroke matches a
binding. This allows user interface code to listen for named commands without
specifying the specific keybinding that triggers it. For example, the following
code sets up {EditorView} to listen for commands to move the cursor to the first
character of the current line:
code creates a command to insert the current date in an editor:
```coffee
class EditorView
listenForEvents: ->
@command 'editor:move-to-first-character-of-line', =>
@editor.moveToFirstCharacterOfLine()
atom.commands.add 'atom-text-editor',
'user:insert-date': (event) ->
editor = @getModel()
editor.insertText(new Date().toLocaleString())
```
The `::command` method is basically an enhanced version of jQuery's `::on`
method that listens for a custom DOM event and adds some metadata to the DOM,
which is read by the command palette.
`atom.commands` refers to the global {CommandRegistry} instance where all commands
are set and consequently picked up by the command palette.
When you are looking to bind new keys, it is often useful to use the command
palette (`ctrl-shift-p`) to discover what commands are being listened for in a
@@ -69,6 +67,30 @@ given focus context. Commands are "humanized" following a simple algorithm, so a
command like `editor:fold-current-row` would appear as "Editor: Fold Current
Row".
### "Composed" Commands
A common question is, "How do I make a single keybinding execute two or more
commands?" There isn't any direct support for this in Atom, but it can be
achieved by creating a custom command that performs the multiple actions
you desire and then creating a keybinding for that command. For example, let's
say I want to create a "composed" command that performs a Select Line followed
by Cut. You could add the following to your `init.coffee`:
```coffee
atom.commands.add 'atom-text-editor', 'custom:cut-line', ->
editor = atom.workspace.getActiveTextEditor()
editor.selectLinesContainingCursors()
editor.cutSelectedText()
```
Then let's say we want to map this custom command to `alt-ctrl-z`, you could
add the following to your keymap:
```coffee
'atom-text-editor':
'alt-ctrl-z': 'custom:cut-line'
```
### Specificity and Cascade Order
As is the case with CSS applying styles, when multiple bindings match for a
+1 -1
Ver Arquivo
@@ -8,7 +8,7 @@ Ubuntu LTS 12.04 64-bit is the recommended platform.
* C++ toolchain
* [Git](http://git-scm.com/)
* [Node.js](http://nodejs.org/download/) v0.10.x
* [npm](http://www.npmjs.org/) v1.4.x (bundled with Node.js)
* [npm](https://www.npmjs.com/) v1.4.x (bundled with Node.js)
* `npm -v` to check the version.
* `npm config set python /usr/bin/python2 -g` to ensure that gyp uses python2.
* You might need to run this command as `sudo`, depending on how you have set up [npm](https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os).
+2 -2
Ver Arquivo
@@ -9,7 +9,7 @@
* For 64-bit builds of node and native modules you **must** have the
[Windows 7 64-bit SDK](http://www.microsoft.com/en-us/download/details.aspx?id=8279).
You may also need the [compiler update for the Windows SDK 7.1](http://www.microsoft.com/en-us/download/details.aspx?id=4422)
* [Python](http://www.python.org/download/) v2.7.
* [Python](https://www.python.org/downloads/) v2.7.
* The python.exe must be available at `%SystemDrive%\Python27\python.exe`.
If it is installed elsewhere, you can create a symbolic link to the
directory containing the python.exe using:
@@ -19,7 +19,7 @@
### On Windows 8
* [Visual Studio Express 2013 for Windows Desktop](http://www.visualstudio.com/en-us/downloads/download-visual-studio-vs#DownloadFamilies_2)
* [node.js](http://nodejs.org/download/) v0.10.x
* [Python](http://www.python.org/download/) v2.7.x (required by [node-gyp](https://github.com/TooTallNate/node-gyp))
* [Python](https://www.python.org/downloads/) v2.7.x (required by [node-gyp](https://github.com/TooTallNate/node-gyp))
* [GitHub for Windows](http://windows.github.com/)
## Instructions
+4 -4
Ver Arquivo
@@ -44,9 +44,9 @@ the editor to see it in action!
on publishing the package you just created to [atom.io][atomio].
[atomio]: https://atom.io
[CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
[LESS]: http://lesscss.org
[plist]: http://en.wikipedia.org/wiki/Property_list
[R]: http://en.wikipedia.org/wiki/R_(programming_language)
[CSS]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets
[Less]: http://lesscss.org
[plist]: https://en.wikipedia.org/wiki/Property_list
[R]: https://en.wikipedia.org/wiki/R_(programming_language)
[TextMate]: http://macromates.com
[TextMateOrg]: https://github.com/textmate
+4 -4
Ver Arquivo
@@ -6,7 +6,7 @@ theme.
### Differences
TextMate themes use [plist][plist] files while Atom themes use [CSS][CSS] or
[LESS][LESS] to style the UI and syntax in the editor.
[Less][Less] to style the UI and syntax in the editor.
The utility that converts the theme first parses the theme's plist file and
then creates comparable CSS rules and properties that will style Atom similarly.
@@ -61,8 +61,8 @@ __Syntax Theme__ dropdown menu to enable your new theme.
on publishing the theme you just created to [atom.io][atomio].
[atomio]: https://atom.io
[CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
[LESS]: http://lesscss.org
[plist]: http://en.wikipedia.org/wiki/Property_list
[CSS]: https://en.wikipedia.org/wiki/Cascading_Style_Sheets
[Less]: http://lesscss.org
[plist]: https://en.wikipedia.org/wiki/Property_list
[TextMate]: http://macromates.com
[TextMateThemes]: http://wiki.macromates.com/Themes/UserSubmittedThemes
+104 -15
Ver Arquivo
@@ -51,9 +51,24 @@ in the _menus_ directory are added alphabetically.
- `snippets` (**Optional**): an Array of Strings identifying the order of the
snippets your package needs to load. If not specified, snippets in the
_snippets_ directory are added alphabetically.
- `activationEvents` (**Optional**): an Array of Strings identifying events that
- `activationCommands` (**Optional**): an Array of Strings identifying commands that
trigger your package's activation. You can delay the loading of your package
until one of these events is triggered.
- `providedServices` (**Optional**): an Object describing the services that your
package provides, which can be used by other packages. The keys of this object
are the names of the services, and the values are Objects with the following
keys:
- `description` (**Optional**) a String describing the service
- `versions` (**Required**) an Object whose keys are Semver version strings,
and whose values are names of methods in your package's top-level module
that return a value implementing the service.
- `consumedServices` (**Optional**): an Object describing the services that your
package uses, which can be provided by other packages. The keys of this object
are the names of the services, and the values are Objects with the following
keys:
- `versions` (**Required**) an Object whose keys are Semver version ranges
and whose values are names of methods in your package's top-level module
that are called with values implementing the service.
## Source Code
@@ -83,9 +98,9 @@ module's `activate` method so you can restore your view to where the user left
off.
- `deactivate()`: This **optional** method is called when the window is shutting
down. If your package is watching any files or holding external resources in any
other way, release them here. If you're just subscribing to things on window,
you don't need to worry because that's getting torn down anyway.
down, or when your package is being updated or disabled. If your package is
watching any files, holding external resources, providing commands or subscribing
to events, release them here.
### Simple Package Code
@@ -112,19 +127,18 @@ module.exports =
serialize: -> # ...
```
Beyond this simple contract, your package has access to Atom's API. Be aware
that since we are early in development, APIs are subject to change and we have
not yet established clear boundaries between what is public and what is private.
Also, please collaborate with us if you need an API that doesn't exist. Our goal
is to build out Atom's API organically based on the needs of package authors
like you.
Beyond this simple contract, your package has access to [Atom's API][api]. Be aware
that the Atom 1.0 API is mostly frozen. Refer to the API documentation for what
is public. That said, please collaborate with us if you need an API that doesn't
exist. Our goal is to build out Atom's API organically based on the needs of
package authors like you.
## Style Sheets
Style sheets for your package should be placed in the _styles_ directory.
Any style sheets in this directory will be loaded and attached to the DOM when
your package is activated. Style sheets can be written as CSS or [LESS], but
LESS is recommended.
your package is activated. Style sheets can be written as CSS or [Less], but
Less is recommended.
Ideally, you won't need much in the way of styling. We've provided a standard
set of components which define both the colors and UI elements for any package
@@ -352,6 +366,79 @@ to indicate the type your value should be, its default, etc.
See the [Config API Docs](https://atom.io/docs/api/latest/Config) for more
details specifying your configuration.
## Interacting With Other Packages Via Services
Atom packages can interact with each other through versioned APIs called
*services*. To provide a service, in your `package.json`, specify one or more
version numbers, each paired with the name of a method on your package's main module:
```json
{
"providedServices": {
"my-service": {
"description": "Does a useful thing",
"versions": {
"1.2.3": "provideMyServiceV1",
"2.3.4": "provideMyServiceV2",
}
}
}
}
```
In your package's main module, implement the methods named above. These methods
will be called any time a package is activated that consumes their corresponding
service. They should return a value that implements the service's API.
```coffeescript
module.exports =
activate: -> # ...
provideMyServiceV1: ->
adaptToLegacyAPI(myService)
provideMyServiceV2: ->
myService
```
Similarly, to consume a service, specify one or more [version *ranges*][version-ranges],
each paired with the name of a method on the package's main module:
```json
{
"consumedServices": {
"another-service": {
"versions": {
"^1.2.3": "consumeAnotherServiceV1",
">=2.3.4 <2.5": "consumeAnotherServiceV2",
}
}
}
}
```
These methods will be called any time a package is activated that *provides* their
corresponding service. They will receive the service object as an argument. You
will usually need to perform some kind of cleanup in the event that the package
providing the service is deactivated. To do this, return a `Disposable` from
your service-consuming method:
```coffeescript
{Disposable} = require 'atom'
module.exports =
activate: -> # ...
consumeAnotherServiceV1: (service) ->
useService(adaptServiceFromLegacyAPI(service))
new Disposable -> stopUsingService(service)
consumeAnotherServiceV2: (service) ->
useService(service)
new Disposable -> stopUsingService(service)
```
## Bundle External Resources
It's common to ship external resources like images and fonts in the package, to
@@ -402,11 +489,12 @@ registry.
Run `apm help publish` to see all the available options and `apm help` to see
all the other available commands.
[api]: https://atom.io/docs/api/latest
[file-tree]: https://github.com/atom/tree-view
[status-bar]: https://github.com/atom/status-bar
[cs-syntax]: https://github.com/atom/language-coffee-script
[npm]: http://en.wikipedia.org/wiki/Npm_(software)
[npm-keys]: https://npmjs.org/doc/json.html
[npm]: https://en.wikipedia.org/wiki/Npm_(software)
[npm-keys]: https://docs.npmjs.com/files/package.json
[git-tag]: http://git-scm.com/book/en/Git-Basics-Tagging
[wrap-guide]: https://github.com/atom/wrap-guide/
[keymaps]: advanced/keymaps.md
@@ -418,9 +506,10 @@ all the other available commands.
[underscore]: http://underscorejs.org/
[jasmine]: http://jasmine.github.io
[cson]: https://github.com/atom/season
[LESS]: http://lesscss.org
[Less]: http://lesscss.org
[ui-variables]: https://github.com/atom/atom-dark-ui/blob/master/styles/ui-variables.less
[first-package]: your-first-package.html
[convert-bundle]: converting-a-text-mate-bundle.html
[convert-theme]: converting-a-text-mate-theme.html
[json-schema]: http://json-schema.org/
[version-ranges]: https://docs.npmjs.com/misc/semver#ranges
+10 -9
Ver Arquivo
@@ -1,7 +1,7 @@
# Creating a Theme
Atom's interface is rendered using HTML, and it's styled via [LESS] which is a
superset of CSS. Don't worry if you haven't heard of LESS before; it's just like
Atom's interface is rendered using HTML, and it's styled via [Less] which is a
superset of CSS. Don't worry if you haven't heard of Less before; it's just like
CSS, but with a few handy extensions.
Atom supports two types of themes: _UI_ and _syntax_. UI themes style
@@ -9,22 +9,23 @@ elements such as the tree view, the tabs, drop-down lists, and the status bar.
Syntax themes style the code inside the editor.
Themes can be installed and changed from the settings view which you can open
by selecting the _Atom > Preferences..._ menu and navigating to the _Themes_
section on the left hand side.
by selecting the _Atom > Preferences..._ menu and navigating to the _Install_
section and the _Themes_ section on the left hand side.
## Getting Started
Themes are pretty straightforward but it's still helpful to be familiar with
a few things before starting:
* LESS is a superset of CSS, but it has some really handy features like
* Less is a superset of CSS, but it has some really handy features like
variables. If you aren't familiar with its syntax, take a few minutes
to [familiarize yourself][less-tutorial].
* You may also want to review the concept of a _[package.json]_, too. This file
is used to help distribute your theme to Atom users.
* Your theme's _package.json_ must contain a `"theme"` key with a value
of `"ui"` or `"syntax"` for Atom to recognize and load it as a theme.
* You can find existing themes to install or fork on [atom.io](atomio).
* You can find existing themes to install or fork on
[atom.io][atomio-themes].
## Creating a Syntax Theme
@@ -130,13 +131,13 @@ _styleguide_, or use the shortcut `cmd-ctrl-shift-g`.
![styleguide-img]
[atomio]: http://atom.io/packages
[LESS]: http://lesscss.org/
[atomio-themes]: https://atom.io/themes
[Less]: http://lesscss.org/
[git]: http://git-scm.com/
[atom]: https://atom.io/
[package.json]: ./creating-a-package.html#package-json
[less-tutorial]: https://speakerdeck.com/danmatthews/less-css
[devtools-tutorial]: https://developers.google.com/chrome-developer-tools/docs/elements
[devtools-tutorial]: https://developer.chrome.com/devtools/docs/dom-and-styles
[ui-variables]: ./theme-variables.html
[livereload]: https://github.com/atom/dev-live-reload
[styleguide]: https://github.com/atom/styleguide
+11 -3
Ver Arquivo
@@ -100,6 +100,14 @@ namespaces: `core` and `editor`.
You can open this file in an editor from the _Atom > Open Your Config_ menu.
### Custom Configuration Location
You can override the location that Atom stores configuration files and folders
in by setting the `ATOM_HOME` environment variable. The `ATOM_HOME` path will be
used instead of `~/.atom` when it is set.
This option can be useful when you want to make Atom portable across machines.
### Configuration Key Reference
- `core`
@@ -169,17 +177,17 @@ For example, to change the color of the cursor, you could add the following
rule to your _~/.atom/styles.less_ file:
```less
atom-text-editor.is-focused .cursor {
atom-text-editor::shadow .cursor {
border-color: pink;
}
```
Unfamiliar with LESS? Read more about it [here][LESS].
Unfamiliar with Less? Read more about it [here][Less].
This file can also be named _styles.css_ and contain CSS.
[creating-a-package]: creating-a-package.md
[create-theme]: creating-a-theme.md
[LESS]: http://www.lesscss.org
[Less]: http://www.lesscss.org
[CSON]: https://github.com/atom/season
[CoffeeScript]: http://coffeescript.org/
+15
Ver Arquivo
@@ -100,6 +100,21 @@ When an error is thrown in Atom, the developer tools are automatically shown wit
If you can reproduce the error, use this approach to get the full stack trace. The stack trace might point to a problem in your [Init script][init script or stylesheet] or a specific package you installed, which you can then disable and report an issue on its GitHub repository.
## Check that you have a build toolchain installed
If you are having issues installing a package using `apm install`, this could be
because the package has dependencies on libraries that contain native code
and so you will need to have a C++ compiler and Python installed to be able to
install it.
You can run `apm install --check` to see if [apm][apm] can build native code on
your machine.
Check out the pre-requisites in the [build instructions][build-instructions] for
your platform for more details.
[apm]: https://github.com/atom/apm
[build-instructions]: https://github.com/atom/atom/tree/master/docs/build-instructions
[submitting issues]: https://github.com/atom/atom/blob/master/CONTRIBUTING.md#submitting-issues
[building atom]: https://github.com/atom/atom#building
[atom releases]: https://github.com/atom/atom/releases
+1 -1
Ver Arquivo
@@ -34,7 +34,7 @@ files. If you are using Git you can use `cmd-shift-b` to search the list of
files modified and untracked in your project's repository.
You can also use the tree view to navigate to a file. To open and focus the
the tree view, press `ctrl-0`. The tree view can be toggled open and closed with
tree view, press `ctrl-0`. The tree view can be toggled open and closed with
`cmd-\`.
#### Adding, Moving, Deleting Files
+3
Ver Arquivo
@@ -11,6 +11,7 @@
* [Contributing](contributing.md)
* [Contributing to Core Packages](contributing-to-packages.md)
* [Debugging](debugging.md)
* [Your First Package](your-first-package.md)
### Advanced Topics
@@ -19,6 +20,8 @@
* [Keymaps](advanced/keymaps.md)
* [Serialization](advanced/serialization.md)
* [Scopes and Scope Descriptors](advanced/scopes-and-scope-descriptors.md)
* [Theme Variables](theme-variables.md)
* [apm REST API](apm-rest-api.md)
### Upgrading to 1.0 APIs
+3 -3
Ver Arquivo
@@ -47,7 +47,7 @@ If not, there are a few things you should check before publishing:
Before you publish a package it is a good idea to check ahead of time if
a package with the same name has already been published to atom.io. You can do
that by visiting `http://atom.io/packages/my-package` to see if the package
that by visiting `https://atom.io/packages/my-package` to see if the package
already exists. If it does, update your package's name to something that is
available before proceeding.
@@ -73,7 +73,7 @@ and you only need to enter this information the first time you publish. The
credentials are stored securely in your [keychain][keychain] once you login.
:tada: Your package is now published and available on atom.io. Head on over to
`http://atom.io/packages/my-package` to see your package's page.
`https://atom.io/packages/my-package` to see your package's page.
With `apm publish`, you can bump the version and publish by using
```sh
@@ -107,7 +107,7 @@ Use `patch` when you make a small change like a bug fix that does not add or rem
[atomio]: https://atom.io
[github]: https://github.com
[git-tag]: http://git-scm.com/book/en/Git-Basics-Tagging
[keychain]: http://en.wikipedia.org/wiki/Keychain_(Apple)
[keychain]: https://en.wikipedia.org/wiki/Keychain_(Apple)
[repo-guide]: http://guides.github.com/overviews/desktop
[semver]: http://semver.org
[your-first-package]: your-first-package.html
+1 -1
Ver Arquivo
@@ -24,7 +24,7 @@ Here's an example `.less` file that a package can define using theme variables:
```css
@import "ui-variables";
.my-selector{
.my-selector {
background-color: @base-background-color;
padding: @component-padding;
}
+1 -1
Ver Arquivo
@@ -63,7 +63,7 @@ When you are deprecation free and all done converting, upgrade the `engines` fie
```json
{
"engines": {
"atom": ">=0.x.0, <2.0.0"
"atom": ">=0.174.0 <2.0.0"
}
}
```
+2 -5
Ver Arquivo
@@ -6,19 +6,16 @@ Syntax themes are specifically intended to style only text editor content, so th
When theme style sheets are loaded into the text editor's shadow DOM, selectors intended to target the editor from the *outside* no longer make sense. Styles targeting the `.editor` and `.editor-colors` classes instead need to target the `:host` pseudo-element, which matches against the containing `atom-text-editor` node. Check out the [Shadow DOM 201][host-pseudo-element] article for more information about the `:host` pseudo-element.
Here's an example from Atom's light syntax theme. Note that the previous selectors intended to target the editor from the outside have been retained to allow the theme to keep working during the transition phase when it is possible to disable the shadow DOM.
Here's an example from Atom's light syntax theme. Note that the `atom-text-editor` selector intended to target the editor from the outside has been retained to allow the theme to keep working during the transition phase when it is possible to disable the shadow DOM.
```css
.editor-colors, :host { /* :host added */
atom-text-editor, :host { /* :host added */
background-color: @syntax-background-color;
color: @syntax-text-color;
}
.editor, :host { /* :host added */
.invisible-character {
color: @syntax-invisible-character-color;
}
/* more nested selectors... */
}
```
+2 -2
Ver Arquivo
@@ -1,6 +1,6 @@
# Writing specs
Atom uses [Jasmine](http://jasmine.github.io/2.0/introduction.html) as its spec framework. Any new functionality should have specs to guard against regressions.
Atom uses [Jasmine](http://jasmine.github.io/1.3/introduction.html) as its spec framework. Any new functionality should have specs to guard against regressions.
## Create a new spec
@@ -12,7 +12,7 @@ Atom uses [Jasmine](http://jasmine.github.io/2.0/introduction.html) as its spec
0. Add one or more `describe` methods
The `describe` method takes two arguments, a description and a function. If the description explains a behavior it typically begins with `when` if it is more like a unit test it begins with the method name.
The `describe` method takes two arguments, a description and a function. If the description explains a behavior it typically begins with `when`; if it is more like a unit test it begins with the method name.
```coffee
describe "when a test is written", ->
+8 -8
Ver Arquivo
@@ -1,7 +1,7 @@
# Create Your First Package
This tutorial will guide you though creating a simple command that replaces the
selected text with [ascii art](http://en.wikipedia.org/wiki/ASCII_art). When you
selected text with [ascii art](https://en.wikipedia.org/wiki/ASCII_art). When you
run our new command with the word "cool" selected, it will be replaced with:
```
@@ -72,12 +72,12 @@ command palette or by pressing `ctrl-alt-cmd-l`.
Now open the command panel and search for the `ascii-art:convert` command. But
it's not there! To fix this, open _package.json_ and find the property called
`activationEvents`. Activation Events speed up load time by allowing Atom to
`activationCommands`. Activation Events speed up load time by allowing Atom to
delay a package's activation until it's needed. So remove the existing command
and add `ascii-art:convert` to the `activationEvents` array:
and add `ascii-art:convert` to the `activationCommands` array:
```json
"activationEvents": ["ascii-art:convert"],
"activationCommands": ["ascii-art:convert"],
```
First, reload the window by running the command `window:reload`. Now when you
@@ -88,17 +88,17 @@ run the `ascii-art:convert` command it will output 'Hello, World!'
Now let's add a key binding to trigger the `ascii-art:convert` command. Open
_keymaps/ascii-art.cson_ and add a key binding linking `ctrl-alt-a` to the
`ascii-art:convert` command. You can delete the pre-existing key binding since
you don't need it anymore. When finished, the file will look like this:
you don't need it anymore. When finished, the file will have this:
```coffeescript
'atom-text-editor':
'cmd-alt-a': 'ascii-art:convert'
'ctrl-alt-a': 'ascii-art:convert'
```
Notice `atom-text-editor` on the first line. Just like CSS, keymap selectors
*scope* key bindings so they only apply to specific elements. In this case, our
binding is only active for elements matching the `atom-text-editor` selector. If
the Tree View has focus, pressing `cmd-alt-a` won't trigger the
the Tree View has focus, pressing `ctrl-alt-a` won't trigger the
`ascii-art:convert` command. But if the editor has focus, the
`ascii-art:convert` method *will* be triggered. More information on key bindings
can be found in the [keymaps](advanced/keymaps.html) documentation.
@@ -142,7 +142,7 @@ convert: ->
selection.insertText("\n#{asciiArt}\n")
```
Select some text in an editor window and hit `cmd-alt-a`. :tada: You're now an
Select some text in an editor window and hit `ctrl-alt-a`. :tada: You're now an
ASCII art professional!
## Further reading
+58 -52
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.174.0",
"version": "0.178.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@@ -17,10 +17,11 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.20.5",
"atomShellVersion": "0.21.0",
"dependencies": {
"6to5-core": "^3.0.14",
"async": "0.2.6",
"atom-keymap": "^2.5.2",
"atom-keymap": "^3.1.0",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.8.0",
@@ -28,42 +29,42 @@
"color": "^0.7.3",
"delegato": "^1",
"emissary": "^1.3.1",
"event-kit": "^1.0.1",
"first-mate": "^2.2.4",
"fs-plus": "^2.3.2",
"event-kit": "^1.0.2",
"first-mate": "^3.0.0",
"fs-plus": "^2.5",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^2.2",
"git-utils": "^3.0.0",
"grim": "1.1.0",
"guid": "0.0.10",
"jasmine-json": "~0.0",
"jasmine-tagged": "^1.1.2",
"jquery": "^2.1.1",
"less-cache": "0.19.0",
"less-cache": "0.21",
"marked": "^0.3",
"mixto": "^1",
"mkdirp": "0.3.5",
"nslog": "^1.0.1",
"oniguruma": "^3.0.4",
"nslog": "^2.0.0",
"oniguruma": "^4.0.0",
"optimist": "0.4.0",
"pathwatcher": "^2.6.0",
"pathwatcher": "^3.1.0",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
"react-atom-fork": "^0.11.4",
"react-atom-fork": "^0.11.5",
"reactionary-atom-fork": "^1.0.0",
"runas": "1.0.1",
"scandal": "1.0.3",
"runas": "2.0.0",
"scandal": "2.0.0",
"scoped-property-store": "^0.16.2",
"scrollbar-style": "^1.0.2",
"season": "^5.0.5",
"scrollbar-style": "^2.0.0",
"season": "^5.1.2",
"semver": "2.2.1",
"serializable": "^1",
"service-hub": "^0.1.0",
"service-hub": "^0.2.0",
"space-pen": "3.8.2",
"stacktrace-parser": "0.1.1",
"temp": "0.7.0",
"text-buffer": "^3.10.0",
"text-buffer": "^4.0.0",
"theorist": "^1.0.2",
"underscore-plus": "^1.6.6",
"vm-compatibility-layer": "0.1.0"
@@ -75,60 +76,65 @@
"atom-light-ui": "0.40.0",
"base16-tomorrow-dark-theme": "0.25.0",
"base16-tomorrow-light-theme": "0.8.0",
"one-dark-ui": "0.3.0",
"one-dark-syntax": "0.3.0",
"one-light-syntax": "0.3.0",
"one-light-ui": "0.2.0",
"solarized-dark-syntax": "0.32.0",
"solarized-light-syntax": "0.19.0",
"archive-view": "0.44.0",
"autocomplete": "0.43.0",
"archive-view": "0.46.0",
"autocomplete": "0.44.0",
"autoflow": "0.21.0",
"autosave": "0.20.0",
"background-tips": "0.21.0",
"background-tips": "0.22.0",
"bookmarks": "0.35.0",
"bracket-matcher": "0.69.0",
"bracket-matcher": "0.71.0",
"command-palette": "0.34.0",
"deprecation-cop": "0.32.0",
"dev-live-reload": "0.38.0",
"encoding-selector": "0.15.0",
"deprecation-cop": "0.34.0",
"dev-live-reload": "0.41.0",
"encoding-selector": "0.17.0",
"exception-reporting": "0.21.0",
"find-and-replace": "0.156.0",
"fuzzy-finder": "0.65.0",
"git-diff": "0.49.0",
"git-diff": "0.50.0",
"go-to-line": "0.30.0",
"grammar-selector": "0.43.0",
"image-view": "0.47.0",
"incompatible-packages": "0.20.0",
"keybinding-resolver": "0.26.0",
"link": "0.29.0",
"markdown-preview": "0.120.0",
"metrics": "0.40.0",
"notifications": "0.25.0",
"grammar-selector": "0.44.0",
"image-view": "0.48.0",
"incompatible-packages": "0.21.0",
"keybinding-resolver": "0.27.0",
"link": "0.30.0",
"markdown-preview": "0.134.0",
"metrics": "0.42.0",
"notifications": "0.26.0",
"open-on-github": "0.32.0",
"package-generator": "0.37.0",
"release-notes": "0.46.0",
"settings-view": "0.173.0",
"snippets": "0.69.0",
"spell-check": "0.51.0",
"release-notes": "0.47.0",
"settings-view": "0.174.0",
"snippets": "0.72.0",
"spell-check": "0.54.0",
"status-bar": "0.57.0",
"styleguide": "0.42.0",
"symbols-view": "0.79.0",
"styleguide": "0.43.0",
"symbols-view": "0.81.0",
"tabs": "0.64.0",
"timecop": "0.27.0",
"tree-view": "0.148.0",
"update-package-dependencies": "0.7.0",
"timecop": "0.29.0",
"tree-view": "0.154.0",
"update-package-dependencies": "0.8.0",
"welcome": "0.21.0",
"whitespace": "0.28.0",
"wrap-guide": "0.30.0",
"language-c": "0.37.0",
"wrap-guide": "0.31.0",
"language-c": "0.38.0",
"language-clojure": "0.10.0",
"language-coffee-script": "0.39.0",
"language-css": "0.26.0",
"language-gfm": "0.62.0",
"language-csharp": "0.5.0",
"language-css": "0.27.0",
"language-gfm": "0.63.0",
"language-git": "0.10.0",
"language-go": "0.21.0",
"language-html": "0.28.0",
"language-hyperlink": "0.12.2",
"language-java": "0.14.0",
"language-javascript": "0.54.0",
"language-json": "0.11.0",
"language-javascript": "0.56.0",
"language-json": "0.12.0",
"language-less": "0.24.0",
"language-make": "0.13.0",
"language-mustache": "0.11.0",
@@ -142,11 +148,11 @@
"language-sass": "0.31.0",
"language-shellscript": "0.12.0",
"language-source": "0.9.0",
"language-sql": "0.13.0",
"language-sql": "0.14.0",
"language-text": "0.6.0",
"language-todo": "0.15.0",
"language-todo": "0.16.0",
"language-toml": "0.15.0",
"language-xml": "0.27.0",
"language-xml": "0.28.0",
"language-yaml": "0.22.0"
},
"private": true,
+1 -1
Ver Arquivo
@@ -2,7 +2,7 @@
Name=Atom
Comment=<%= description %>
GenericName=Text Editor
Exec=<%= installDir %>/share/atom/atom %U
Exec=<%= executable %> %U
Icon=<%= iconName %>
Type=Application
StartupNotify=true
Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 628 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 20 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 944 B

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 1.6 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 61 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 2.4 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 4.5 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 192 KiB

Arquivo binário não exibido.

Depois

Largura:  |  Altura:  |  Tamanho: 7.0 KiB

+14 -13
Ver Arquivo
@@ -1,26 +1,27 @@
Name: <%= name %>
Version: <%= version %>
Release: 0.1%{?dist}
Summary: Atom is a hackable text editor for the 21st century
Summary: <%= description %>
License: MIT
URL: https://atom.io/
AutoReqProv: no # Avoid libchromiumcontent.so missing dependency
Prefix: <%= installDir %>
%description
<%= description %>
%install
mkdir -p %{buildroot}/usr/local/share/atom
cp -r /tmp/atom-build/Atom/* %{buildroot}/usr/local/share/atom
mkdir -p %{buildroot}/usr/local/bin/
ln -sf /usr/local/share/atom/resources/app/apm/node_modules/.bin/apm %{buildroot}/usr/local/bin/apm
cp atom.sh %{buildroot}/usr/local/bin/atom
chmod 755 atom.sh
mkdir -p %{buildroot}/usr/local/share/applications/
mv atom.desktop %{buildroot}/usr/local/share/applications/
mkdir -p %{buildroot}/<%= installDir %>/share/atom/
cp -r Atom/* %{buildroot}/<%= installDir %>/share/atom/
mkdir -p %{buildroot}/<%= installDir %>/bin/
ln -sf ../share/atom/resources/app/apm/node_modules/.bin/apm %{buildroot}/<%= installDir %>/bin/apm
cp atom.sh %{buildroot}/<%= installDir %>/bin/atom
chmod 755 %{buildroot}/<%= installDir %>/bin/atom
mkdir -p %{buildroot}/<%= installDir %>/share/applications/
cp atom.desktop %{buildroot}/<%= installDir %>/share/applications/
%files
/usr/local/bin/atom
/usr/local/bin/apm
/usr/local/share/atom/
/usr/local/share/applications/atom.desktop
<%= installDir %>/bin/atom
<%= installDir %>/bin/apm
<%= installDir %>/share/atom/
<%= installDir %>/share/applications/atom.desktop
+1 -1
Ver Arquivo
@@ -1,3 +1,3 @@
#!/bin/sh
"$0/../../app/apm/node_modules/atom-package-manager/bin/node.exe" "$0/../../app/apm/node_modules/atom-package-manager/lib/cli.js" "$@"
"$0/../../app/apm/bin/node.exe" "$0/../../app/apm/lib/cli.js" "$@"
+1 -1
Ver Arquivo
@@ -18,5 +18,5 @@ FOR %%a IN (%*) DO (
IF "%EXPECT_OUTPUT%"=="YES" (
"%~dp0\..\..\atom.exe" %*
) ELSE (
"%~dp0\..\app\apm\node_modules\atom-package-manager\bin\node.exe" "%~dp0\atom.js" %*
"%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %*
)
+1 -1
Ver Arquivo
@@ -18,5 +18,5 @@ done
if [ $EXPECT_OUTPUT ]; then
"$0/../../../atom.exe" "$@"
else
"$0/../../app/apm/node_modules/atom-package-manager/bin/node.exe" "$0/../atom.js" "$@"
"$0/../../app/apm/bin/node.exe" "$0/../atom.js" "$@"
fi
+3 -3
Ver Arquivo
@@ -48,9 +48,9 @@ function bootstrap() {
var dedupeNpmCommand = npmPath + npmFlags + 'dedupe';
if (process.argv.indexOf('--no-quiet') === -1) {
buildInstallCommand += ' --quiet';
apmInstallCommand += ' --quiet';
moduleInstallCommand += ' --quiet';
buildInstallCommand += ' --loglevel error';
apmInstallCommand += ' --loglevel error';
moduleInstallCommand += ' --loglevel error';
dedupeApmCommand += ' --quiet';
dedupeNpmCommand += ' --quiet';
buildInstallOptions.ignoreStdout = true;
+1 -1
Ver Arquivo
@@ -11,7 +11,7 @@ ARCH=`uname -m`
rpmdev-setuptree
cp -r $BUILD_DIRECTORY/Atom/* $RPM_BUILD_ROOT/BUILD
cp -r $BUILD_DIRECTORY/Atom $RPM_BUILD_ROOT/BUILD
cp $SPEC_FILE $RPM_BUILD_ROOT/SPECS
cp ./atom.sh $RPM_BUILD_ROOT/BUILD
cp $DESKTOP_FILE $RPM_BUILD_ROOT/BUILD
+1 -1
Ver Arquivo
@@ -3,4 +3,4 @@
set -e
script/build
script/grunt mkrpm publish-build --stack
script/grunt mkrpm publish-build --stack --install-dir /usr
+41
Ver Arquivo
@@ -0,0 +1,41 @@
to5 = require '../src/6to5'
crypto = require 'crypto'
describe "6to5 transpiler support", ->
describe "::create6to5VersionAndOptionsDigest", ->
it "returns a digest for the library version and specified options", ->
defaultOptions =
blacklist: [
'useStrict'
]
experimental: true
optional: [
'asyncToGenerator'
]
reactCompat: true
sourceMap: 'inline'
version = '3.0.14'
shasum = crypto.createHash('sha1')
shasum.update('6to5-core', 'utf8')
shasum.update('\0', 'utf8')
shasum.update(version, 'utf8')
shasum.update('\0', 'utf8')
shasum.update('{"blacklist": ["useStrict",],"experimental": true,"optional": ["asyncToGenerator",],"reactCompat": true,"sourceMap": "inline",}')
expectedDigest = shasum.digest('hex')
observedDigest = to5.create6to5VersionAndOptionsDigest(version, defaultOptions)
expect(observedDigest).toEqual expectedDigest
describe "when a .js file starts with 'use 6to5';", ->
it "transpiles it using 6to5", ->
transpiled = require('./fixtures/6to5/single-quotes.js')
expect(transpiled(3)).toBe 4
describe 'when a .js file starts with "use 6to5";', ->
it "transpiles it using 6to5", ->
transpiled = require('./fixtures/6to5/double-quotes.js')
expect(transpiled(3)).toBe 4
describe "when a .js file does not start with 'use 6to6';", ->
it "does not transpile it using 6to5", ->
expect(-> require('./fixtures/6to5/invalid.js')).toThrow()
+1 -2
Ver Arquivo
@@ -47,9 +47,8 @@ describe "the `atom` global", ->
updateAvailableHandler.callCount > 0
runs ->
{releaseVersion, releaseNotes} = updateAvailableHandler.mostRecentCall.args[0]
{releaseVersion} = updateAvailableHandler.mostRecentCall.args[0]
expect(releaseVersion).toBe 'version'
expect(releaseNotes).toBe 'notes'
describe "loading default config", ->
it 'loads the default core config', ->
+39
Ver Arquivo
@@ -0,0 +1,39 @@
path = require 'path'
BufferedNodeProcess = require '../src/buffered-node-process'
describe "BufferedNodeProcess", ->
it "executes the script in a new process", ->
exit = jasmine.createSpy('exitCallback')
output = ''
stdout = (lines) -> output += lines
error = ''
stderr = (lines) -> error += lines
args = ['hi']
command = path.join(__dirname, 'fixtures', 'script.js')
new BufferedNodeProcess({command, args, stdout, stderr, exit})
waitsFor ->
exit.callCount is 1
runs ->
expect(output).toBe 'hi'
expect(error).toBe ''
expect(args).toEqual ['hi']
it "suppresses deprecations in the new process", ->
exit = jasmine.createSpy('exitCallback')
output = ''
stdout = (lines) -> output += lines
error = ''
stderr = (lines) -> error += lines
command = path.join(__dirname, 'fixtures', 'script-with-deprecations.js')
new BufferedNodeProcess({command, stdout, stderr, exit})
waitsFor ->
exit.callCount is 1
runs ->
expect(output).toBe 'hi'
expect(error).toBe ''
+138 -7
Ver Arquivo
@@ -226,14 +226,44 @@ describe "Config", ->
advanceClock(500)
expect(atom.config.save.callCount).toBe 1
describe "when a 'source' and no 'scopeSelector' is given", ->
it "removes all scoped settings with the given source", ->
atom.config.set("foo.bar.baz", 1, scopeSelector: ".a", source: "source-a")
atom.config.set("foo.bar.quux", 2, scopeSelector: ".b", source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a.b"])).toEqual(baz: 1, quux: 2)
describe "when no 'scopeSelector' is given", ->
describe "when a 'source' but no key-path is given", ->
it "removes all scoped settings with the given source", ->
atom.config.set("foo.bar.baz", 1, scopeSelector: ".a", source: "source-a")
atom.config.set("foo.bar.quux", 2, scopeSelector: ".b", source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a.b"])).toEqual(baz: 1, quux: 2)
atom.config.unset(null, source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a"])).toEqual(baz: 0, ok: 0)
atom.config.unset(null, source: "source-a")
expect(atom.config.get("foo.bar", scope: [".a"])).toEqual(baz: 0, ok: 0)
describe "when a 'source' and a key-path is given", ->
it "removes all scoped settings with the given source and key-path", ->
atom.config.set("foo.bar.baz", 1)
atom.config.set("foo.bar.baz", 2, scopeSelector: ".a", source: "source-a")
atom.config.set("foo.bar.baz", 3, scopeSelector: ".a.b", source: "source-b")
expect(atom.config.get("foo.bar.baz", scope: [".a.b"])).toEqual(3)
atom.config.unset("foo.bar.baz", source: "source-b")
expect(atom.config.get("foo.bar.baz", scope: [".a.b"])).toEqual(2)
expect(atom.config.get("foo.bar.baz")).toEqual(1)
describe "when no 'source' is given", ->
it "removes all scoped and unscoped properties for that key-path", ->
atom.config.setDefaults("foo.bar", baz: 100)
atom.config.set("foo.bar", { baz: 1, ok: 2 }, scopeSelector: ".a")
atom.config.set("foo.bar", { baz: 11, ok: 12 }, scopeSelector: ".b")
atom.config.set("foo.bar", { baz: 21, ok: 22 })
atom.config.unset("foo.bar.baz")
expect(atom.config.get("foo.bar.baz", scope: [".a"])).toBe 100
expect(atom.config.get("foo.bar.baz", scope: [".b"])).toBe 100
expect(atom.config.get("foo.bar.baz")).toBe 100
expect(atom.config.get("foo.bar.ok", scope: [".a"])).toBe 2
expect(atom.config.get("foo.bar.ok", scope: [".b"])).toBe 12
expect(atom.config.get("foo.bar.ok")).toBe 22
describe "when a 'scopeSelector' is given", ->
it "restores the global default when no scoped default set", ->
@@ -636,6 +666,23 @@ describe "Config", ->
foo:
bar: 'coffee'
describe "when an error is thrown writing the file to disk", ->
addErrorHandler = null
beforeEach ->
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
it "creates a notification", ->
jasmine.unspy CSON, 'writeFileSync'
spyOn(CSON, 'writeFileSync').andCallFake ->
error = new Error()
error.code = 'EPERM'
error.path = atom.config.getUserConfigPath()
throw error
save = -> atom.config.save()
expect(save).not.toThrow()
expect(addErrorHandler.callCount).toBe 1
describe ".loadUserConfig()", ->
beforeEach ->
expect(fs.existsSync(atom.config.configDirPath)).toBeFalsy()
@@ -669,6 +716,26 @@ describe "Config", ->
expect(atom.config.get("foo.bar")).toBe 'baz'
expect(atom.config.get("foo.bar", scope: ['.source.ruby'])).toBe 'more-specific'
describe "when the config file does not conform to the schema", ->
beforeEach ->
fs.writeFileSync atom.config.configFilePath, """
'*':
foo:
bar: 'omg'
int: 'baz'
'.source.ruby':
foo:
bar: 'scoped'
int: 'nope'
"""
it "validates and does not load the incorrect values", ->
atom.config.loadUserConfig()
expect(atom.config.get("foo.int")).toBe 12
expect(atom.config.get("foo.bar")).toBe 'omg'
expect(atom.config.get("foo.int", scope: ['.source.ruby'])).toBe 12
expect(atom.config.get("foo.bar", scope: ['.source.ruby'])).toBe 'scoped'
describe "when the config file contains valid cson", ->
beforeEach ->
fs.writeFileSync(atom.config.configFilePath, "foo: bar: 'baz'")
@@ -1076,6 +1143,62 @@ describe "Config", ->
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'omg'
expect(atom.config.get('foo.bar.str', scope: ['.source.coffee'])).toBe 'ok'
describe 'when a schema is added after config values have been set', ->
schema = null
beforeEach ->
schema =
type: 'object'
properties:
int:
type: 'integer'
default: 2
str:
type: 'string'
default: 'def'
it "respects the new schema when values are set", ->
expect(atom.config.set('foo.bar.str', 'global')).toBe true
expect(atom.config.set('foo.bar.str', 'scoped', scopeSelector: '.source.js')).toBe true
expect(atom.config.get('foo.bar.str')).toBe 'global'
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'scoped'
expect(atom.config.set('foo.bar.noschema', 'nsGlobal')).toBe true
expect(atom.config.set('foo.bar.noschema', 'nsScoped', scopeSelector: '.source.js')).toBe true
expect(atom.config.get('foo.bar.noschema')).toBe 'nsGlobal'
expect(atom.config.get('foo.bar.noschema', scope: ['.source.js'])).toBe 'nsScoped'
expect(atom.config.set('foo.bar.int', 'nope')).toBe true
expect(atom.config.set('foo.bar.int', 'notanint', scopeSelector: '.source.js')).toBe true
expect(atom.config.set('foo.bar.int', 23, scopeSelector: '.source.coffee')).toBe true
expect(atom.config.get('foo.bar.int')).toBe 'nope'
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 'notanint'
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
atom.config.setSchema('foo.bar', schema)
expect(atom.config.get('foo.bar.str')).toBe 'global'
expect(atom.config.get('foo.bar.str', scope: ['.source.js'])).toBe 'scoped'
expect(atom.config.get('foo.bar.noschema')).toBe 'nsGlobal'
expect(atom.config.get('foo.bar.noschema', scope: ['.source.js'])).toBe 'nsScoped'
expect(atom.config.get('foo.bar.int')).toBe 2
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 2
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
it "sets all values that adhere to the schema", ->
expect(atom.config.set('foo.bar.int', 10)).toBe true
expect(atom.config.set('foo.bar.int', 15, scopeSelector: '.source.js')).toBe true
expect(atom.config.set('foo.bar.int', 23, scopeSelector: '.source.coffee')).toBe true
expect(atom.config.get('foo.bar.int')).toBe 10
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 15
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
atom.config.setSchema('foo.bar', schema)
expect(atom.config.get('foo.bar.int')).toBe 10
expect(atom.config.get('foo.bar.int', scope: ['.source.js'])).toBe 15
expect(atom.config.get('foo.bar.int', scope: ['.source.coffee'])).toBe 23
describe 'when the value has an "integer" type', ->
beforeEach ->
schema =
@@ -1363,6 +1486,14 @@ describe "Config", ->
atom.config.set('foo.bar.aColor', false)
expect(atom.config.get('foo.bar.aColor')).toEqual {red: 255, green: 255, blue: 255, alpha: 1}
it "returns a clone of the Color when returned in a parent object", ->
color1 = atom.config.get('foo.bar').aColor
color2 = atom.config.get('foo.bar').aColor
expect(color1.toRGBAString()).toBe 'rgba(255, 255, 255, 1)'
expect(color2.toRGBAString()).toBe 'rgba(255, 255, 255, 1)'
expect(color1).not.toBe color2
expect(color1).toEqual color2
describe 'when the `enum` key is used', ->
beforeEach ->
schema =
+3
Ver Arquivo
@@ -0,0 +1,3 @@
"use 6to5";
module.exports = v => v + 1
+3
Ver Arquivo
@@ -0,0 +1,3 @@
'use 6to6';
module.exports = v => v + 1
+3
Ver Arquivo
@@ -0,0 +1,3 @@
'use 6to5';
module.exports = v => v + 1
@@ -0,0 +1,10 @@
module.exports =
activate: ->
deactivate: ->
consumeFirstServiceV3: ->
consumeFirstServiceV4: ->
consumeSecondService: ->
@@ -0,0 +1,17 @@
{
"name": "package-with-consumed-services",
"consumedServices": {
"service-1": {
"versions": {
">=0.2 <=0.3.6": "consumeFirstServiceV3",
"^0.4.1": "consumeFirstServiceV4"
}
},
"service-2": {
"versions": {
"0.2.1 || 0.2.2": "consumeSecondService"
}
}
}
}
@@ -0,0 +1,4 @@
{
"name": "package-with-invalid-styles",
"version": "1.0.0"
}
@@ -0,0 +1 @@
{
@@ -0,0 +1,13 @@
module.exports =
activate: ->
deactivate: ->
provideFirstServiceV3: ->
'first-service-v3'
provideFirstServiceV4: ->
'first-service-v4'
provideSecondService: ->
'second-service'
@@ -0,0 +1,19 @@
{
"name": "package-with-provided-services",
"providedServices": {
"service-1": {
"description": "The first service",
"versions": {
"0.3.1": "provideFirstServiceV3",
"0.4.1": "provideFirstServiceV4"
}
},
"service-2": {
"description": "The second service",
"versions": {
"0.2.1": "provideSecondService"
}
}
}
}
+2
Ver Arquivo
@@ -0,0 +1,2 @@
require('fs').existsSync('hi');
process.stdout.write('hi');
+1
Ver Arquivo
@@ -0,0 +1 @@
process.stdout.write(process.argv[2]);
+48
Ver Arquivo
@@ -1,5 +1,6 @@
{$, $$} = require '../src/space-pen-extensions'
Package = require '../src/package'
{Disposable} = require 'atom'
describe "PackageManager", ->
workspaceElement = null
@@ -22,6 +23,12 @@ describe "PackageManager", ->
expect(pack instanceof Package).toBe true
expect(pack.metadata.name).toBe "package-with-broken-keymap"
it "returns the package if it has an invalid stylesheet", ->
pack = atom.packages.loadPackage("package-with-invalid-styles")
expect(pack instanceof Package).toBe true
expect(pack.metadata.name).toBe "package-with-invalid-styles"
expect(pack.stylesheets.length).toBe 0
it "returns null if the package has an invalid package.json", ->
spyOn(console, 'warn')
expect(atom.packages.loadPackage("package-with-broken-package-json")).toBeNull()
@@ -445,6 +452,47 @@ describe "PackageManager", ->
runs ->
expect(atom.config.get 'editor.increaseIndentPattern', scope: ['.source.omg']).toBe '^a'
describe "service registration", ->
it "registers the package's provided and consumed services", ->
consumerModule = require "./fixtures/packages/package-with-consumed-services"
firstServiceV3Disposed = false
firstServiceV4Disposed = false
secondServiceDisposed = false
spyOn(consumerModule, 'consumeFirstServiceV3').andReturn(new Disposable -> firstServiceV3Disposed = true)
spyOn(consumerModule, 'consumeFirstServiceV4').andReturn(new Disposable -> firstServiceV4Disposed = true)
spyOn(consumerModule, 'consumeSecondService').andReturn(new Disposable -> secondServiceDisposed = true)
waitsForPromise ->
atom.packages.activatePackage("package-with-consumed-services")
waitsForPromise ->
atom.packages.activatePackage("package-with-provided-services")
runs ->
expect(consumerModule.consumeFirstServiceV3).toHaveBeenCalledWith('first-service-v3')
expect(consumerModule.consumeFirstServiceV4).toHaveBeenCalledWith('first-service-v4')
expect(consumerModule.consumeSecondService).toHaveBeenCalledWith('second-service')
consumerModule.consumeFirstServiceV3.reset()
consumerModule.consumeFirstServiceV4.reset()
consumerModule.consumeSecondService.reset()
atom.packages.deactivatePackage("package-with-provided-services")
expect(firstServiceV3Disposed).toBe true
expect(firstServiceV4Disposed).toBe true
expect(secondServiceDisposed).toBe true
atom.packages.deactivatePackage("package-with-consumed-services")
waitsForPromise ->
atom.packages.activatePackage("package-with-provided-services")
runs ->
expect(consumerModule.consumeFirstServiceV3).not.toHaveBeenCalled()
expect(consumerModule.consumeFirstServiceV4).not.toHaveBeenCalled()
expect(consumerModule.consumeSecondService).not.toHaveBeenCalled()
describe "::deactivatePackage(id)", ->
afterEach ->
atom.packages.unloadPackages()
+38
Ver Arquivo
@@ -383,6 +383,25 @@ describe "Pane", ->
pane.saveActiveItem()
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "when the item's saveAs method throws a well-known IO error", ->
notificationSpy = null
beforeEach ->
atom.notifications.onDidAddNotification notificationSpy = jasmine.createSpy()
it "creates a notification", ->
pane.getActiveItem().saveAs = ->
error = new Error("EACCES, permission denied '/foo'")
error.path = '/foo'
error.code = 'EACCES'
throw error
pane.saveActiveItem()
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Permission denied'
expect(notification.getMessage()).toContain '/foo'
describe "::saveActiveItemAs()", ->
pane = null
@@ -404,6 +423,25 @@ describe "Pane", ->
pane.saveActiveItemAs()
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "when the item's saveAs method throws a well-known IO error", ->
notificationSpy = null
beforeEach ->
atom.notifications.onDidAddNotification notificationSpy = jasmine.createSpy()
it "creates a notification", ->
pane.getActiveItem().saveAs = ->
error = new Error("EACCES, permission denied '/foo'")
error.path = '/foo'
error.code = 'EACCES'
throw error
pane.saveActiveItemAs()
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Permission denied'
expect(notification.getMessage()).toContain '/foo'
describe "::itemForURI(uri)", ->
it "returns the item for which a call to .getURI() returns the given uri", ->
pane = new Pane(items: [new Item("A"), new Item("B"), new Item("C"), new Item("D")])
+26
Ver Arquivo
@@ -37,6 +37,32 @@ describe "Project", ->
deserializedProject.getBuffers()[0].destroy()
expect(deserializedProject.getBuffers().length).toBe 0
it "does not deserialize buffers when their path is a directory that exists", ->
pathToOpen = path.join(temp.mkdirSync(), 'file.txt')
waitsForPromise ->
atom.project.open(pathToOpen)
runs ->
expect(atom.project.getBuffers().length).toBe 1
fs.mkdirSync(pathToOpen)
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
it "does not deserialize buffers when their path is inaccessible", ->
pathToOpen = path.join(temp.mkdirSync(), 'file.txt')
fs.writeFileSync(pathToOpen, '')
waitsForPromise ->
atom.project.open(pathToOpen)
runs ->
expect(atom.project.getBuffers().length).toBe 1
fs.chmodSync(pathToOpen, '000')
deserializedProject = atom.project.testSerialization()
expect(deserializedProject.getBuffers().length).toBe 0
describe "when an editor is saved and the project has no path", ->
it "sets the project's path to the saved file's parent directory", ->
tempFile = temp.openSync().path
+11 -4
Ver Arquivo
@@ -17,6 +17,7 @@ Config = require '../src/config'
{Point} = require 'text-buffer'
Project = require '../src/project'
Workspace = require '../src/workspace'
ServiceHub = require 'service-hub'
TextEditor = require '../src/text-editor'
TextEditorView = require '../src/text-editor-view'
TextEditorElement = require '../src/text-editor-element'
@@ -77,6 +78,7 @@ beforeEach ->
projectPath = specProjectPath ? path.join(@specDirectory, 'fixtures')
atom.project = new Project(paths: [projectPath])
atom.workspace = new Workspace()
atom.packages.serviceHub = new ServiceHub
atom.keymaps.keyBindings = _.clone(keyBindingsToRestore)
atom.commands.restoreSnapshot(commandsToRestore)
atom.styles.restoreSnapshot(styleElementsToRestore)
@@ -213,6 +215,11 @@ jasmine.snapshotDeprecations = ->
jasmine.restoreDeprecationsSnapshot = ->
Grim.deprecations = deprecationsSnapshot
jasmine.useRealClock = ->
jasmine.unspy(window, 'setTimeout')
jasmine.unspy(window, 'clearTimeout')
jasmine.unspy(_._, 'now')
addCustomMatchers = (spec) ->
spec.addMatchers
toBeInstanceOf: (expected) ->
@@ -298,13 +305,13 @@ window.waitsForPromise = (args...) ->
window.waitsFor timeout, (moveOn) ->
promise = fn()
if shouldReject
promise.fail(moveOn)
promise.done ->
promise.catch(moveOn)
promise.then ->
jasmine.getEnv().currentSpec.fail("Expected promise to be rejected, but it was resolved")
moveOn()
else
promise.done(moveOn)
promise.fail (error) ->
promise.then(moveOn)
promise.catch (error) ->
jasmine.getEnv().currentSpec.fail("Expected promise to be resolved, but it was rejected with #{jasmine.pp(error)}")
moveOn()
+16
Ver Arquivo
@@ -374,6 +374,22 @@ describe "TextEditorComponent", ->
expect(line2LeafNodes[2].textContent).toBe ' '
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
it "renders indent guides correctly on lines containing only whitespace when invisibles are enabled", ->
atom.config.set 'editor.showInvisibles', true
atom.config.set 'editor.invisibles', space: '-', eol: 'x'
editor.getBuffer().insert([1, Infinity], '\n ')
nextAnimationFrame()
line2LeafNodes = getLeafNodes(component.lineNodeForScreenRow(2))
expect(line2LeafNodes.length).toBe 4
expect(line2LeafNodes[0].textContent).toBe '--'
expect(line2LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[1].textContent).toBe '--'
expect(line2LeafNodes[1].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[2].textContent).toBe '--'
expect(line2LeafNodes[2].classList.contains('indent-guide')).toBe true
expect(line2LeafNodes[3].textContent).toBe 'x'
it "does not render indent guides in trailing whitespace for lines containing non whitespace characters", ->
editor.getBuffer().setText " hi "
nextAnimationFrame()
+34 -7
Ver Arquivo
@@ -155,6 +155,25 @@ describe "TextEditor", ->
expect(editor2.getSoftTabs()).toBe true
expect(editor2.getEncoding()).toBe 'macroman'
it "uses scoped `core.fileEncoding` values", ->
editor1 = null
editor2 = null
atom.config.set('core.fileEncoding', 'utf16le')
atom.config.set('core.fileEncoding', 'macroman', scopeSelector: '.js')
waitsForPromise ->
atom.workspace.open('a').then (o) -> editor1 = o
runs ->
expect(editor1.getEncoding()).toBe 'utf16le'
waitsForPromise ->
atom.workspace.open('test.js').then (o) -> editor2 = o
runs ->
expect(editor2.getEncoding()).toBe 'macroman'
describe "title", ->
describe ".getTitle()", ->
it "uses the basename of the buffer's path as its title, or 'untitled' if the path is undefined", ->
@@ -2630,12 +2649,20 @@ describe "TextEditor", ->
atom.config.set("editor.autoIndentOnPaste", true)
describe "when only whitespace precedes the cursor", ->
it "auto-indents the lines spanned by the pasted text", ->
atom.clipboard.write("console.log(x);\nconsole.log(y);\n")
editor.setCursorBufferPosition([5, 2])
it "auto-indents the lines spanned by the pasted text, based on the first pasted line", ->
expect(editor.indentationForBufferRow(5)).toBe(3)
atom.clipboard.write("a(x);\n b(x);\n c(x);\n", indentBasis: 0)
editor.setCursorBufferPosition([5, 0])
editor.pasteText()
expect(editor.lineTextForBufferRow(5)).toBe(" console.log(x);")
expect(editor.lineTextForBufferRow(6)).toBe(" console.log(y);")
# Adjust the indentation of the pasted block
expect(editor.indentationForBufferRow(5)).toBe(3)
expect(editor.indentationForBufferRow(6)).toBe(4)
expect(editor.indentationForBufferRow(7)).toBe(5)
# Preserve the indentation of the next row
expect(editor.indentationForBufferRow(8)).toBe(3)
describe "when non-whitespace characters precede the cursor", ->
it "does not auto-indent the first line being pasted", ->
@@ -2732,9 +2759,9 @@ describe "TextEditor", ->
editor.setSelectedBufferRange([[1, 2], [1, Infinity]])
editor.pasteText()
expect(editor.lineTextForBufferRow(1)).toBe(" if (items.length <= 1) return items;")
expect(editor.lineTextForBufferRow(2)).toBe(" ")
expect(editor.lineTextForBufferRow(2)).toBe("")
expect(editor.lineTextForBufferRow(3)).toBe(" if (items.length <= 1) return items;")
expect(editor.getCursorBufferPosition()).toEqual([2, 2])
expect(editor.getCursorBufferPosition()).toEqual([2, 0])
describe "when there is no selection", ->
it "pastes the line above the cursor and retains the cursor's column", ->
+2 -1
Ver Arquivo
@@ -364,12 +364,13 @@ describe "ThemeManager", ->
throw new Error('EACCES permission denied "styles.less"')
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
it "creates an error notification", ->
it "creates an error notification and does not add the stylesheet", ->
themeManager.loadUserStylesheet()
expect(addErrorHandler).toHaveBeenCalled()
note = addErrorHandler.mostRecentCall.args[0]
expect(note.getType()).toBe 'error'
expect(note.getMessage()).toContain 'Error loading'
expect(atom.styles.styleElementsBySourcePath[atom.styles.getUserStyleSheetPath()]).toBeUndefined()
describe "when there is an error watching the user stylesheet", ->
addErrorHandler = null
+22 -1
Ver Arquivo
@@ -1,5 +1,7 @@
{$, $$} = require '../src/space-pen-extensions'
path = require 'path'
fs = require 'fs-plus'
temp = require 'temp'
TextEditor = require '../src/text-editor'
WindowEventHandler = require '../src/window-event-handler'
@@ -54,7 +56,7 @@ describe "Window", ->
jasmine.unspy(TextEditor.prototype, "shouldPromptToSave")
beforeUnloadEvent = $.Event(new Event('beforeunload'))
describe "when pane items are are modified", ->
describe "when pane items are modified", ->
it "prompts user to save and calls atom.workspace.confirmClose", ->
editor = null
spyOn(atom.workspace, 'confirmClose').andCallThrough()
@@ -92,6 +94,25 @@ describe "Window", ->
$(window).trigger(beforeUnloadEvent)
expect(atom.confirm).toHaveBeenCalled()
describe "when the same path is modified in multiple panes", ->
it "prompts to save the item", ->
editor = null
filePath = path.join(temp.mkdirSync('atom-file'), 'file.txt')
fs.writeFileSync(filePath, 'hello')
spyOn(atom.workspace, 'confirmClose').andCallThrough()
spyOn(atom, 'confirm').andReturn(0)
waitsForPromise ->
atom.workspace.open(filePath).then (o) -> editor = o
runs ->
atom.workspace.getActivePane().splitRight(copyActiveItem: true)
editor.setText('world')
$(window).trigger(beforeUnloadEvent)
expect(atom.workspace.confirmClose).toHaveBeenCalled()
expect(atom.confirm.callCount).toBe 1
expect(fs.readFileSync(filePath, 'utf8')).toBe 'world'
describe ".unloadEditorWindow()", ->
it "saves the serialized state of the window so it can be deserialized after reload", ->
workspaceState = atom.workspace.serialize()
+84 -4
Ver Arquivo
@@ -315,6 +315,44 @@ describe "Workspace", ->
expect(notification.getMessage()).toContain 'Permission denied'
expect(notification.getMessage()).toContain 'file1'
describe "when the the operation is not permitted", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
error = new Error("EPERM, operation not permitted '#{path}'")
error.path = path
error.code = 'EPERM'
throw error
it "creates a notification", ->
waitsForPromise ->
workspace.open('file1')
runs ->
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Unable to open'
expect(notification.getMessage()).toContain 'file1'
describe "when the the file is already open in windows", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
error = new Error("EBUSY, resource busy or locked '#{path}'")
error.path = path
error.code = 'EBUSY'
throw error
it "creates a notification", ->
waitsForPromise ->
workspace.open('file1')
runs ->
expect(notificationSpy).toHaveBeenCalled()
notification = notificationSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Unable to open'
expect(notification.getMessage()).toContain 'file1'
describe "when there is an unhandled error", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
@@ -917,9 +955,14 @@ describe "Workspace", ->
expect(editor.isModified()).toBeTruthy()
describe "::saveActivePaneItem()", ->
editor = null
beforeEach ->
waitsForPromise ->
atom.workspace.open('sample.js').then (o) -> editor = o
describe "when there is an error", ->
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
spyOn(editor, 'save').andCallFake ->
throw new Error("'/some/file' is a directory")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
@@ -928,7 +971,7 @@ describe "Workspace", ->
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the directory cannot be written to", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
spyOn(editor, 'save').andCallFake ->
throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
@@ -937,7 +980,7 @@ describe "Workspace", ->
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the user does not have permission", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
spyOn(editor, 'save').andCallFake ->
error = new Error("EACCES, permission denied '/Some/dir/and-a-file.js'")
error.code = 'EACCES'
error.path = '/Some/dir/and-a-file.js'
@@ -948,8 +991,45 @@ describe "Workspace", ->
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the operation is not permitted", ->
spyOn(editor, 'save').andCallFake ->
error = new Error("EPERM, operation not permitted '/Some/dir/and-a-file.js'")
error.code = 'EPERM'
error.path = '/Some/dir/and-a-file.js'
throw error
it "emits a warning notification when the file is already open by another app", ->
spyOn(editor, 'save').andCallFake ->
error = new Error("EBUSY, resource busy or locked '/Some/dir/and-a-file.js'")
error.code = 'EBUSY'
error.path = '/Some/dir/and-a-file.js'
throw error
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
notificaiton = addedSpy.mostRecentCall.args[0]
expect(notificaiton.getType()).toBe 'warning'
expect(notificaiton.getMessage()).toContain 'Unable to save'
it "emits a warning notification when the file system is read-only", ->
spyOn(editor, 'save').andCallFake ->
error = new Error("EROFS, read-only file system '/Some/dir/and-a-file.js'")
error.code = 'EROFS'
error.path = '/Some/dir/and-a-file.js'
throw error
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
notification = addedSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getMessage()).toContain 'Unable to save'
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
spyOn(editor, 'save').andCallFake ->
throw new Error("no one knows")
save = -> atom.workspace.saveActivePaneItem()
+161
Ver Arquivo
@@ -0,0 +1,161 @@
###
Cache for source code transpiled by 6to5.
Inspired by https://github.com/atom/atom/blob/6b963a562f8d495fbebe6abdbafbc7caf705f2c3/src/coffee-cache.coffee.
###
crypto = require 'crypto'
fs = require 'fs-plus'
path = require 'path'
to5 = null # Defer until used
stats =
hits: 0
misses: 0
defaultOptions =
# The Chrome dev tools will show the original version of the file
# when the source map is inlined.
sourceMap: 'inline'
# Because Atom is currently packaged with a fork of React v0.11,
# it makes sense to use the --react-compat option so the React
# JSX transformer produces pre-v0.12 code.
reactCompat: true
# Blacklisted features do not get transpiled. Features that are
# natively supported in the target environment should be listed
# here. Because Atom uses a bleeding edge version of Node/io.js,
# I think this can include es6.arrowFunctions, es6.classes, and
# possibly others, but I want to be conservative.
blacklist: [
'useStrict'
]
# Includes support for es7 features listed at:
# http://6to5.org/docs/usage/transformers/#es7-experimental-.
experimental: true
optional: [
# Target a version of the regenerator runtime that
# supports yield so the transpiled code is cleaner/smaller.
'asyncToGenerator'
]
###
shasum - Hash with an update() method.
value - Must be a value that could be returned by JSON.parse().
###
updateDigestForJsonValue = (shasum, value) ->
# Implmentation is similar to that of pretty-printing a JSON object, except:
# * Strings are not escaped.
# * No effort is made to avoid trailing commas.
# These shortcuts should not affect the correctness of this function.
type = typeof value
if type is 'string'
shasum.update('"', 'utf8')
shasum.update(value, 'utf8')
shasum.update('"', 'utf8')
else if type in ['boolean', 'number']
shasum.update(value.toString(), 'utf8')
else if value is null
shasum.update('null', 'utf8')
else if Array.isArray value
shasum.update('[', 'utf8')
for item in value
updateDigestForJsonValue(shasum, item)
shasum.update(',', 'utf8')
shasum.update(']', 'utf8')
else
# value must be an object: be sure to sort the keys.
keys = Object.keys value
keys.sort()
shasum.update('{', 'utf8')
for key in keys
updateDigestForJsonValue(shasum, key)
shasum.update(': ', 'utf8')
updateDigestForJsonValue(shasum, value[key])
shasum.update(',', 'utf8')
shasum.update('}', 'utf8')
create6to5VersionAndOptionsDigest = (version, options) ->
shasum = crypto.createHash('sha1')
# Include the version of 6to5 in the hash.
shasum.update('6to5-core', 'utf8')
shasum.update('\0', 'utf8')
shasum.update(version, 'utf8')
shasum.update('\0', 'utf8')
updateDigestForJsonValue(shasum, options)
shasum.digest('hex')
jsCacheDir = null
getCachePath = (sourceCode) ->
digest = crypto.createHash('sha1').update(sourceCode, 'utf8').digest('hex')
unless jsCacheDir?
to5Version = require('6to5-core/package.json').version
cacheDir = path.join(process.env.ATOM_HOME, 'compile-cache')
jsCacheDir = path.join(cacheDir, 'js', '6to5', create6to5VersionAndOptionsDigest(to5Version, defaultOptions))
path.join(jsCacheDir, "#{digest}.js")
getCachedJavaScript = (cachePath) ->
if fs.isFileSync(cachePath)
try
cachedJavaScript = fs.readFileSync(cachePath, 'utf8')
stats.hits++
return cachedJavaScript
null
# Returns the 6to5 options that should be used to transpile filePath.
createOptions = (filePath) ->
options = filename: filePath
for key, value of defaultOptions
options[key] = value
options
transpile = (sourceCode, filePath, cachePath) ->
options = createOptions(filePath)
to5 ?= require '6to5-core'
js = to5.transform(sourceCode, options).code
stats.misses++
try
fs.writeFileSync(cachePath, js)
js
# Function that obeys the contract of an entry in the require.extensions map.
# Returns the transpiled version of the JavaScript code at filePath, which is
# either generated on the fly or pulled from cache.
loadFile = (module, filePath) ->
sourceCode = fs.readFileSync(filePath, 'utf8')
unless sourceCode.startsWith('"use 6to5"') or sourceCode.startsWith("'use 6to5'")
return module._compile(sourceCode, filePath)
cachePath = getCachePath(sourceCode)
js = getCachedJavaScript(cachePath) ? transpile(sourceCode, filePath, cachePath)
module._compile(js, filePath)
register = ->
Object.defineProperty(require.extensions, '.js', {
writable: false
value: loadFile
})
module.exports =
register: register
getCacheMisses: -> stats.misses
getCacheHits: -> stats.hits
# Visible for testing.
create6to5VersionAndOptionsDigest: create6to5VersionAndOptionsDigest
addPathToCache: (filePath) ->
return if path.extname(filePath) isnt '.js'
sourceCode = fs.readFileSync(filePath, 'utf8')
cachePath = getCachePath(sourceCode)
transpile(sourceCode, filePath, cachePath)
+16 -10
Ver Arquivo
@@ -3,7 +3,6 @@ ipc = require 'ipc'
os = require 'os'
path = require 'path'
remote = require 'remote'
screen = require 'screen'
shell = require 'shell'
_ = require 'underscore-plus'
@@ -43,6 +42,12 @@ class Atom extends Model
which returns an HTMLElement.
"""
serviceHubDeprecationMessage = """
atom.services is no longer available. To register service providers and
consumers, use the `providedServices` and `consumedServices` fields in
your package's package.json.
"""
Object.defineProperty atom, 'workspaceView',
get: ->
deprecate(workspaceViewDeprecationMessage)
@@ -51,6 +56,14 @@ class Atom extends Model
deprecate(workspaceViewDeprecationMessage)
atom.__workspaceView = newValue
Object.defineProperty atom, 'services',
get: ->
deprecate(serviceHubDeprecationMessage)
atom.packages.serviceHub
set: (newValue) ->
deprecate(serviceHubDeprecationMessage)
atom.packages.serviceHub = newValue
atom
# Deserializes the Atom environment from a state object
@@ -96,7 +109,7 @@ class Atom extends Model
#
# Returns the absolute path to ~/.atom
@getConfigDirPath: ->
@configDirPath ?= fs.absolute('~/.atom')
@configDirPath ?= process.env.ATOM_HOME
# Get the path to Atom's storage directory.
#
@@ -134,9 +147,6 @@ class Atom extends Model
# Public: A {Clipboard} instance
clipboard: null
# A {ServiceHub} instance
services: null
# Public: A {ContextMenuManager} instance
contextMenu: null
@@ -236,7 +246,6 @@ class Atom extends Model
NotificationManager = require './notification-manager'
PackageManager = require './package-manager'
Clipboard = require './clipboard'
ServiceHub = require './service-hub'
GrammarRegistry = require './grammar-registry'
ThemeManager = require './theme-manager'
StyleManager = require './style-manager'
@@ -254,9 +263,6 @@ class Atom extends Model
# Make react.js faster
process.env.NODE_ENV ?= 'production' unless devMode
# Set Atom's home so packages don't have to guess it
process.env.ATOM_HOME = configDirPath
@config = new Config({configDirPath, resourcePath})
@keymaps = new KeymapManager({configDirPath, resourcePath})
@keymap = @keymaps # Deprecated
@@ -272,7 +278,6 @@ class Atom extends Model
@contextMenu = new ContextMenuManager({resourcePath, devMode})
@menu = new MenuManager({resourcePath})
@clipboard = new Clipboard()
@services = new ServiceHub
@grammars = @deserializers.deserialize(@state.grammars ? @state.syntax) ? new GrammarRegistry()
@@ -547,6 +552,7 @@ class Atom extends Model
if @isValidDimensions(dimensions)
dimensions
else
screen = remote.require 'screen'
{width, height} = screen.getPrimaryDisplay().workAreaSize
{x: 0, y: 0, width: Math.min(1024, width), height}
+5 -3
Ver Arquivo
@@ -5,7 +5,7 @@ AutoUpdateManager = require './auto-update-manager'
BrowserWindow = require 'browser-window'
Menu = require 'menu'
app = require 'app'
fs = require 'fs'
fs = require 'fs-plus'
ipc = require 'ipc'
path = require 'path'
os = require 'os'
@@ -216,6 +216,8 @@ class AtomApplication
ipc.on 'open', (event, options) =>
window = @windowForEvent(event)
if options?
if typeof options.pathsToOpen is 'string'
options.pathsToOpen = [options.pathsToOpen]
if options.pathsToOpen?.length > 0
options.window = window
@openPaths(options)
@@ -340,6 +342,7 @@ class AtomApplication
# :window - {AtomWindow} to open file paths in.
openPath: ({pathToOpen, pidToKillWhenClosed, newWindow, devMode, safeMode, windowDimensions, window}={}) ->
{pathToOpen, initialLine, initialColumn} = @locationForPathToOpen(pathToOpen)
pathToOpen = fs.normalize(pathToOpen)
unless pidToKillWhenClosed or newWindow
pathToOpenStat = fs.statSyncNoException(pathToOpen)
@@ -412,9 +415,8 @@ class AtomApplication
openUrl: ({urlToOpen, devMode, safeMode}) ->
unless @packages?
PackageManager = require '../package-manager'
fs = require 'fs-plus'
@packages = new PackageManager
configDirPath: fs.absolute('~/.atom')
configDirPath: process.env.ATOM_HOME
devMode: devMode
resourcePath: @resourcePath
+8 -3
Ver Arquivo
@@ -23,13 +23,18 @@ class AtomWindow
# Normalize to make sure drive letter case is consistent on Windows
@resourcePath = path.normalize(@resourcePath) if @resourcePath
@browserWindow = new BrowserWindow
options =
show: false
title: 'Atom'
icon: @constructor.iconPath
'web-preferences':
'direct-write': false
'direct-write': true
'subpixel-font-scaling': false
# Don't set icon on Windows so the exe's ico will be used as window and
# taskbar's icon. See https://github.com/atom/atom/issues/4811 for more.
if process.platform is 'linux'
options.icon = @constructor.iconPath
@browserWindow = new BrowserWindow options
global.atomApplication.addWindow(this)
@handleEvents()
+3 -3
Ver Arquivo
@@ -47,7 +47,7 @@ class AutoUpdateManager
@setState(ErrorState)
console.error "Error Downloading Update: #{message}"
autoUpdater.on 'update-downloaded', (event, @releaseNotes, @releaseVersion) =>
autoUpdater.on 'update-downloaded', (event, releaseNotes, @releaseVersion) =>
@setState(UpdateAvailableState)
@emitUpdateAvailableEvent(@getWindows()...)
@@ -61,9 +61,9 @@ class AutoUpdateManager
@setState(UnsupportedState)
emitUpdateAvailableEvent: (windows...) ->
return unless @releaseVersion? and @releaseNotes
return unless @releaseVersion?
for atomWindow in windows
atomWindow.sendMessage('update-available', {@releaseVersion, @releaseNotes})
atomWindow.sendMessage('update-available', {@releaseVersion})
setState: (state) ->
return if @state is state
+22 -14
Ver Arquivo
@@ -2,7 +2,7 @@ global.shellStartTime = Date.now()
crashReporter = require 'crash-reporter'
app = require 'app'
fs = require 'fs'
fs = require 'fs-plus'
path = require 'path'
optimist = require 'optimist'
nslog = require 'nslog'
@@ -13,17 +13,8 @@ process.on 'uncaughtException', (error={}) ->
nslog(error.message) if error.message?
nslog(error.stack) if error.stack?
# Patch fs.statSyncNoException/fs.lstatSyncNoException to fail for non-strings
# https://github.com/atom/atom-shell/issues/843
{lstatSyncNoException, statSyncNoException} = fs
fs.statSyncNoException = (pathToStat) ->
return false unless pathToStat and typeof pathToStat is 'string'
statSyncNoException(pathToStat)
fs.lstatSyncNoException = (pathToStat) ->
return false unless pathToStat and typeof pathToStat is 'string'
lstatSyncNoException(pathToStat)
start = ->
setupAtomHome()
if process.platform is 'win32'
SquirrelUpdate = require './squirrel-update'
squirrelCommand = process.argv[1]
@@ -50,8 +41,13 @@ start = ->
app.removeListener 'open-file', addPathToOpen
app.removeListener 'open-url', addUrlToOpen
cwd = args.executedFrom?.toString() or process.cwd()
args.pathsToOpen = args.pathsToOpen.map (pathToOpen) ->
path.resolve(args.executedFrom ? process.cwd(), pathToOpen.toString())
pathToOpen = fs.normalize(pathToOpen)
if cwd
path.resolve(cwd, pathToOpen)
else
path.resolve(pathToOpen)
setupCoffeeScript()
if args.devMode
@@ -79,6 +75,14 @@ setupCoffeeScript = ->
js = CoffeeScript.compile(coffee, filename: filePath)
module._compile(js, filePath)
setupAtomHome = ->
return if process.env.ATOM_HOME
atomHome = path.join(app.getHomeDir(), '.atom')
try
atomHome = fs.realpathSync(atomHome)
process.env.ATOM_HOME = atomHome
parseCommandLine = ->
version = app.getVersion()
options = optimist(process.argv[1..])
@@ -95,8 +99,12 @@ parseCommandLine = ->
opened or a new window if it hasn't.
Environment Variables:
ATOM_DEV_RESOURCE_PATH The path from which Atom loads source code in dev mode.
Defaults to `~/github/atom`.
ATOM_DEV_RESOURCE_PATH The path from which Atom loads source code in dev mode.
Defaults to `~/github/atom`.
ATOM_HOME The root path for all configuration files and folders.
Defaults to `~/.atom`.
"""
options.alias('d', 'dev').boolean('d').describe('d', 'Run in development mode.')
options.alias('f', 'foreground').boolean('f').describe('f', 'Keep the browser process in the foreground.')
+1 -1
Ver Arquivo
@@ -125,7 +125,7 @@ addCommandsToPath = (callback) ->
atomShCommand = "#!/bin/sh\r\n\"$0/../#{relativeAtomShPath.replace(/\\/g, '/')}\" \"$@\""
apmCommandPath = path.join(binFolder, 'apm.cmd')
relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'node_modules', 'atom-package-manager', 'bin', 'apm.cmd'))
relativeApmPath = path.relative(binFolder, path.join(process.resourcesPath, 'app', 'apm', 'bin', 'apm.cmd'))
apmCommand = "@echo off\r\n\"%~dp0\\#{relativeApmPath}\" %*"
apmShCommandPath = path.join(binFolder, 'apm')
+3
Ver Arquivo
@@ -48,5 +48,8 @@ class BufferedNodeProcess extends BufferedProcess
options.env ?= Object.create(process.env)
options.env['ATOM_SHELL_INTERNAL_RUN_AS_NODE'] = 1
args = args?.slice() ? []
args.unshift(command)
args.unshift('--no-deprecation')
super({command: node, args, options, stdout, stderr, exit})
+17 -16
Ver Arquivo
@@ -28,22 +28,23 @@ class BufferedProcess
# * `options` An {Object} with the following keys:
# * `command` The {String} command to execute.
# * `args` The {Array} of arguments to pass to the command (optional).
# * `options` The options {Object} to pass to Node's `ChildProcess.spawn`
# method (optional).
# * `stdout` The callback {Function} that receives a single argument which
# contains the standard output from the command. The callback is
# called as data is received but it's buffered to ensure only
# complete lines are passed until the source stream closes. After
# the source stream has closed all remaining data is sent in a
# final call (optional).
# * `stderr` The callback {Function} that receives a single argument which
# contains the standard error output from the command. The
# callback is called as data is received but it's buffered to
# ensure only complete lines are passed until the source stream
# closes. After the source stream has closed all remaining data
# is sent in a final call (optional).
# * `exit` The callback {Function} which receives a single argument
# containing the exit status (optional).
# * `options` {Object} (optional) The options {Object} to pass to Node's
# `ChildProcess.spawn` method.
# * `stdout` {Function} (optional) The callback that receives a single
# argument which contains the standard output from the command. The
# callback is called as data is received but it's buffered to ensure only
# complete lines are passed until the source stream closes. After the
# source stream has closed all remaining data is sent in a final call.
# * `data` {String}
# * `stderr` {Function} (optional) The callback that receives a single
# argument which contains the standard error output from the command. The
# callback is called as data is received but it's buffered to ensure only
# complete lines are passed until the source stream closes. After the
# source stream has closed all remaining data is sent in a final call.
# * `data` {String}
# * `exit` {Function} (optional) The callback which receives a single
# argument containing the exit status.
# * `code` {Number}
constructor: ({command, args, options, stdout, stderr, exit}={}) ->
@emitter = new Emitter
options ?= {}
+23 -9
Ver Arquivo
@@ -5,7 +5,11 @@ CoffeeScript = require 'coffee-script'
CSON = require 'season'
fs = require 'fs-plus'
cacheDir = path.join(fs.absolute('~/.atom'), 'compile-cache')
cacheDir = path.join(process.env.ATOM_HOME, 'compile-cache')
stats =
hits: 0
misses: 0
# Use separate compile cache when sudo'ing as root to avoid permission issues
if process.env.USER is 'root' and process.env.SUDO_USER and process.env.SUDO_USER isnt process.env.USER
@@ -21,7 +25,10 @@ getCachePath = (coffee) ->
getCachedJavaScript = (cachePath) ->
if fs.isFileSync(cachePath)
try
fs.readFileSync(cachePath, 'utf8')
cachedJavaScript = fs.readFileSync(cachePath, 'utf8')
stats.hits++
return cachedJavaScript
return
convertFilePath = (filePath) ->
if process.platform is 'win32'
@@ -30,6 +37,7 @@ convertFilePath = (filePath) ->
compileCoffeeScript = (coffee, filePath, cachePath) ->
{js, v3SourceMap} = CoffeeScript.compile(coffee, filename: filePath, sourceMap: true)
stats.misses++
# Include source map in the web page environment.
if btoa? and JSON? and unescape? and encodeURIComponent?
js = "#{js}\n//# sourceMappingURL=data:application/json;base64,#{btoa unescape encodeURIComponent v3SourceMap}\n//# sourceURL=#{convertFilePath(filePath)}"
@@ -53,10 +61,16 @@ module.exports =
})
addPathToCache: (filePath) ->
extension = path.extname(filePath)
if extension is '.coffee'
content = fs.readFileSync(filePath, 'utf8')
cachePath = getCachePath(coffee)
compileCoffeeScript(coffee, filePath, cachePath)
else if extension is '.cson'
CSON.readFileSync(filePath)
switch path.extname(filePath)
when '.coffee'
content = fs.readFileSync(filePath, 'utf8')
cachePath = getCachePath(coffee)
compileCoffeeScript(coffee, filePath, cachePath)
when '.cson'
CSON.readFileSync(filePath)
when '.js'
require('./6to5').addPathToCache(filePath)
getCacheMisses: -> stats.misses
getCacheHits: -> stats.hits
+70 -27
Ver Arquivo
@@ -83,7 +83,7 @@ ScopeDescriptor = require './scope-descriptor'
#
# ## Config Schemas
#
# We use [json schema](json-schema.org) which allows you to define your value's
# We use [json schema](http://json-schema.org) which allows you to define your value's
# default, the type it should be, etc. A simple example:
#
# ```coffee
@@ -519,7 +519,7 @@ class Config
# * `options` (optional) {Object} see the `options` argument to {::get}
#
# Returns an {Array} of {Object}s with the following keys:
# * `scopeSelector` The scope-selector {String} with which the value is associated
# * `scopeDescriptor` The {ScopeDescriptor} with which the value is associated
# * `value` The value for the key-path
getAll: (keyPath, options) ->
{scope, sources} = options if options?
@@ -583,6 +583,7 @@ class Config
Pass a `scopeSelector` in an options hash as the final argument instead.
"""
[scopeSelector, keyPath, value] = arguments
shouldSave = true
else
[keyPath, value, options] = arguments
scopeSelector = options?.scopeSelector
@@ -601,7 +602,7 @@ class Config
return false
if scopeSelector?
@setRawScopedValue(source, scopeSelector, keyPath, value)
@setRawScopedValue(keyPath, value, source, scopeSelector)
else
@setRawValue(keyPath, value)
@@ -640,8 +641,9 @@ class Config
@scopedSettingsStore.removePropertiesForSourceAndSelector(source, scopeSelector)
@emitChangeEvent()
else
@scopedSettingsStore.removePropertiesForSource(source)
if keyPath?
for scopeSelector of @scopedSettingsStore.propertiesForSource(source)
@unset(keyPath, {scopeSelector, source})
if keyPath? and source is @getUserConfigPath()
@set(keyPath, _.valueForKeyPath(@defaultSettings, keyPath))
# Extended: Get an {Array} of all of the `source` {String}s with which
@@ -795,6 +797,7 @@ class Config
_.extend rootSchema, schema
@setDefaults(keyPath, @extractDefaultsFromSchema(schema))
@setScopedDefaultsFromSchema(keyPath, schema)
@resetSettingsForSchemaChange()
load: ->
@initializeConfigDirectory()
@@ -865,7 +868,12 @@ class Config
save: ->
allSettings = {'*': @settings}
allSettings = _.extend allSettings, @scopedSettingsStore.propertiesForSource(@getUserConfigPath())
CSON.writeFileSync(@configFilePath, allSettings)
try
CSON.writeFileSync(@configFilePath, allSettings)
catch error
message = "Failed to save `#{path.basename(@configFilePath)}`"
detail = error.message
@notifyFailure(message, detail)
###
Section: Private methods managing global settings
@@ -898,16 +906,10 @@ class Config
defaultValue = _.valueForKeyPath(@defaultSettings, keyPath)
if value?
if value instanceof Color
value = value.clone()
else
value = _.deepClone(value)
_.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue)
value = @deepClone(value)
_.defaults(value, defaultValue) if isPlainObject(value) and isPlainObject(defaultValue)
else
if defaultValue instanceof Color
value = defaultValue.clone()
else
value = _.deepClone(defaultValue)
value = @deepClone(defaultValue)
value
@@ -957,6 +959,16 @@ class Config
catch e
console.warn("'#{keyPath}' could not set the default. Attempted default: #{JSON.stringify(defaults)}; Schema: #{JSON.stringify(@getSchema(keyPath))}")
deepClone: (object) ->
if object instanceof Color
object.clone()
else if _.isArray(object)
object.map (value) => @deepClone(value)
else if isPlainObject(object)
_.mapObject object, (key, value) => [key, @deepClone(value)]
else
object
# `schema` will look something like this
#
# ```coffee
@@ -992,9 +1004,28 @@ class Config
defaults[key] = @extractDefaultsFromSchema(value) for key, value of properties
defaults
makeValueConformToSchema: (keyPath, value) ->
value = @constructor.executeSchemaEnforcers(keyPath, value, schema) if schema = @getSchema(keyPath)
value
makeValueConformToSchema: (keyPath, value, options) ->
if options?.suppressException
try
@makeValueConformToSchema(keyPath, value)
catch e
undefined
else
value = @constructor.executeSchemaEnforcers(keyPath, value, schema) if schema = @getSchema(keyPath)
value
# When the schema is changed / added, there may be values set in the config
# that do not conform to the schema. This will reset make them conform.
resetSettingsForSchemaChange: (source=@getUserConfigPath()) ->
@transact =>
@settings = @makeValueConformToSchema(null, @settings, suppressException: true)
priority = @priorityForSource(source)
selectorsAndSettings = @scopedSettingsStore.propertiesForSource(source)
@scopedSettingsStore.removePropertiesForSource(source)
for scopeSelector, settings of selectorsAndSettings
settings = @makeValueConformToSchema(null, settings, suppressException: true)
@setRawScopedValue(null, settings, source, scopeSelector)
return
###
Section: Private Scoped Settings
@@ -1011,8 +1042,15 @@ class Config
resetUserScopedSettings: (newScopedSettings) ->
source = @getUserConfigPath()
priority = @priorityForSource(source)
@scopedSettingsStore.removePropertiesForSource(source)
@scopedSettingsStore.addProperties(source, newScopedSettings, priority: @priorityForSource(source))
for scopeSelector, settings of newScopedSettings
settings = @makeValueConformToSchema(null, settings, suppressException: true)
validatedSettings = {}
validatedSettings[scopeSelector] = withoutEmptyObjects(settings)
@scopedSettingsStore.addProperties(source, validatedSettings, {priority}) if validatedSettings[scopeSelector]?
@emitChangeEvent()
addScopedSettings: (source, selector, value, options) ->
@@ -1025,7 +1063,7 @@ class Config
disposable.dispose()
@emitChangeEvent()
setRawScopedValue: (source, selector, keyPath, value) ->
setRawScopedValue: (keyPath, value, source, selector, options) ->
if keyPath?
newValue = {}
_.setValueForKeyPath(newValue, keyPath, value)
@@ -1112,12 +1150,17 @@ Config.addSchemaEnforcers
return value unless schema.properties?
newValue = {}
for prop, childSchema of schema.properties
continue unless value.hasOwnProperty(prop)
try
newValue[prop] = @executeSchemaEnforcers("#{keyPath}.#{prop}", value[prop], childSchema)
catch error
console.warn "Error setting item in object: #{error.message}"
for prop, propValue of value
childSchema = schema.properties[prop]
if childSchema?
try
newValue[prop] = @executeSchemaEnforcers("#{keyPath}.#{prop}", propValue, childSchema)
catch error
console.warn "Error setting item in object: #{error.message}"
else
# Just pass through un-schema'd values
newValue[prop] = propValue
newValue
'array':
@@ -1162,7 +1205,7 @@ Config.addSchemaEnforcers
throw new Error("Validation failed at #{keyPath}, #{JSON.stringify(value)} is not one of #{JSON.stringify(possibleValues)}")
isPlainObject = (value) ->
_.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value)
_.isObject(value) and not _.isArray(value) and not _.isFunction(value) and not _.isString(value) and not (value instanceof Color)
splitKeyPath = (keyPath) ->
return [] unless keyPath?
+1 -1
Ver Arquivo
@@ -32,7 +32,7 @@ class LanguageMode
return unless commentStartEntry?
commentEndEntry = atom.config.getAll('editor.commentEnd', {scope}).find (entry) ->
commentEndEntry = _.find atom.config.getAll('editor.commentEnd', {scope}), (entry) ->
entry.scopeSelector is commentStartEntry.scopeSelector
commentStartString = commentStartEntry?.value
commentEndString = commentEndEntry?.value
+1 -7
Ver Arquivo
@@ -1,14 +1,10 @@
path = require 'path'
fs = require 'fs-plus'
LessCache = require 'less-cache'
{Subscriber} = require 'emissary'
# {LessCache} wrapper used by {ThemeManager} to read stylesheets.
module.exports =
class LessCompileCache
Subscriber.includeInto(this)
@cacheDir: path.join(require('./coffee-cache').cacheDir, 'less')
@cacheDir: path.join(process.env.ATOM_HOME, 'compile-cache', 'less')
constructor: ({resourcePath, importPaths}) ->
@lessSearchPaths = [
@@ -35,5 +31,3 @@ class LessCompileCache
cssForFile: (stylesheetPath, lessContent) ->
@cache.cssForFile(stylesheetPath, lessContent)
destroy: -> @unsubscribe()
+1 -2
Ver Arquivo
@@ -213,8 +213,7 @@ LinesComponent = React.createClass
innerHTML = ""
scopeStack = []
firstTrailingWhitespacePosition = text.search(/\s*$/)
lineIsWhitespaceOnly = firstTrailingWhitespacePosition is 0
lineIsWhitespaceOnly = line.isOnlyWhitespace()
for token in tokens
innerHTML += @updateScopeStack(scopeStack, token.scopes)
hasIndentGuide = not editor.isMini() and showIndentGuide and (token.hasLeadingWhitespace() or (token.hasTrailingWhitespace() and lineIsWhitespaceOnly))
+1 -1
Ver Arquivo
@@ -176,7 +176,7 @@ class MenuManager
element?.classList.toString().split(' ') ? []
sortPackagesMenu: ->
packagesMenu = @template.find ({label}) -> MenuHelpers.normalizeLabel(label) is 'Packages'
packagesMenu = _.find @template, ({label}) -> MenuHelpers.normalizeLabel(label) is 'Packages'
return unless packagesMenu?.submenu?
packagesMenu.submenu.sort (item1, item2) ->
+9 -1
Ver Arquivo
@@ -7,6 +7,7 @@ fs = require 'fs-plus'
Q = require 'q'
Grim = require 'grim'
ServiceHub = require 'service-hub'
Package = require './package'
ThemePackage = require './theme-package'
@@ -40,6 +41,7 @@ class PackageManager
@loadedPackages = {}
@activePackages = {}
@packageStates = {}
@serviceHub = new ServiceHub
@packageActivators = []
@registerPackageActivator(this, ['atom', 'textmate'])
@@ -128,9 +130,15 @@ class PackageManager
#
# Return a {String} file path to apm.
getApmPath: ->
return @apmPath if @apmPath?
commandName = 'apm'
commandName += '.cmd' if process.platform is 'win32'
@apmPath ?= path.resolve(__dirname, '..', 'apm', 'node_modules', 'atom-package-manager', 'bin', commandName)
apmRoot = path.resolve(__dirname, '..', 'apm')
@apmPath = path.join(apmRoot, 'bin', commandName)
unless fs.isFileSync(@apmPath)
@apmPath = path.join(apmRoot, 'node_modules', 'atom-package-manager', 'bin', commandName)
@apmPath
# Public: Get the paths being used to look for packages.
#
+10
Ver Arquivo
@@ -159,6 +159,7 @@ class Package
if @requireMainModule()
@mainModule.activate(atom.packages.getPackageState(@name) ? {})
@mainActivated = true
@activateServices()
catch e
console.warn "Failed to activate package named '#{@name}'", e.stack
@@ -209,6 +210,15 @@ class Package
settings.activate() for settings in @settings
@settingsActivated = true
activateServices: ->
for name, {versions} of @metadata.providedServices
for version, methodName of versions
@activationDisposables.add atom.packages.serviceHub.provide(name, version, @mainModule[methodName]())
for name, {versions} of @metadata.consumedServices
for version, methodName of versions
@activationDisposables.add atom.packages.serviceHub.consume(name, version, @mainModule[methodName].bind(@mainModule))
loadKeymaps: ->
if @bundledPackage and packagesCache[@name]?
@keymaps = (["#{atom.packages.resourcePath}#{path.sep}#{keymapPath}", keymapObject] for keymapPath, keymapObject of packagesCache[@name].keymaps)
+4 -4
Ver Arquivo
@@ -48,7 +48,7 @@ class PaneContainer extends Model
deserializeParams: (params) ->
params.root = atom.deserializers.deserialize(params.root, container: this)
params.destroyEmptyPanes = atom.config.get('core.destroyEmptyPanes')
params.activePane = params.root.getPanes().find (pane) -> pane.id is params.activePaneId
params.activePane = find params.root.getPanes(), (pane) -> pane.id is params.activePaneId
params
serializeParams: (params) ->
@@ -147,17 +147,17 @@ class PaneContainer extends Model
find @getPanes(), (pane) -> pane.itemForURI(uri)?
paneForItem: (item) ->
@getPanes().find (pane) -> item in pane.getItems()
find @getPanes(), (pane) -> item in pane.getItems()
saveAll: ->
pane.saveItems() for pane in @getPanes()
confirmClose: ->
confirmClose: (options) ->
allSaved = true
for pane in @getPanes()
for item in pane.getItems()
unless pane.promptToSaveItem(item)
unless pane.promptToSaveItem(item, options)
allSaved = false
break
+25 -4
Ver Arquivo
@@ -437,8 +437,8 @@ class Pane extends Model
destroyInactiveItems: ->
@destroyItem(item) for item in @getItems() when item isnt @activeItem
promptToSaveItem: (item) ->
return true unless item.shouldPromptToSave?()
promptToSaveItem: (item, options={}) ->
return true unless item.shouldPromptToSave?(options)
if typeof item.getURI is 'function'
uri = item.getURI()
@@ -481,7 +481,10 @@ class Pane extends Model
itemURI = item.getUri()
if itemURI?
item.save?()
try
item.save?()
catch error
@handleSaveError(error)
nextAction?()
else
@saveItemAs(item, nextAction)
@@ -498,7 +501,10 @@ class Pane extends Model
itemPath = item.getPath?()
newItemPath = atom.showSaveDialogSync(itemPath)
if newItemPath
item.saveAs(newItemPath)
try
item.saveAs(newItemPath)
catch error
@handleSaveError(error)
nextAction?()
# Public: Save all items.
@@ -667,3 +673,18 @@ class Pane extends Model
for item in @getItems()
return false unless @promptToSaveItem(item)
true
handleSaveError: (error) ->
if error.message.endsWith('is a directory')
atom.notifications.addWarning("Unable to save file: #{error.message}")
else if error.code is 'EACCES' and error.path?
atom.notifications.addWarning("Unable to save file: Permission denied '#{error.path}'")
else if error.code in ['EPERM', 'EBUSY', 'UNKNOWN'] and error.path?
atom.notifications.addWarning("Unable to save file '#{error.path}'", detail: error.message)
else if error.code is 'EROFS' and error.path?
atom.notifications.addWarning("Unable to save file: Read-only file system '#{error.path}'")
else if errorMatch = /ENOTDIR, not a directory '([^']+)'/.exec(error.message)
fileName = errorMatch[1]
atom.notifications.addWarning("Unable to save file: A directory in the path '#{fileName}' could not be written to")
else
throw error
+11 -6
Ver Arquivo
@@ -66,9 +66,17 @@ class Project extends Model
buffers: _.compact(@buffers.map (buffer) -> buffer.serialize() if buffer.isRetained())
deserializeParams: (params) ->
params.buffers = params.buffers.map (bufferState) -> atom.deserializers.deserialize(bufferState)
params
params.buffers = _.compact params.buffers.map (bufferState) ->
# Check that buffer's file path is accessible
return if fs.isDirectorySync(bufferState.filePath)
if bufferState.filePath
try
fs.closeSync(fs.openSync(bufferState.filePath, 'r'))
catch error
return unless error.code is 'ENOENT'
atom.deserializers.deserialize(bufferState)
params
###
Section: Event Subscription
@@ -219,8 +227,7 @@ class Project extends Model
if filePath?
try
fileDescriptor = fs.openSync(filePath, 'r+')
fs.closeSync(fileDescriptor)
fs.closeSync(fs.openSync(filePath, 'r'))
catch error
# allow ENOENT errors to create an editor for paths that dont exist
throw error unless error.code is 'ENOENT'
@@ -273,7 +280,6 @@ class Project extends Model
# Still needed when deserializing a tokenized buffer
buildBufferSync: (absoluteFilePath) ->
buffer = new TextBuffer({filePath: absoluteFilePath})
buffer.setEncoding(atom.config.get('core.fileEncoding'))
@addBuffer(buffer)
buffer.loadSync()
buffer
@@ -291,7 +297,6 @@ class Project extends Model
throw error
buffer = new TextBuffer({filePath: absoluteFilePath})
buffer.setEncoding(atom.config.get('core.fileEncoding'))
@addBuffer(buffer)
buffer.load()
.then((buffer) -> buffer)
+14 -8
Ver Arquivo
@@ -362,7 +362,7 @@ class Selection extends Model
precedingText = @editor.getTextInRange([[oldBufferRange.start.row, 0], oldBufferRange.start])
startLevel = @editor.indentLevelForLine(precedingText)
if options.indentBasis? and not options.autoIndent
if options.indentBasis?
text = @adjustIndent(text, startLevel - options.indentBasis)
newBufferRange = @editor.buffer.setTextInRange(oldBufferRange, text, pick(options, 'undo', 'normalizeLineEndings'))
@@ -375,8 +375,16 @@ class Selection extends Model
if options.autoIndent
precedingText = @editor.getTextInBufferRange([[newBufferRange.start.row, 0], newBufferRange.start])
unless NonWhitespaceRegExp.test(precedingText)
@editor.autoIndentBufferRow(newBufferRange.getRows()[0])
@editor.autoIndentBufferRow(row) for row, i in newBufferRange.getRows() when i > 0
rowsToIndent = newBufferRange.getRows()
firstRow = rowsToIndent.shift()
rowsToIndent.pop() if text.endsWith("\n")
suggestedIndent = @editor.suggestedIndentForBufferRow(firstRow)
actualIndent = @editor.indentationForBufferRow(firstRow)
@editor.setIndentationForBufferRow(firstRow, suggestedIndent)
indentChange = suggestedIndent - actualIndent
for row in rowsToIndent
newIndent = @editor.indentationForBufferRow(row) + indentChange
@editor.setIndentationForBufferRow(row, newIndent)
else if options.autoIndentNewline and text == '\n'
currentIndentation = @editor.indentationForBufferRow(newBufferRange.start.row)
@editor.autoIndentBufferRow(newBufferRange.end.row, preserveLeadingWhitespace: true, skipBlankLines: false)
@@ -595,14 +603,12 @@ class Selection extends Model
@editor.createFold(range.start.row, range.end.row)
@cursor.setBufferPosition([range.end.row + 1, 0])
# Public: Increases the indentation level of
#
# * `indentIncrease` The beginning indent level.
# Private: Increase the indentation level of the given text by given number
# of levels. Leaves the first line unchanged.
adjustIndent: (text, indentIncrease) ->
lines = text.split('\n')
for line, i in lines when i > 0
if indentIncrease == 0
if indentIncrease == 0 or line is ''
continue
else if indentIncrease > 0
lines[i] = @editor.buildIndentString(indentIncrease) + line
-93
Ver Arquivo
@@ -1,93 +0,0 @@
_ServiceHub = require('service-hub')
# Experimental: This class facilitates communication between Atom packages
# through semantically-versioned services. If you want your package to provide
# an API for other packages to interact with, provide or consume a service via
# the global instance of this class available as `atom.services`.
#
# If you're providing an API for other packages, the most straightforward is to
# `provide` a module namespaced under your package's name as follows.
#
# ```coffee
# atom.services.provide "status-bar", "1.0.0",
# addRightItem: (item) -> # ...
# addLeftItem: (item) -> # ...
# ```
#
# Then other packages can interact with your package by consuming the provided
# service. Note that a service consumer can provide an npm-style version range
# string to express the required API version of the consumed service. The
# callback will be invoked with the service immediately or when the service
# becomes available. If multiple services match the provided key-path and
# version range, the callback will be invoked multiple times.
#
# ```coffee
# atom.services.consume "status-bar", "^1.0.0", (statusBar) ->
# statusBar.addLeftItem(new GrammarChanger)
# ```
#
# You can also provide multiple services end-points under the same namespace by
# passing a dot-separated key path. In this example, we also provide a global
# reference to the status bar's DOM element so other packages can modify it
# directly. Doing this via `atom.services` is superior to querying from the DOM
# manually because you can use semantic versioning to indicate when the DOM
# structure changes in a breaking way.
#
# ```coffee
# atom.services.provide "status-bar.view", "1.0.0", statusBarElement
# ```
#
# By convention, every package owns its package name in the services namespace.
# Your package can provide a service under another package's namespace, but you
# should always conform to that package's API. If you want to make additions to
# the API, add them under your own namespace.
#
# When upgrading your package's API, consider retaining previous versions with
# shims if at all possible to minimize breakage and to give the ecosystem time
# to catch up with your changes.
#
# You can also apply an inverted pattern, where your package consumes services
# under its own namespace. In this pattern, you would define a contract for
# services that other packages provide and your package consumes. For example,
# say we were adding the ability to add custom completion providers to
# autocomplete:
#
# ```coffee
# atom.services.consume "autocomplete", "1.0.0", (provider) ->
# addCompletionProvider(provider)
# ```
#
# In this use case, you would want to consume a specific version number rather
# than a range. You could consume multiple version numbers to provide backward
# compatibility.
module.exports =
class ServiceHub extends _ServiceHub
# Experimental: Provide a service by invoking the callback of all current and
# future consumers matching the given key path and version range.
#
# * `keyPath` A {String} of `.` separated keys indicating the services's
# location in the namespace of all services.
# * `version` A {String} containing a [semantic version](http://semver.org/)
# for the service's API.
# * `service` An object exposing the service API.
#
# Returns a {Disposable} on which `.dispose()` can be called to remove the
# provided service.
provide: (keyPath, version, service) ->
super
# Experimental: Consume a service by invoking the given callback for all
# current and future provided services matching the given key path and version
# range.
#
# * `keyPath` A {String} of `.` separated keys indicating the services's
# location in the namespace of all services.
# * `versionRange` A {String} containing a [semantic version range](https://www.npmjs.org/doc/misc/semver.html)
# that any provided services for the given key path must satisfy.
# * `callback` A {Function} to be called with current and future matching
# service objects.
#
# Returns a {Disposable} on which `.dispose()` can be called to remove the
# consumer.
consume: (keyPath, versionRange, callback) ->
super
+1 -1
Ver Arquivo
@@ -224,7 +224,7 @@ TextEditorComponent = React.createClass
@props.editor.setVisible(true)
@performedInitialMeasurement = true
@updatesPaused = false
@forceUpdate() if @updateRequestedWhilePaused and @canUpdate()
@forceUpdate() if @canUpdate()
requestUpdate: ->
return unless @canUpdate()
+7 -1
Ver Arquivo
@@ -105,6 +105,8 @@ class TextEditor extends Model
@languageMode = new LanguageMode(this)
@setEncoding(atom.config.get('core.fileEncoding', scope: @getRootScopeDescriptor()))
@subscribe @$scrollTop, (scrollTop) =>
@emit 'scroll-top-changed', scrollTop
@emitter.emit 'did-change-scroll-top', scrollTop
@@ -639,7 +641,11 @@ class TextEditor extends Model
# Determine whether the user should be prompted to save before closing
# this editor.
shouldPromptToSave: -> @isModified() and not @buffer.hasMultipleEditors()
shouldPromptToSave: ({windowCloseRequested}={}) ->
if windowCloseRequested
@isModified()
else
@isModified() and not @buffer.hasMultipleEditors()
###
Section: Reading Text
+6 -1
Ver Arquivo
@@ -266,7 +266,11 @@ class ThemeManager
"""
atom.notifications.addError(message, dismissable: true)
userStylesheetContents = @loadStylesheet(userStylesheetPath, true)
try
userStylesheetContents = @loadStylesheet(userStylesheetPath, true)
catch
return
@userStyleSheetDisposable = atom.styles.addStyleSheet(userStylesheetContents, sourcePath: userStylesheetPath, priority: 2)
loadBaseStylesheets: ->
@@ -320,6 +324,7 @@ class ThemeManager
detail = error.message
atom.notifications.addError(message, {detail, dismissable: true})
throw error
removeStylesheet: (stylesheetPath) ->
@styleSheetDisposablesBySourcePath[stylesheetPath]?.dispose()
+3 -7
Ver Arquivo
@@ -9,6 +9,7 @@ idCounter = 1
module.exports =
class TokenizedLine
endOfLineInvisibles: null
lineIsWhitespaceOnly: false
constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, @tabLength, @indentLevel, @invisibles}) ->
@startBufferColumn ?= 0
@@ -146,7 +147,7 @@ class TokenizedLine
markLeadingAndTrailingWhitespaceTokens: ->
firstNonWhitespaceIndex = @text.search(NonWhitespaceRegex)
firstTrailingWhitespaceIndex = @text.search(TrailingWhitespaceRegex)
lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0
@lineIsWhitespaceOnly = firstTrailingWhitespaceIndex is 0
index = 0
for token in @tokens
if index < firstNonWhitespaceIndex
@@ -202,12 +203,7 @@ class TokenizedLine
false
isOnlyWhitespace: ->
if @text == ''
true
else
for token in @tokens
return false unless token.isOnlyWhitespace()
true
@lineIsWhitespaceOnly
tokenAtIndex: (index) ->
@tokens[index]

Alguns arquivos não foram exibidos porque demasiados arquivos foram alterados neste diff Mostrar Mais