Comparar commits

..

640 Commits

Autor SHA1 Mensagem Data
Kevin Sawicki a6e59bbbe0 Always return real package paths 2015-01-27 15:35:28 -08:00
Kevin Sawicki d61c015de7 reloadThemes -> reloadStylesheets 2015-01-27 15:17:24 -08:00
Kevin Sawicki 78b4efe1dd Use commit from PR 2015-01-27 15:10:42 -08:00
Kevin Sawicki df79038bcc Revert changes to loadLessStylesheet 2015-01-27 13:29:08 -08:00
Kevin Sawicki 5a1c6bdf4a Remove unused method 2015-01-27 13:26:14 -08:00
Kevin Sawicki ba6abea216 reloadThemes -> reloadStylesheets 2015-01-27 13:22:41 -08:00
Kevin Sawicki 1e740d95ab Load package stylesheets from theme manager 2015-01-27 13:22:08 -08:00
Kevin Sawicki 6f5b296471 Add initial footer support 2015-01-27 12:04:14 -08:00
Kevin Sawicki 9a5be7e70c Parse object settings into colors manually 2015-01-27 09:36:40 -08:00
Kevin Sawicki 4edb856848 Start watching config after activation 2015-01-27 09:36:40 -08:00
Kevin Sawicki 74358f3e79 Add spec for existing value conforming to new schema 2015-01-27 09:36:40 -08:00
Kevin Sawicki 0ecb46504c Unset values that do not conform to schema 2015-01-27 09:36:40 -08:00
Kevin Sawicki 474be40154 Add back hard-code fallback for specs 2015-01-27 09:36:40 -08:00
Kevin Sawicki 06f496cd13 Remove unneeded config listeners 2015-01-27 09:36:40 -08:00
Kevin Sawicki 27835013fe in -> of 2015-01-27 09:36:40 -08:00
Kevin Sawicki fd593e94be 🎨 2015-01-27 09:36:40 -08:00
Kevin Sawicki 6df60cb29e Validate variables in Package 2015-01-27 09:36:39 -08:00
Kevin Sawicki 920ffd91a5 Make activate optional 2015-01-27 09:36:39 -08:00
Kevin Sawicki 7e194541a0 Only inject strings and numbers 2015-01-27 09:36:39 -08:00
Kevin Sawicki ccf0e6168a Inject theme settings as less variables 2015-01-27 09:36:39 -08:00
Kevin Sawicki 8258ec6d45 Use config default as fallback 2015-01-27 09:36:39 -08:00
Kevin Sawicki db2e6dd97c Set theme settings variables from config 2015-01-27 09:36:39 -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
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
Nathan Sobo 2f765974f8 Merge pull request #4169 from atom/upgrading-docs
Add package upgrade guide
2015-01-15 13:07:54 -07:00
Nathan Sobo 28868fdb8c ⬆️ deprecation-cop 2015-01-15 13:04:12 -07:00
Max Brunsfeld 4ce785d12c ⬆️ bookmarks and git-diff
For updated decoration type name
2015-01-15 11:35:46 -08:00
Cheng Zhao 7f8f5203bc ⬆️ grunt-atom-shell-installer@0.20.0 2015-01-15 11:09:14 -08:00
Kevin Sawicki 77fb8ba15b Prepare 0.174 2015-01-15 11:06:45 -08:00
Nathan Sobo 058005afdf ⬆️ markdown-preview 2015-01-15 11:28:41 -07:00
Kevin Sawicki 062072ad87 Add linter emoji 2015-01-15 09:57:38 -08:00
Kevin Sawicki a6a9a9e94b Use skinny arrow to remove lint warning 2015-01-15 09:53:47 -08:00
simurai c024abcc5f 🐛 Fix line-height of the indent-guide
Issue #4279
2015-01-15 20:14:57 +09:00
Nathan Sobo c69f4baa04 Merge pull request #5068 from atom/ns-line-number-decorations
Rename 'gutter' decorations to 'line-number'
2015-01-14 20:04:02 -07:00
Nathan Sobo 5a4cf01083 Move getFirst/LastVisibleScreenRow to the view 2015-01-14 20:02:49 -07:00
Nathan Sobo 49699bddf2 Fix styleSheets manifest key in package.json of fixtures 2015-01-14 19:52:26 -07:00
Nathan Sobo 542ed631e8 Emit deprecation warnings for decorations of type ‘gutter’ 2015-01-14 19:49:46 -07:00
Nathan Sobo 8c574bfd30 Rename 'gutter' decorations to 'line-number' decorations 2015-01-14 19:49:46 -07:00
Nathan Sobo f570a417e6 Allow for styles/ directory in themes in prebuild-less task 2015-01-14 19:49:07 -07:00
Nathan Sobo ae9e1b0416 ⬆️ ui themes to fix imports 2015-01-14 19:36:28 -07:00
Nathan Sobo 08ab5ff650 ⬆️ themes to rename stylesheets directories 2015-01-14 19:26:55 -07:00
Max Brunsfeld c33288f9bb ⬆️ symbols-view 2015-01-14 18:06:46 -08:00
Nathan Sobo 073f9f2a3e ⬆️ spell-check for deprecation fix 2015-01-14 19:06:15 -07:00
Nathan Sobo b6fc7ff1ac ⬆️ dev-live-reload for build error fix 2015-01-14 19:03:04 -07:00
Nathan Sobo 163ee97c73 ⬆️ packages for deprecation fixes 2015-01-14 18:58:56 -07:00
Max Brunsfeld 788b55ee2a ⬆️ git-diff 2015-01-14 17:56:04 -08:00
Max Brunsfeld 3a3a4cd3b2 ⬆️ grammar-selector 2015-01-14 17:52:02 -08:00
Max Brunsfeld 9d01795335 ⬆️ image-view 2015-01-14 17:49:06 -08:00
Nathan Sobo aa0a767e34 ⬆️ packages for deprecation fixes 2015-01-14 18:48:27 -07:00
Nathan Sobo fb4956dde6 Fix deprecated styleSheets manifest key 2015-01-14 18:48:27 -07:00
Nathan Sobo 94cee03335 Provide package name for styles metadata deprecations 2015-01-14 18:48:26 -07:00
Max Brunsfeld 15581c9750 ⬆️ incompatible-packages 2015-01-14 17:45:16 -08:00
Max Brunsfeld 55c8c920f9 ⬆️ keybinding-resolver 2015-01-14 17:43:00 -08:00
Max Brunsfeld 0db20c7cbb ⬆️ notifications@0.25.0 2015-01-14 17:37:50 -08:00
Max Brunsfeld 57e618dec9 ⬆️ package-generator 2015-01-14 17:34:03 -08:00
Max Brunsfeld 206810d5db ⬆️ release-notes 2015-01-14 17:31:04 -08:00
Nathan Sobo 85a2698f67 ⬆️ packages for deprecation fixes 2015-01-14 18:28:08 -07:00
Max Brunsfeld 04a8a6f784 ⬆️ settings-view 2015-01-14 17:26:41 -08:00
Nathan Sobo 5d40916b6c ⬆️ themes for deprecation fixes 2015-01-14 18:20:47 -07:00
Max Brunsfeld 9f73a42cf1 ⬆️ deprecation-cop@0.31.0 2015-01-14 17:19:14 -08:00
Nathan Sobo 75b43b4fa3 ⬆️ archive-view 2015-01-14 18:07:28 -07:00
Max Brunsfeld 19f105e9e7 ⬆️ snippets@0.69.0 2015-01-14 17:07:16 -08:00
Max Brunsfeld f097f6b4f8 ⬆️ deprecation-cop@0.30 2015-01-14 17:06:52 -08:00
Ben Ogle 9fa571bf39 Merge pull request #4906 from atom/bo-better-errors
Better errors
2015-01-14 16:25:01 -08:00
Ben Ogle 5cb18fc7e5 this. -> @ 2015-01-14 16:15:54 -08:00
Ben Ogle 274ae6cd57 Use buffer.getPath not @getPath in project
😬
2015-01-14 16:15:53 -08:00
Ben Ogle 7d3fe78eed Remove Pane require from workspace view specs 2015-01-14 16:15:53 -08:00
Ben Ogle 4ba7182bbf 💄 Inline fileName cause it's used once 2015-01-14 16:15:53 -08:00
Ben Ogle 5fe4476114 ⬆️ text-buffer@3.10.0 2015-01-14 16:15:53 -08:00
Ben Ogle 3dc908c5ff Use eventType from pathwatcher's watch errors in messages 2015-01-14 16:15:53 -08:00
Ben Ogle 2355862101 ⬆️ pathwatcher@2.6.0 2015-01-14 16:15:53 -08:00
Ben Ogle e51e859631 Clean up error messages for keymap.cson
Use the computed path as well
2015-01-14 16:15:53 -08:00
Ben Ogle 6211f7330f Use path name in config error messsages 2015-01-14 16:15:53 -08:00
Ben Ogle 62eac3f8a5 Fix error string when there is a user config error 2015-01-14 16:15:53 -08:00
Ben Ogle ba40706265 Add a notification when the init script can’t be loaded 2015-01-14 16:15:53 -08:00
Ben Ogle 683203a9a1 Attempt to fix theme manager specs
They work for me!
2015-01-14 16:15:53 -08:00
Ben Ogle 3ec3c2b69d Fix theme manager specs 2015-01-14 16:15:53 -08:00
Ben Ogle 1bc2248fc2 Fix config specs 2015-01-14 16:15:53 -08:00
Ben Ogle 4be793f465 Post notifications when the user’s sheet cannot be loaded / parsed 2015-01-14 16:15:53 -08:00
Ben Ogle 3454249b58 Allow ENOENT errors in project.open 2015-01-14 16:15:52 -08:00
Ben Ogle cbd42ac20c Don’t need the pane in workspace.open 2015-01-14 16:15:52 -08:00
Ben Ogle 02e4482def :up_arrow: command-palette@0.33.0 2015-01-14 16:15:52 -08:00
Ben Ogle 2306f16b30 :up_arrow: snippets for better errors 2015-01-14 16:15:52 -08:00
Ben Ogle 9bb6a18d41 Support empty paths 2015-01-14 16:15:52 -08:00
Ben Ogle 85844f03f7 Display better error on unable to watch keycap.cson 2015-01-14 16:15:52 -08:00
Ben Ogle 4b8e98af0c Display a better message when there are config watch errors on startup 2015-01-14 16:15:52 -08:00
Ben Ogle f30992c5f2 Upgrade pathwatcher and text-buffer for error catching 2015-01-14 16:15:52 -08:00
Ben Ogle 4af007dce3 💄 2015-01-14 16:15:52 -08:00
Ben Ogle 1e7da34346 Use code rather than name for custom error 2015-01-14 16:15:52 -08:00
Ben Ogle b8efbedee1 Create a warning notification when buffer has a watch error 2015-01-14 16:15:52 -08:00
Ben Ogle 8435826e8a Remove linter errors 2015-01-14 16:15:52 -08:00
Ben Ogle 16468eb65d Move workspace specs to workspace. 2015-01-14 16:15:52 -08:00
Ben Ogle d5e04e883e Use the error.code and path in the error 2015-01-14 16:15:52 -08:00
Ben Ogle 2f3ce50875 Add large file issue link to large file error 2015-01-14 16:15:51 -08:00
Ben Ogle c20d3a8182 Throw an error when the error is unhandled 2015-01-14 16:15:51 -08:00
Ben Ogle ca1f66d197 Post a notification when the user cannot access a file 2015-01-14 16:15:51 -08:00
Ben Ogle 4138b95146 Remove unnecessary < chars. wtf 2015-01-14 16:15:51 -08:00
Ben Ogle 11d4222c9f Handle error when opening a file that doesn’t exist 2015-01-14 16:15:51 -08:00
Ben Ogle bc454f14e0 Add a warning notification for oversize file open 2015-01-14 16:15:51 -08:00
Kevin Sawicki bc65322da0 Merge pull request #5066 from adrianlee44/patch-1
Fix getOriginUrl calling itself
2015-01-14 15:52:25 -08:00
Adrian Lee 63ad6b1a66 Fix getOriginUrl calling itself 2015-01-14 15:44:59 -08:00
Nathan Sobo 4dd0bf7dab ⬆️ tabs 2015-01-14 16:14:26 -07:00
Nathan Sobo aa7482ac28 ⬆️ deprecation-cop 2015-01-14 16:07:51 -07:00
Nathan Sobo ad1d92d6d9 ⬆️ markdown-preview 2015-01-14 16:02:59 -07:00
Kevin Sawicki 131e7a021a ⬆️ spell-check@0.50 2015-01-14 15:00:53 -08:00
Max Brunsfeld 38e0c39c4a ⬆️ styleguide@0.42.0
For deprecation fixes
2015-01-14 14:27:40 -08:00
Russell Lescai c538857cfa Removed unnecessary braces. 2015-01-15 08:57:25 +10:30
Max Brunsfeld c964e718b7 ⬆️ symbols-view@0.78.0
For deprecation fixes
2015-01-14 14:25:42 -08:00
Max Brunsfeld 2738da2829 ⬆️ tabs@0.63.0
For deprecation fixes
2015-01-14 14:20:58 -08:00
Max Brunsfeld fe36f5f9de ⬆️ timecop@0.27.0
For deprecation fixes
2015-01-14 14:05:40 -08:00
Max Brunsfeld c179e562a7 ⬆️ tree-view@0.148.0
For deprecation fixes
2015-01-14 13:58:28 -08:00
Max Brunsfeld e8ad1aa074 ⬆️ wrap-guide@0.30.0
For deprecation fixes
2015-01-14 13:57:59 -08:00
Nathan Sobo 3f190d67da ⬆️ markdown-preview to fix deprecations 2015-01-14 14:23:55 -07:00
Nathan Sobo e60a9e45f7 Display package name correctly for ::getUri deprecation warnings
We capture the package name during the call to ::addOpener and use it
if any open items have the deprecated ::getUri method.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-14 14:23:17 -07:00
Max Brunsfeld 114b938edf Merge pull request #5060 from atom/mb-fix-folds-with-splits
Fix folds with splits
2015-01-14 13:13:52 -08:00
Nathan Sobo 3093a35554 ⬆️ status-bar for deprecation fixes 2015-01-14 11:45:15 -07:00
Kevin Sawicki 3839432654 Merge pull request #5059 from atom/ks-squirrel-zero-point-eight
Upgrade to Squirrel for Windows 0.8
2015-01-14 10:42:00 -08:00
Nathan Sobo 0a66e9d21e Centralize deprecation warnings about getUri in Pane::addItem 2015-01-14 11:36:28 -07:00
Kevin Sawicki 3dbdfe54ad Use Atom icon in AtomSetup.exe 2015-01-14 10:32:50 -08:00
Kevin Sawicki 485fc62d22 ⬆️ grunt-atom-shell-installer@0.19 2015-01-14 10:32:50 -08:00
Kevin Sawicki a0f8405457 ⬆️ grunt-atom-shell-installer@0.18 2015-01-14 10:32:49 -08:00
Nathan Sobo 56da4f49d4 Avoid spurious deprecation warnings when editor URIs are undefined
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-14 11:21:08 -07:00
Max Brunsfeld 0d5a707ffb Fix folding with splits
Fixes #4099

Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-14 09:43:20 -08:00
Kevin Sawicki 76b7a8cec9 Merge pull request #5051 from tony612/fix-marker-doc
📝 fix setHead & setTail docs in Marker
2015-01-14 09:10:26 -08:00
Nathan Sobo de987d3fd2 ⬆️ deprecation-cop 2015-01-14 10:04:03 -07:00
Tony Han 1a09ec6b92 📝 fix setHead & setTail docs in Marker
Change range -> position
2015-01-14 20:42:13 +08:00
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
simurai 149cfdf0c2 Let headers inherit the theme font-family
Issue https://github.com/atom/settings-view/issues/340
2015-01-14 10:37:06 +09:00
Kevin Sawicki d522438876 📝 💄 2015-01-13 17:23:15 -08:00
Kevin Sawicki 8fe72cd469 📝 Remove extra s in essential 2015-01-13 17:23:15 -08:00
Russell Lescai e30b2f1c73 Allow scoped default File Encoding 2015-01-14 11:51:21 +10:30
Nathan Sobo 51a950c419 ⬆️ deprecation-cop 2015-01-13 18:03:38 -07:00
Kevin Sawicki e693254913 Prevent form submits from changing the window URL
Refs atom/settings-view#341
2015-01-13 16:01:24 -08:00
Kevin Sawicki 170a71f416 ⬆️ apm@0.120 2015-01-13 14:52:11 -08:00
Kevin Sawicki e8c19300b5 Use access token when downloading atom shell 2015-01-13 14:37:21 -08:00
Kevin Sawicki 045850ba06 Prepare 0.173 2015-01-13 14:29:26 -08:00
Kevin Sawicki 366ded2f5e ⬆️ season@5.0.5 2015-01-13 14:11:44 -08:00
Kevin Sawicki 716682f072 Defer require until a Color is parsed 2015-01-13 13:40:42 -08:00
Kevin Sawicki 29ee7cc76b Prepare 0.172 2015-01-13 13:27:07 -08:00
Max Brunsfeld 98fe40546e ⬆️ autocomplete@0.42
For inclusion of completions from all matching scopes
2015-01-13 13:04:24 -08:00
Kevin Sawicki 6765eeba1a ⬆️ settings-view@0.172 2015-01-13 12:22:26 -08:00
Kevin Sawicki 1c638129be ⬆️ season@5.0.4 2015-01-13 12:11:50 -08:00
Kevin Sawicki ae2ce9a1f9 Log raw load settings when parsing fails 2015-01-13 12:06:08 -08:00
Ben Ogle b3de4a593d Upgrade notifications to render notifications posted before activation 2015-01-13 11:57:42 -08:00
Ben Ogle dc22592512 Update deprecation-cop for new selector deprecations 2015-01-13 11:51:06 -08:00
Ben Ogle 85208d197d Upgrade tabs to have use custom elements 2015-01-13 11:27:07 -08:00
Kevin Sawicki 277d3ea4ff ⬆️ grunt-cson@0.14 2015-01-13 11:00:23 -08:00
Kevin Sawicki 6d661692df ⬆️ grunt-cson@0.13 2015-01-13 10:55:49 -08:00
Kevin Sawicki 14a75b8605 ⬆️ atom-keymap@2.5.2 2015-01-13 10:47:28 -08:00
Kevin Sawicki 9564fdb48f ⬆️ grunt-cson@0.12 2015-01-13 10:27:39 -08:00
Kevin Sawicki d5e4f051be ⬆️ react-atom-fork@0.11.4 2015-01-13 10:27:18 -08:00
Kevin Sawicki 8c1ee8a759 ⬆️ language-go@0.21 2015-01-13 10:06:48 -08:00
Kevin Sawicki ad64017b7a Merge pull request #5031 from tony612/fix-text-editor-observeCursors-doc
📝 fix ::observeCursors doc
2015-01-13 09:55:49 -08:00
Tony Han 4ebf748fd7 📝 fix ::observeCursors doc
Change selection -> cursor
2015-01-14 01:53:25 +08:00
Kevin Sawicki f0b9b9eb6c ⬆️ season@5.0.3 2015-01-13 09:49:32 -08:00
Nathan Sobo 49cd3eb5da Clear window.setTimeout mock before each spec
This fixes a failure in the keymap spec where we assert that setTimeout
hasn’t been called.
2015-01-13 10:17:48 -07:00
Nathan Sobo ab4588571d Update default style sheet with ::shadow selector 2015-01-13 10:07:03 -07:00
Kevin Sawicki 0097e6246e ⬆️ settings-view@0.171 2015-01-13 09:02:55 -08:00
Nathan Sobo 296409d9d0 Update style guide
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 22:00:24 -08:00
Nathan Sobo 7f8ab72f53 Capitalize initialisms
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 22:00:24 -08:00
Kevin Sawicki 7f2e118abc ⬆️ settings-view@0.170 2015-01-12 18:13:57 -08:00
Kevin Sawicki 415a7e3214 Merge pull request #4930 from atom/ks-add-colors-to-config-schema
Add color support to config schema
2015-01-12 17:54:14 -08:00
Kevin Sawicki 1f3708115e 💄 2015-01-12 17:34:44 -08:00
Kevin Sawicki 55c8b37395 📝 Link to config method 2015-01-12 17:34:44 -08:00
Kevin Sawicki 9d3e9d19e1 📝 Link to Color 2015-01-12 17:34:44 -08:00
Kevin Sawicki 432c31c4dc 💄 2015-01-12 17:34:44 -08:00
Kevin Sawicki e257395f7d Always use settings for parsing 2015-01-12 17:34:44 -08:00
Kevin Sawicki 3f224716a1 💄 2015-01-12 17:34:43 -08:00
Kevin Sawicki 640f8920fb Fix bounds checking of alpha 2015-01-12 17:34:43 -08:00
Kevin Sawicki c015a5c03b 📝 Add period 2015-01-12 17:34:43 -08:00
Kevin Sawicki 88f489715f 📝 Add period 2015-01-12 17:34:43 -08:00
Kevin Sawicki f48a7ac210 Mark methods as essential 2015-01-12 17:34:43 -08:00
Kevin Sawicki 44939a12a0 Validate color properties when set 2015-01-12 17:34:43 -08:00
Kevin Sawicki b256d30bc7 Mark Color as public 2015-01-12 17:34:43 -08:00
Kevin Sawicki 574c56713c Add Color class with string helpers 2015-01-12 17:34:43 -08:00
Kevin Sawicki b8822b32db Only coerce strings and plain objects 2015-01-12 17:34:43 -08:00
Kevin Sawicki 8c39818670 Don't blow up when asking for schema at non-existent path 2015-01-12 17:34:43 -08:00
Kevin Sawicki 5a2c208804 Add specs with invalid objects 2015-01-12 17:34:43 -08:00
Kevin Sawicki fc899f54cf Add specs for setting with an object 2015-01-12 17:34:42 -08:00
Kevin Sawicki c480080dd2 Add fallback values when NaN is parsed 2015-01-12 17:34:42 -08:00
Kevin Sawicki b923b57bcc Add specs for hsl and hsla colors 2015-01-12 17:34:42 -08:00
Kevin Sawicki 1609b6c51b ⬆️ legal-eagle@0.8 2015-01-12 17:34:42 -08:00
Kevin Sawicki 66e30dd38a ⬆️ legal-eagle@0.7 2015-01-12 17:34:42 -08:00
Kevin Sawicki ec96c5f1fc 📝 Add color docs 2015-01-12 17:34:42 -08:00
Kevin Sawicki 319ec244e1 Add spec for invalid values 2015-01-12 17:34:42 -08:00
Kevin Sawicki 1267a1e14e Add spec for default color value 2015-01-12 17:34:42 -08:00
Kevin Sawicki 0411f1584c Add color schema type 2015-01-12 17:34:42 -08:00
Kevin Sawicki 9dc9359e7c ⬆️ apm@0.119 2015-01-12 17:32:27 -08:00
Kevin Sawicki 47668306bd ⬆️ styleguide@0.41 2015-01-12 17:30:48 -08:00
Kevin Sawicki 09920548e8 ⬆️ styleguide@0.40 2015-01-12 17:25:29 -08:00
Kevin Sawicki dea4e4dc19 ⬆️ markdown-preview@0.117 2015-01-12 17:25:29 -08:00
Kevin Sawicki 95ae4a704e ⬆️ snippets@0.67 2015-01-12 17:25:29 -08:00
Kevin Sawicki 903df93933 ⬆️ settings-view@0.169 2015-01-12 17:25:29 -08:00
Kevin Sawicki 4bc6906bdc ⬆️ language-gfm@0.62 2015-01-12 17:25:29 -08:00
Kevin Sawicki f6f71db9ee ⬆️ first-mate@2.2.4 2015-01-12 17:25:29 -08:00
Kevin Sawicki aca8dc3dfb ⬆️ atom-keymap@2.5.1 2015-01-12 17:25:28 -08:00
Nathan Sobo 8e0e6f5508 Merge pull request #5017 from atom/ns-per-editor-gutter-visibility
Add gutter-hidden attribute to atom-text-editor elements
2015-01-12 18:11:50 -07:00
Kevin Sawicki c4d38a738b Merge pull request #4971 from atom/ks-four-season
Stop eval'ing .cson files
2015-01-12 17:06:39 -08:00
Nathan Sobo eee31c3e8c Don’t use component property for TextEditorView::mini shim
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 17:56:47 -07:00
Kevin Sawicki f40d2fb1cc ⬆️ season@5.0.2 2015-01-12 16:55:58 -08:00
Kevin Sawicki 8c30f5fe3f ⬆️ season@5.0.1 2015-01-12 16:55:58 -08:00
Kevin Sawicki e69bd77ef2 ⬆️ coffeestack@0.8 2015-01-12 16:55:58 -08:00
Kevin Sawicki 1c57a48287 ⬆️ coffee-script@1.8 2015-01-12 16:55:58 -08:00
Kevin Sawicki e5a1f15833 Unfocus spec 2015-01-12 16:55:58 -08:00
Kevin Sawicki 8a13c4b959 ⬆️ season@5 2015-01-12 16:55:58 -08:00
Kevin Sawicki 36c0d214f0 ⬆️ season@4.0.3 2015-01-12 16:55:58 -08:00
Kevin Sawicki ae859bad46 ⬆️ season@4.0.2 2015-01-12 16:55:58 -08:00
Kevin Sawicki 1207a432eb ⬆️ season@4.0.1 2015-01-12 16:55:58 -08:00
Kevin Sawicki 2f31822942 ⬆️ grunt-cson@0.11 2015-01-12 16:55:57 -08:00
Kevin Sawicki dea75513b5 Add missing colon 2015-01-12 16:55:57 -08:00
Kevin Sawicki c3a2b3d321 Add cson-safe license override 2015-01-12 16:55:57 -08:00
Kevin Sawicki 97dd53cbdb ⬆️ season@4 2015-01-12 16:55:57 -08:00
Nathan Sobo dd80226c23 Revert "Handle addition/removal of ‘gutter-hidden’ attribute"
This reverts commit 6926236268.

There seems to be some bug or timing issue that prevents the
attachedCallback from being called in all cases when the
attributeChangedCallback is defined. We can figure this out at
a later time.
2015-01-12 17:39:07 -07:00
Nathan Sobo 6926236268 Handle addition/removal of ‘gutter-hidden’ attribute
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo 43f57347d7 Add ‘gutter-hidden’ attribute to TextEditorElement
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo c0b78db159 💄
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Nathan Sobo 002918049d 🐎 Cache gutterVisible state in React component
This avoids a config read on every render.
2015-01-12 16:21:31 -07:00
Nathan Sobo f00b0b7f7a Add TextEditor::set/isGutterVisible
Controls gutter visibility on individual editors.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-12 16:21:31 -07:00
Daniel Hengeveld 6ef8c21977 Merge pull request #5015 from atom/dh-bump-settings-view
⬆️ settings-view@0.168
2015-01-12 12:51:26 -08:00
Daniel Hengeveld 9b2ec09bf1 ⬆️ settings-view@0.168 2015-01-12 12:17:30 -08:00
Ben Ogle 52e91932e0 Merge pull request #5013 from kant/patch-1
Little fix
2015-01-12 11:27:42 -08:00
Darío Hereñú acd34ffaf8 Little fix 2015-01-12 16:27:01 -03:00
Kevin Sawicki 2f62346c58 Link to Windows CI post as well 2015-01-12 11:15:50 -08:00
Ben Ogle f59ffc2485 Merge pull request #4979 from DinisCruz/patch-1
Adding link to blog post with Travis CI instructions
2015-01-12 10:54:32 -08:00
Kevin Sawicki 3090a24957 Prepare 0.171 2015-01-12 10:02:15 -08:00
Kevin Sawicki b39cee3997 ⬆️ language-python@0.30 2015-01-12 09:18:15 -08:00
Kevin Sawicki 8c6e782bd4 ⬆️ language-javascript@0.54 2015-01-12 09:17:13 -08:00
Kevin Sawicki 31106874ed ⬆️ language-xml@0.27 2015-01-12 09:16:23 -08:00
Max Brunsfeld ee73d2cf2a 📝 fix ::onDidChangeActivePaneItem docs
Refs #4946
2015-01-12 08:24:44 -08:00
Dinis Cruz f946061b6c Adding link to blog post with Travis CI instructions 2015-01-10 12:27:32 +00:00
Kevin Sawicki 29f95b88db deprecatedStart is an index 2015-01-09 18:40:57 -08:00
Ben Ogle 48e6cd533d Add wasDisplayed to Notification 2015-01-09 17:35:26 -08:00
Max Brunsfeld 6cc1ffa793 ⬆️ atom-keymap@2.5.0 2015-01-09 17:11:52 -08:00
Max Brunsfeld ee7587e024 Update task docs 2015-01-09 16:59:13 -08:00
Max Brunsfeld fb0769783f Don't use Emitter::off in Task
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 16:59:13 -08:00
Max Brunsfeld 174b7072b7 Add specs for Task events
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 16:59:13 -08:00
Kevin Sawicki f5cd8d107f Merge pull request #4973 from atom/ld-scope-notification
Log scopes to notification instead of console
2015-01-09 16:43:50 -08:00
Lee Dohm ef97197681 Use list.map instead of _.map list 2015-01-09 16:42:16 -08:00
Lee Dohm acb19c1fe1 Log scopes to notification instead of console
Fixes #4969
2015-01-09 16:33:48 -08:00
Kevin Sawicki 495a45e723 ⬆️ language-gfm@0.61 2015-01-09 15:48:17 -08:00
Max Brunsfeld 02a6ed554d Make ContextMenuManager::showForEvent private
Signed-off-by: Nathan Sobo <nathan@github.com>
2015-01-09 15:47:30 -08:00
Max Brunsfeld dde5e6123c Make Cursor::updateVisibility private 2015-01-09 15:41:08 -08:00
Nathan Sobo d26c19a0ec Deprecate Project::resolve
It’s not something that will make sense once we add the ability to have
multiple directories in a project. This adds a new private method on
Project, ::resolvePath, with the original implementation for convenience
until we actually implement multi-folder projects.
2015-01-09 15:03:07 -08:00
Max Brunsfeld f9bde050b4 Handle TextEditorElement::focus() while parent is being attached
Fixes atom/autocomplete#61
2015-01-09 15:00:35 -08:00
Nathan Sobo 19bf64f3cd Revert "Deprecate Project::resolve"
This reverts commit 3c5bd9f10a.
2015-01-09 13:58:01 -08:00
Nathan Sobo 3c5bd9f10a Deprecate Project::resolve
It’s not something that will make sense once we add the ability to have
multiple directories in a project.
2015-01-09 13:40:35 -08:00
Ben Ogle a47782ddd8 Fix context menu docs Closes #4963 2015-01-09 13:28:57 -08:00
Nathan Sobo f21dc22803 Merge pull request #4955 from atom/ns-style-sheet-is-2-words
"Style sheet" is two words – Treat it that way in the API
2015-01-09 11:36:16 -08:00
Kevin Sawicki efe9102060 ⬆️ apm@0.118 2015-01-09 11:16:18 -08:00
Nathan Sobo 2c72c1522a ⬆️ open-on-github 2015-01-09 09:28:15 -08:00
Nathan Sobo 0a5b4f9b33 Make “style sheet” two words in package.json metadata
Rename `stylesheets` -> `styleSheets`
Rename `stylesheetsMain` -> `mainStyleSheet`
2015-01-09 09:04:04 -08:00
Nathan Sobo 932d3755ce Rename stylesheets/ directory in fixture packages 2015-01-09 08:56:12 -08:00
Nathan Sobo a2e855f087 Update docs to refer to styles/ instead of stylesheets/ 2015-01-09 08:42:28 -08:00
Nathan Sobo c078f64293 Rename package stylesheets/ directory to styles/ 2015-01-09 08:42:15 -08:00
Nathan Sobo 37ba67728b Fix core deprecations 2015-01-09 08:24:48 -08:00
Nathan Sobo 7f9d06f55b Move TextEditor::pixelPositionForScreen/BufferPosition to view layer
It doesn’t make sense to talk about pixels at the model layer long-term,
even though we currently store view dimension information in the model
so we don’t have to read from the DOM for optimization purposes. This
information is only available if the view is attached, however, making
these methods a liability on the model layer.
2015-01-09 08:22:45 -08:00
Nathan Sobo f151697c4c ⬆️ packages to remove deprecations 2015-01-08 18:29:38 -08:00
Max Brunsfeld d47efdb2f1 Merge pull request #4937 from atom/ns-clean-up-package-manager
Address issues with PackageManager
2015-01-08 18:21:51 -08:00
Nathan Sobo c3efed0a2c Update deprecation messages 2015-01-08 18:21:07 -08:00
Nathan Sobo a945725a2f Add shims for tests that manually dispatch deprecated events 2015-01-08 17:51:11 -08:00
Nathan Sobo 723b4d2787 Fix undefined Grim references 2015-01-08 17:51:11 -08:00
Nathan Sobo 4ab33890fc Add PackageManager::onDidLoad/UnloadPackage
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 7acf3d4d6b Add PackageManager::onDidDeactivatePackage 2015-01-08 17:51:11 -08:00
Nathan Sobo 6dd9834ae1 Remove defunct text-mate package specs 2015-01-08 17:51:11 -08:00
Nathan Sobo a6c9244c77 Add PackageManager::onDidActivatePackage
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo dbc88bde18 Remove special case in spec for packages converted from text-mate
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 18ac0091a8 Don’t call onDidActivateInitialPackages listeners until the right time
We wait until all packages without activation commands actually
activate.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 010bd643c0 Rename onDidActivateAll -> onDidActivateInitialPackages
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 15fa19efa3 Rename onDidLoadAll -> onDidLoadInitialPackages
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:11 -08:00
Nathan Sobo 30513cfde0 Rename ThemeManager methods for clarity/consistency
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:51:09 -08:00
Nathan Sobo d999b4eca0 Deprecate ThemeManager::setEnabledThemes
Suggest direct config write instead.

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:48:32 -08:00
Nathan Sobo 4ebd9bc775 ⬆️ deprecation-cop
Closes atom/deprecation-cop#16

Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:46:14 -08:00
Nathan Sobo caf613e7c8 Associate packageName metadata with scoped-properties/ deprecation
Signed-off-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
2015-01-08 17:41:50 -08:00
Kevin Sawicki c2da368463 ⬆️ atom-light-ui@0.37 2015-01-08 15:36:47 -08:00
Kevin Sawicki 61f44c9399 ⬆️ language-gfm@0.60 2015-01-08 13:25:07 -08:00
Kevin Sawicki 0a249f776b ⬆️ settings-view@0.167 2015-01-08 13:20:18 -08:00
Kevin Sawicki 00831775dd Merge pull request #4907 from atom/ks-use-different-sudo-compile-cache
Use special compile cache when sudo-ing as root
2015-01-08 11:09:19 -08:00
Ben Ogle 72743235fb Upgrade toatom-dark-ui@0.43.0 2015-01-08 10:47:09 -08:00
Kevin Sawicki 453a44dde3 Use special compile cache when sudo-ing as root 2015-01-08 10:18:54 -08:00
Kevin Sawicki d7158a2ced ⬆️ language-sass@0.31 2015-01-08 10:18:18 -08:00
Kevin Sawicki 4e7a9edefd Prepare 0.170 release 2015-01-08 09:55:06 -08:00
Kevin Sawicki 8fa6fdb90c Merge pull request #4807 from atom/sm-icons
Icon refresh
2015-01-08 09:42:08 -08:00
Kevin Sawicki a57df59cb8 Merge pull request #4911 from postcasio/patch-3
📝 Fix PackageManager::onDidLoadAll description
2015-01-08 09:32:57 -08:00
Kevin Sawicki 99d01b5d0e ⬆️ settings-view@0.166 2015-01-08 09:22:06 -08:00
dominic c806fcf9e7 📝 Fix PackageManager::onDidLoadAll description 2015-01-08 09:42:49 +00:00
Cheng Zhao 1bc9c2eb4b ⬆️ atom-shell@0.20.5 2015-01-08 00:11:59 -08:00
simurai bd08e36d2d Replace Win icons 2015-01-08 14:14:12 +09:00
Kevin Sawicki 76a2b8c54a Add sample list item 2015-01-07 17:57:11 -08:00
Kevin Sawicki 131d2ab3ad 📝 Drop the parens 2015-01-07 17:35:25 -08:00
Kevin Sawicki 0e0c508756 Merge pull request #4901 from danfuzz/fix-url-markdown
📝 Fix URL references for LESS.
2015-01-07 17:34:33 -08:00
Dan Bornstein 325d95ed35 📝 Un-parenthesize the recommendation about LESS.
Per suggestion from @kevinsawicki.
2015-01-07 17:32:07 -08:00
Kevin Sawicki 081fc0e1ae Use icon from resources directory 2015-01-07 16:22:11 -08:00
Kevin Sawicki a6cc6afb16 Don't bundle resources/linux 2015-01-07 16:20:57 -08:00
Nathan Sobo f330e58b4f Prepare 0.169.0 release 2015-01-07 16:35:29 -07:00
Nathan Sobo a406322748 Revert "Remove .pane-item selector from core"
This reverts commit ced66d920d.
2015-01-07 16:12:22 -07:00
Nathan Sobo 8ee428f9dc ⬆️ language-gfm 2015-01-07 15:56:28 -07:00
Nathan Sobo 437873411e ⬆️ base16-tomorrow-light-theme 2015-01-07 15:54:30 -07:00
Nathan Sobo 00eecd4802 ⬆️ settings-view 2015-01-07 15:49:49 -07:00
Kevin Sawicki 2cb13e1a66 Remove lint warning 2015-01-07 14:33:18 -08:00
Kevin Sawicki 8f7f1cef23 Prepare 0.168 2015-01-07 14:25:22 -08:00
Dan Bornstein 34d41efd9a 📝 Fix URL references for LESS. 2015-01-07 14:17:23 -08:00
Ben Ogle ab9cc75f8b Add bit about the engines field 2015-01-07 14:04:08 -08:00
Ben Ogle 9fcac1ab1c Add a bit about contributing to the guide 2015-01-07 14:04:08 -08:00
Ben Ogle c172882c15 Package upgrade guide 💄 2015-01-07 14:04:08 -08:00
Ben Ogle bb6446f7d0 Update wording in tldr of guide 2015-01-07 14:04:08 -08:00
Ben Ogle e2609ddd06 New version of atom-space-pen-views 2015-01-07 14:04:07 -08:00
Ben Ogle 7f3e0287eb Add bit about removal of subscribe() in upgrading your View section 2015-01-07 14:04:07 -08:00
Ben Ogle 1bba80c2b2 Add an example of an arg with the emitter 2015-01-07 14:04:07 -08:00
Ben Ogle 0845610595 editorView -> editorElement again 2015-01-07 14:04:07 -08:00
Ben Ogle 2c09321315 💄 2015-01-07 14:04:07 -08:00
Ben Ogle f2d495eab2 Update the guide to have a section on using the model layer. 2015-01-07 14:04:07 -08:00
Ben Ogle 67c193c5ce Update the guide's selectListView upgrade text 2015-01-07 14:04:07 -08:00
Ben Ogle e62485195a Update the docs on TextEditorView 2015-01-07 14:04:07 -08:00
Ben Ogle 1eba8cff39 Update text about attached and detached semantics 2015-01-07 14:04:07 -08:00
Ben Ogle 40b465b0b6 Update deprecation cop summary 2015-01-07 14:04:07 -08:00
Ben Ogle 909ec375b1 Remove unnecessary tos 2015-01-07 14:04:07 -08:00
Ben Ogle a17b504bdb Add missing line to upgrade guide 2015-01-07 14:04:07 -08:00
Ben Ogle 75857bec01 Update items to equal an array 2015-01-07 14:04:07 -08:00
Ben Ogle b8fa3a2127 Cleanup based on @kevinsawicki feedback 2015-01-07 14:04:07 -08:00
Ben Ogle 979fad966d 💄 2015-01-07 14:04:07 -08:00
Ben Ogle d523f9e1ec Add images of deprecations 2015-01-07 14:04:06 -08:00
Ben Ogle f10453ed04 Reword parts of the guide for clarity 2015-01-07 14:04:06 -08:00
Ben Ogle 2743c0ab6f Upgrade versions of atom-space-pen-views 2015-01-07 14:04:06 -08:00
Ben Ogle 2cf5df858f Be more clear about the export from atom-space-pen-views 2015-01-07 14:04:06 -08:00
Ben Ogle dfbb50385d Comment 💄 2015-01-07 14:04:06 -08:00
Ben Ogle e0f6642a9b with -> by 2015-01-07 14:04:06 -08:00
Ben Ogle 87c217c3f6 Fix don’t 2015-01-07 14:04:06 -08:00
Ben Ogle 77aa539e70 Update a bit of the guide 2015-01-07 14:04:06 -08:00
Ben Ogle 13fa424ed5 Add upgrading selectors section to package upgrade guide 2015-01-07 14:04:06 -08:00
Ben Ogle 0ea2a9dc9c Add guide section on subscribing to commands 2015-01-07 14:04:06 -08:00
Ben Ogle e3eadc310d Add guide section about events and the emitter. 2015-01-07 14:04:06 -08:00
Ben Ogle 6520587ba8 Add section about updating specs 2015-01-07 14:04:06 -08:00
Ben Ogle 3bb62b6651 Update converting view section 2015-01-07 14:04:06 -08:00
Ben Ogle e8ab37c207 Update the View Changes section 2015-01-07 14:04:06 -08:00
Ben Ogle 612e972ac6 Add tl;dr section 2015-01-07 14:04:05 -08:00
Ben Ogle 14a20147c6 Add an example 2015-01-07 14:04:05 -08:00
Ben Ogle ed9c62f883 Add a section on converting a SelectListView 2015-01-07 14:04:05 -08:00
Ben Ogle 0239c7d386 Update structure of the docs a bit 2015-01-07 14:04:05 -08:00
Ben Ogle 7a0b8c31d4 Add initial draft of converting your package 2015-01-07 14:04:05 -08:00
Ben Ogle 82527c24f2 Upgrade deprecations asking for space-pen to use atom-space-pen-views 2015-01-07 14:02:57 -08:00
Kevin Sawicki ccfe787e4f ⬆️ snippets@0.66 2015-01-07 13:40:26 -08:00
Nathan Sobo 4a5b43553b ⬆️ atom-light-syntax 2015-01-07 14:19:25 -07:00
Kevin Sawicki da1ceb0e51 ⬆️ settings-view@0.164 2015-01-07 12:59:32 -08:00
Kevin Sawicki 97e0ddf15d Null out mainPath on resolve errors
The scope of this variable is outside the loop so this prevent
cache corruption based on using the mainPath value from previous
module.

Refs atom/atom-space-pen-views#5
2015-01-07 10:53:33 -08:00
Kevin Sawicki fb3cc5554c Catch errors spawning squirrel
Closes #4895
2015-01-07 10:24:19 -08:00
Nathan Sobo 184aecb4a4 ⬆️ snippets for onDidLoadSnippets method on main module 2015-01-07 10:48:49 -07:00
Nathan Sobo 181cecaf2f ⬆️ atom-light-syntax 2015-01-07 10:34:31 -07:00
Nathan Sobo ced66d920d Remove .pane-item selector from core
It’s still in some themes, but we should be able to use a structural
selector to style anything in the pane so people don’t have to add
this class.
2015-01-07 10:25:32 -07:00
Kevin Sawicki 6fe7eb086f Gracefully handle empty keymaps and menus
Closes atom/settings-view#310
2015-01-07 09:18:57 -08:00
Nathan Sobo 462af79d21 Fix deprecation suppression in specs 2015-01-07 10:12:04 -07:00
Kevin Sawicki 771a60b1bc ⬆️ language-less@0.24 2015-01-07 09:01:33 -08:00
Kevin Sawicki 3e34e426bf ⬆️ language-c@0.37 2015-01-07 09:00:10 -08:00
Nathan Sobo f77f48102c Merge pull request #4879 from atom/ns-style-priorities
Use 'priority' to correctly order style sheets rather than 'group'
2015-01-07 09:51:55 -07:00
Nathan Sobo 7dd67caf57 Remove ‘group’ parameter to addStyleSheet in favor of ‘priority’ 2015-01-07 09:51:42 -07:00
Nathan Sobo 8081595523 Merge pull request #4890 from SKAhack/fix-1
Fix removing the dragover event listener
2015-01-07 09:51:06 -07:00
Nathan Sobo 47cd2359c8 ⬆️ spell-check for shadow DOM fix 2015-01-07 09:43:19 -07:00
simurai 13cf51f835 Replace file icon 2015-01-07 23:06:08 +09:00
Hiroki Sato 571d146ec0 Fix removing the dragover event listener 2015-01-07 22:49:25 +09:00
simurai dc06173f2f Replace main icon 2015-01-07 17:13:34 +09:00
simurai 358799285e Increse icon line thickness 2015-01-07 16:49:31 +09:00
Kevin Sawicki 8f4555b970 ⬆️ settings-view@0.163 2015-01-06 20:31:23 -08:00
Kevin Sawicki e0bc7948ae ⬆️ settings-view@0.162 2015-01-06 20:27:52 -08:00
Kevin Sawicki a606fc516b 💄 2015-01-06 20:26:45 -08:00
Nathan Sobo 2c1f8ce733 Set the style element priority based on the group
This ensures that elements are always in the desired order regardless
of the order the groups are added.
2015-01-06 19:41:57 -07:00
Nathan Sobo 62adc98b17 Use ‘user’ group for user style sheet instead of ‘userTheme’ 2015-01-06 19:33:39 -07:00
Nathan Sobo 94e12ee886 Handle priority in when inserting style elements in style manager 2015-01-06 19:33:14 -07:00
Nathan Sobo 4c74b07b22 Order style elements by priority 2015-01-06 19:14:54 -07:00
Kevin Sawicki 8eb53696a6 Merge pull request #4877 from atom/ld-doc-mention-unlink
📝 Add section on apm unlink to debugging doc
2015-01-06 18:01:14 -08:00
Lee Dohm f9e28af59b 📝 Add section on apm unlink to debugging doc 2015-01-06 17:56:04 -08:00
Ben Ogle 3b5bb1501c 💄 2015-01-06 17:09:59 -08:00
Ben Ogle 8c4c15c17a Fix colons in examples 2015-01-06 17:03:29 -08:00
Ben Ogle ae61ecf602 Upgrade to event-kit@1.0.1 2015-01-06 17:01:46 -08:00
Ben Ogle 9a7582fd0b Upgrade solarized-light@0.17.0 2015-01-06 16:53:39 -08:00
Ben Ogle f7f2f4497b Add docs for cson format to menu manager 2015-01-06 16:51:15 -08:00
Ben Ogle d4c4ab58b1 More information in the context menu docs 2015-01-06 16:45:31 -08:00
Kevin Sawicki a01e6e543e POST data as JSON 2015-01-06 14:21:46 -08:00
Kevin Sawicki d931b3ed5c Use util.inspect on details 2015-01-06 14:18:47 -08:00
Kevin Sawicki b95a7f47a8 Create draft release when one does not exist 2015-01-06 14:09:52 -08:00
Ben Ogle 06cbbe4b67 Upgrade notifications to 0.23.0 2015-01-06 12:37:18 -08:00
Kevin Sawicki 7d44026a92 ⬆️ tabs@0.61 2015-01-06 12:00:06 -08:00
Nathan Sobo 11b0a80d3d ⬆️ bracket-matcher for partial styling fix 2015-01-06 12:47:50 -07:00
Kevin Sawicki 92a8701c70 Add icon and title to update dialogs
Closes #4718
2015-01-06 11:44:10 -08:00
Nathan Sobo 08e1d550c8 ⬆️ autocomplete for spec fix 2015-01-06 12:14:50 -07:00
Nathan Sobo c9eb84f2a4 Fix deprecation location reporting in spec runner 2015-01-06 11:50:20 -07:00
Ben Ogle 74afcc58ac Merge pull request #4858 from atom/ld-doc-project-contains
📝 Prevent confusion over project.contains
2015-01-06 10:49:17 -08:00
Nathan Sobo 180725799a Unmount TextEditorComponent when TextEditorElement is detached
Fixes #4381
Fixes #4700
2015-01-06 11:35:26 -07:00
Kevin Sawicki 03468e405a ⬆️ bracket-matcher@0.66 2015-01-06 10:26:44 -08:00
Kevin Sawicki 1fd4e945ee ⬆️ tabs@0.60 2015-01-06 10:26:29 -08:00
Nathan Sobo 0b48150b71 ⬆️ bracket-matcher for shadow DOM fix 2015-01-06 10:49:35 -07:00
Kevin Sawicki bed8abea22 ⬆️ first-mate@2.2.3 2015-01-06 09:48:26 -08:00
Nathan Sobo 893bdda47d ⬆️ language- packages to rename scoped-properties/ to settings/ 2015-01-06 10:23:28 -07:00
Lee Dohm 0b98093370 📝 Prevent confusion over project.contains
See https://discuss.atom.io/t/testing-for-the-existence-of-a-file/14079
2015-01-05 21:32:11 -08:00
Kevin Sawicki 6abe05b1ab ⬆️ incompatible-packages@0.19 2015-01-05 17:58:13 -08:00
Kevin Sawicki 0f45937adf ⬆️ language-python@0.28 2015-01-05 17:55:53 -08:00
Kevin Sawicki c8726c991f Merge pull request #4592 from atom/chrome39
Upgrade to Chrome39
2015-01-05 17:42:12 -08:00
Nathan Sobo 60205aaabe ⬆️ wrap-guide 2015-01-05 18:33:06 -07:00
Nathan Sobo 6a16c8a59c ⬆️ whitespace 2015-01-05 18:31:49 -07:00
Nathan Sobo a055f09a6c ⬆️ tree-view 2015-01-05 18:23:03 -07:00
Nathan Sobo c19b42a49c ⬆️ styleguide 2015-01-05 18:20:14 -07:00
Nathan Sobo 2632e9aa10 ⬆️ go-to-line 2015-01-05 18:18:49 -07:00
Nathan Sobo a9753d430e ⬆️ spell-check 2015-01-05 18:17:31 -07:00
Kevin Sawicki 796eefd012 ⬆️ apm@0.117 2015-01-05 17:14:58 -08:00
Kevin Sawicki 0f9eea34a5 ⬆️ atom-shell@0.20.4 2015-01-05 17:14:58 -08:00
Kevin Sawicki a84e19c9bd ⬆️ grunt-atom-shell-installer@0.16 2015-01-05 17:14:58 -08:00
Kevin Sawicki 6d276d39d3 ⬆️ atom-shell@0.20.3 2015-01-05 17:14:58 -08:00
Cheng Zhao ab203e5f81 ⬆️ grunt-atom-shell-installer@0.14.0 2015-01-05 17:14:58 -08:00
Cheng Zhao 61512b9e19 ⬆️ apm@0.115.0 2015-01-05 17:14:58 -08:00
Cheng Zhao c29c4652b0 ⬆️ atom-shell@0.20.0 2015-01-05 17:14:58 -08:00
Nathan Sobo a9c0553e31 ⬆️ snippets 2015-01-05 18:11:27 -07:00
Nathan Sobo 6d6e5baa9a ⬆️ markdown-preview 2015-01-05 18:05:38 -07:00
Nathan Sobo 1de76c7d73 ⬆️ base16-tomorrow-dark-theme 2015-01-05 17:57:18 -07:00
Nathan Sobo f6b7450dea ⬆️ background-tips 2015-01-05 17:53:23 -07:00
Nathan Sobo 71e1928f74 ⬆️ autocomplete 2015-01-05 17:49:31 -07:00
Nathan Sobo 1a709065f8 ⬆️ find-and-replace 2015-01-05 17:32:28 -07:00
Kevin Sawicki dca99cb34e ⬆️ language-css@0.25 2015-01-05 15:11:05 -08:00
Kevin Sawicki 3e79f54860 Prepare 0.167 2015-01-05 14:57:02 -08:00
Nathan Sobo a8b5960bc0 Update shadow DOM config setting description 2015-01-05 13:45:42 -07:00
Kevin Sawicki 70e3484a16 ⬆️ archive-view@0.43 2015-01-05 12:38:11 -08:00
Kevin Sawicki 5ac3f58cdb ⬆️ symbols-view@0.77 2015-01-05 12:11:22 -08:00
Kevin Sawicki 692f6947f2 ⬆️ symbols-view@0.76 2015-01-05 11:20:11 -08:00
Ben Ogle 08fad809d2 Merge pull request #4836 from atom/ld-doc-for-4834
Add priority recommendation for variable-sized panels
2015-01-05 11:06:00 -08:00
Kevin Sawicki ba63239928 ⬆️ grunt-atom-shell-installer@0.13.2 2015-01-05 10:51:42 -08:00
Nathan Sobo d90c8c0fb7 ⬆️ packages to upgrade to space-pen 5.0 everywhere 2015-01-05 11:33:41 -07:00
Kevin Sawicki 35e782f05d ⬆️ notifications@0.22 2015-01-05 10:28:46 -08:00
Kevin Sawicki 00af9a93d7 ⬆️ language-gfm@0.58 2015-01-05 09:52:58 -08:00
Kevin Sawicki 018e22ad8d ⬆️ language-php@0.19 2015-01-05 09:41:25 -08:00
Lee Dohm f73d3df233 📝 Add priority recommendation for variable-sized panels
Applies to #4834
2015-01-03 10:36:56 -08:00
Nathan Sobo 25b44ceb1a ⬆️ release-notes 2015-01-02 15:16:37 -07:00
Nathan Sobo c28ecf1a7d ⬆️ wrap-guide to upgrade its grim dependency to 1.0 2015-01-02 15:10:48 -07:00
Nathan Sobo 478e80e585 Update indirect event-kit dependencies to 1.0 2015-01-02 15:08:00 -07:00
Nathan Sobo 08be377004 Update tree-view to upgrade its event-kit dependency 2015-01-02 14:59:02 -07:00
Nathan Sobo 4db3e47377 ⬆️ event-kit to 1.0 2015-01-02 14:52:22 -07:00
Nathan Sobo 76857b4486 Update dependencies with outdated grim dependencies 2015-01-02 14:50:51 -07:00
Nathan Sobo e743d93d6d Update packages with outdated grim dependencies 2015-01-02 14:50:26 -07:00
Nathan Sobo f443c375d4 ⬆️ packages so all atom-space-pen-views dependencies are 1.0 2015-01-02 14:24:44 -07:00
Nathan Sobo b9b488bee2 ⬆️ grim 2015-01-02 13:02:45 -07:00
Nathan Sobo e192922f0e Don’t add __spacePenView property to jQuery objects in ViewRegistry
This property is added as needed in our legacy SpacePen views, and is
now used to trigger a deprecation warning. We don’t want to add it to
new SpacePen views because they shouldn’t trigger deprecation warnings.
2015-01-02 12:58:49 -07:00
Max Brunsfeld d1c41fbf68 Merge pull request #4827 from atom/mb-fix-cursor-next-word
Respect options to Cursor::getBeginningOfNextWordBufferPosition
2015-01-01 23:18:02 -08:00
Max Brunsfeld aa8b97a039 Respect options to Cursor::getBeginningOfNextWordBufferPosition 2015-01-01 23:02:24 -08:00
Max Brunsfeld 5276cb716a ⬆️ tree-view@0.142 2014-12-30 20:22:36 -08:00
Max Brunsfeld 03f8a32f86 Merge pull request #4812 from atom/mb-fix-fold-all-at-indent-level
Fix LanguageMode::foldAllAtIndentLevel
2014-12-30 18:18:58 -08:00
Max Brunsfeld eabb498af7 Fix LanguageMode::foldAllAtIndentLevel 2014-12-30 18:10:28 -08:00
Max Brunsfeld a1e4c0bb05 Don't use ScopedPropertyStore::getProperties 2014-12-30 16:58:16 -08:00
Nathan Sobo 6a285b695f ⬆️ autocomplete 2014-12-30 17:41:28 -06:00
Nathan Sobo 7f66a2fca4 Default shadow DOM to enabled 2014-12-30 17:10:11 -06:00
Nathan Sobo 6565f6d608 ⬆️ autocomplete to fix key bindings 2014-12-30 16:55:39 -06:00
Nathan Sobo 493035fe4e Merge pull request #4606 from atom/ns-use-global-selector-in-config
Use `*` instead of `global` as the global selector in user settings
2014-12-30 16:37:09 -06:00
Nathan Sobo 6e30998ef5 ⬆️ grim for optimizations and source maps 2014-12-30 16:33:30 -06:00
Max Brunsfeld 825c4f6098 Remove incorrect docs for ::toggleLineCommentsForBufferRows 2014-12-30 12:36:46 -08:00
Nathan Sobo b4756aa9b7 Remove unnecessary deprecation warning suppression 2014-12-30 13:55:49 -06:00
Nathan Sobo 651fa1aa42 💄 spelling 2014-12-30 13:53:46 -06:00
Nathan Sobo db17fe2daa 💄 Move example to a better parent describe 2014-12-30 13:53:38 -06:00
Max Brunsfeld 1e0c839257 Merge pull request #4779 from ultramiraculous/typo
Fix typo in WorkspaceView deprecation
2014-12-30 11:41:27 -08:00
Nathan Sobo 18481789b0 Merge pull request #4801 from atom/ns-package-settings-dir
Load package settings from `settings` directory and deprecate `scoped-properties`
2014-12-30 13:41:13 -06:00
Nathan Sobo 304f63532e Replace ‘global’ config key with ‘*’ selector 2014-12-30 13:38:12 -06:00
Max Brunsfeld 6e7364c7c6 Merge pull request #4802 from atom/mb-reduce-config-saves
Don't write the config to disk so darn often
2014-12-30 10:41:01 -08:00
Max Brunsfeld 339f331776 Debounce saving and loading of config 2014-12-30 10:14:57 -08:00
simurai 6b34a18bd9 Replace Mac icons
with Yosemite version
2014-12-30 23:04:49 +09:00
Max Brunsfeld 32275b27a3 Always spy on _.now 2014-12-30 00:04:17 -08:00
Max Brunsfeld 5c730415b7 Use fake config file for entire Config spec 2014-12-30 00:03:34 -08:00
Max Brunsfeld 637b2b0aba Don't save config when setting w/ non-default source 2014-12-29 17:08:26 -08:00
Nathan Sobo b4246a2f07 Load package settings from settings and deprecate scoped-properties 2014-12-29 15:46:10 -06:00
Nathan Sobo 31170dcfae Merge pull request #4794 from atom/ns-move-project-scan
Move Project::replace and ::scan to Workspace
2014-12-29 15:03:19 -06:00
Daniel Hengeveld f784b51f12 Merge pull request #4078 from atom/doc-apm-search-sorting
Mention sorting by stars in docs (was: document api search and sorting)
2014-12-29 11:44:31 -08:00
Max Brunsfeld 3c6dab22d8 Merge pull request #4796 from atom/mb-config-get-all
Add Config::getAll
2014-12-29 11:35:43 -08:00
Daniel Hengeveld e80f5acd50 Merge branch 'master' into doc-apm-search-sorting
Conflicts:
	docs/apm-rest-api.md
2014-12-29 11:33:04 -08:00
Max Brunsfeld 90aca1c6ad 💄 fix lint errors
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-12-29 11:07:43 -08:00
Max Brunsfeld c7771ffde9 Add Config::getAll, deprecate ::settingsForScopeDescriptor
Signed-off-by: Nathan Sobo <nathan@github.com>
2014-12-29 11:01:46 -08:00
Nathan Sobo bdfc862dac Move Project::replace to Workspace 2014-12-29 11:43:17 -06:00
Nathan Sobo 2c7aa170e9 Move Project::scan to Workspace 2014-12-29 11:35:07 -06:00
Chris Williams 6c8d624e73 Typo in WorkspaceView deprecation 2014-12-27 15:42:23 -05:00
Max Brunsfeld 57a876e677 Merge pull request #4773 from atom/mb-remove-add-scoped-properties
Deprecate `Config::addScopedProperties`
2014-12-26 20:07:10 -08:00
Max Brunsfeld 20adc96e4c Add editor.completions to config schema
It was implicitly part of the schema already, but it used
to be set in a way that bypassed schema validations
2014-12-26 17:32:31 -08:00
Max Brunsfeld d508d1eedf Handle a source but no selector in ::unset 2014-12-26 17:24:27 -08:00
Max Brunsfeld 2949ebfe86 Deprecate Config::addScopedProperties 2014-12-26 17:13:33 -08:00
Max Brunsfeld dbaef8e593 Handle null key-path in Config::set 2014-12-26 14:58:17 -08:00
Max Brunsfeld 3edd2f9590 Implement ::observeScopedKeyPath using ::onDidChangeScopedKeyPath 2014-12-26 14:54:45 -08:00
Max Brunsfeld f2652bcb40 ⬆️ scoped-property-store@0.15.5 2014-12-26 14:40:49 -08:00
Max Brunsfeld d6c8ec83d4 📝 Fix examples in config API docs 2014-12-26 11:19:18 -08:00
Max Brunsfeld b4b492a321 💄 Organize config-spec
* Group tests by method rather than by scoped vs unscoped
* Group deprecated methods together
* Group internal methods together
* Make descriptions more consistent
2014-12-24 16:56:53 -08:00
Max Brunsfeld ba6a976013 Merge pull request #4756 from atom/mb-speed-up-config-loading
Speed up and simplify config file reloading
2014-12-24 16:25:28 -08:00
Max Brunsfeld d0486cc923 ⬆️ bundled packages w/ new c++ scope name
* language-ruby@0.46.0
* language-objective-c@0.14.0
* language-gfm@0.57.0
* language-c0.35.0
* symbols-view@0.73.0
2014-12-24 15:12:48 -08:00
Kevin Sawicki fb09f28c4c ⬆️ tree-view@0.141 2014-12-24 09:21:16 -08:00
Max Brunsfeld 883c48b490 Merge pull request #4753 from atom/mb-add-config-get-sources
Add Config::getSources
2014-12-23 20:35:42 -08:00
Max Brunsfeld ceefc15b15 Speed up and simplify config file reloading 2014-12-23 18:41:44 -08:00
Max Brunsfeld a0cc63273c Merge pull request #4755 from atom/mb-fix-disabled-package-situation
Fix recurring errors when a non-existent package is disabled
2014-12-23 17:22:38 -08:00
Max Brunsfeld c328092463 💄 package-manager-spec 2014-12-23 17:14:25 -08:00
Max Brunsfeld b1a3d89af3 Fix grammar in spec description 2014-12-23 17:05:21 -08:00
Kevin Sawicki bd92acba7e Simply deprecation output 2014-12-23 16:58:59 -08:00
Max Brunsfeld d90daf07f8 In PackageManager::activatePackage reject, don't throw 2014-12-23 16:47:43 -08:00
Max Brunsfeld 388428b074 Fix logic error when exception is thrown in config observer 2014-12-23 16:47:43 -08:00
Kevin Sawicki f439d0d996 Tweak log prefix text 2014-12-23 16:38:11 -08:00
Kevin Sawicki 4142845632 ⬆️ octicons@2.1.2 2014-12-23 11:43:37 -08:00
Max Brunsfeld 60c5293b5e Add Config::getSources
The settings-view needs this so that it can display snippets
associated with packages
2014-12-23 11:15:32 -08:00
Max Brunsfeld a1b4820c04 Revert "Revert "Merge pull request #4631""
This reverts commit dc2a453986.

Conflicts:
	spec/config-spec.coffee
	src/config.coffee
2014-12-23 09:26:40 -08:00
Kevin Sawicki 1cf8479831 Remove duplicate require 2014-12-23 09:24:56 -08:00
Kevin Sawicki a14d57ceac ⬆️ language-c@0.34 2014-12-23 09:13:51 -08:00
Kevin Sawicki c1d5d96aca ⬆️ language-shellscript@0.11 2014-12-23 09:10:25 -08:00
Kevin Sawicki b5632b6988 Verify TextEditor::onDidChangeGrammar in specs 2014-12-23 09:08:57 -08:00
Kevin Sawicki fe02442b23 Merge pull request #4743 from Kangaroopower/patch-1
Actually return the new grammar, as per the API
2014-12-23 09:05:22 -08:00
Kangaroopower 04ceaf36bf Actually return the new grammar, as per the API
Previously, the emitter didn't return the new type of grammar, just an undefined to signal when the grammar changed. This patch makes it so that the type of grammar is returned when the texteditor's grammar changes, as per what the API says it does
2014-12-22 21:46:16 -08:00
Max Brunsfeld 08d183dff1 Remove unused $ variable in Package 2014-12-22 17:33:30 -08:00
Kevin Sawicki 134daa1fe2 Merge pull request #4729 from alexandershov/master
Respect initialLine and initialColumn options when reopening a file
2014-12-22 16:07:11 -08:00
Kevin Sawicki 360fbe2a3f ⬆️ tree-view@0.140 2014-12-22 15:25:13 -08:00
aershov 8148446a86 Remove unused variable from text-editor-spec 2014-12-23 02:24:30 +03:00
Kevin Sawicki 16f56a068b ⬆️ grunt-atom-shell-installer@0.13.1 2014-12-22 13:50:46 -08:00
aershov 11112cb374 Call setCursorBufferPosition only if this method exists
@kevinsawicki:
That way in the case where a custom editor is opened that isn't a text editor,
it won't blow up if the custom editor doesn't implement setCursorBufferPosition.
2014-12-23 00:42:43 +03:00
aershov 5c7177746c Remove unused variable and extra newline from text-editor-spec 2014-12-23 00:26:38 +03:00
Kevin Sawicki ab947ba87a ⬆️ symbols-view@0.71 2014-12-22 13:22:23 -08:00
Kevin Sawicki 8a4db34cb8 ⬆️ solarized-light-syntax@0.15 2014-12-22 12:13:53 -08:00
Kevin Sawicki 669088612c ⬆️ solarized-dark-syntax@0.30 2014-12-22 12:13:41 -08:00
Max Brunsfeld 0a14d232d2 ⬆️ snippets@0.61.0
For removal of private method call on atom.config
2014-12-22 11:45:14 -08:00
Kevin Sawicki 651fe5d71c ⬆️ language-python@0.27 2014-12-22 10:51:52 -08:00
Kevin Sawicki 7d49d50b34 Add ⬇️ 2014-12-22 10:51:28 -08:00
Kevin Sawicki aab51d15ab Merge pull request #4734 from KINFOO/master
openSUSE build instructions.
2014-12-22 09:53:49 -08:00
Kevin Sawicki 1926156eee ⬆️ language-javascript@0.52 2014-12-22 09:53:19 -08:00
Kevin Sawicki b12a6abc90 ⬆️ language-less@0.22 2014-12-22 09:52:56 -08:00
Kevin Sawicki 46762c293f Merge pull request #4719 from coreylindsey/master
Updated Arch requirements
2014-12-22 09:38:48 -08:00
Kevin Sawicki 6b8ef25c8e ⬆️ language-sql@0.12 2014-12-22 09:38:20 -08:00
Kevin KIN-FOO 03a769b516 openSUSE build instructions.
Same as _Fedora / CentOS / RHEL_ section, only difference is `nodejs` package
being provided by openSUSE.
2014-12-22 11:33:59 +01:00
aershov 229e7e03b2 Respect initialLine and initialColumn options when reopening a file
Fix #1743
2014-12-21 21:08:18 +03:00
coreylindsey 45ee6df36e Updated Arch requirements
gconf was needed
2014-12-19 21:48:07 -06:00
Kevin Sawicki 9422a8047a Prepare 0.166 2014-12-19 19:13:39 -08:00
Daniel Hengeveld aff1aa5112 phrasing 2014-11-12 19:45:27 +01:00
Daniel Hengeveld 3b6d55dbbb document api search and sorting 2014-11-06 09:49:15 -08:00
154 arquivos alterados com 5138 adições e 2840 exclusões
+7 -1
Ver Arquivo
@@ -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
@@ -87,6 +87,8 @@ For more information on how to work with Atom's official packages, see
* :white_check_mark: `:white_check_mark:` when adding tests
* :lock: `:lock:` when dealing with security
* :arrow_up: `:arrow_up:` when upgrading dependencies
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings
## CoffeeScript Styleguide
@@ -98,6 +100,10 @@ For more information on how to work with Atom's official packages, see
* Avoid spaces inside the curly-braces of hash literals:
* `{a: 1, b: 2}` instead of `{ a: 1, b: 2 }`
* Include a single line of whitespace between methods.
* Capitalize initialisms and acronyms in names, except for the first word, which
should be lower-case:
* `getURI` instead of `getUri`
* `uriToOpen` instead of `URIToOpen`
## Documentation Styleguide
+1 -1
Ver Arquivo
@@ -6,6 +6,6 @@
"url": "https://github.com/atom/atom.git"
},
"dependencies": {
"atom-package-manager": "0.116.0"
"atom-package-manager": "0.128"
}
}
+2
Ver Arquivo
@@ -198,6 +198,7 @@ module.exports = (grunt) ->
outputDir: 'atom-shell'
downloadDir: atomShellDownloadDir
rebuild: true # rebuild native modules after atom-shell is updated
token: process.env.ATOM_ACCESS_TOKEN
'create-windows-installer':
appDirectory: shellAppDir
@@ -205,6 +206,7 @@ module.exports = (grunt) ->
authors: 'GitHub Inc.'
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')
shell:
'kill-atom':
+5 -5
Ver Arquivo
@@ -12,19 +12,19 @@
"fs-plus": "2.x",
"github-releases": "~0.2.0",
"grunt": "~0.4.1",
"grunt-atom-shell-installer": "^0.13.0",
"grunt-atom-shell-installer": "^0.20.0",
"grunt-cli": "~0.1.9",
"grunt-coffeelint": "git+https://github.com/atom/grunt-coffeelint.git#cfb99aa99811d52687969532bd5a98011ed95bfe",
"grunt-contrib-coffee": "~0.9.0",
"grunt-contrib-coffee": "~0.12.0",
"grunt-contrib-csslint": "~0.1.2",
"grunt-contrib-less": "~0.8.0",
"grunt-cson": "0.10.0",
"grunt-download-atom-shell": "~0.10.0",
"grunt-cson": "0.14.0",
"grunt-download-atom-shell": "~0.11.0",
"grunt-lesslint": "0.13.0",
"grunt-peg": "~1.1.0",
"grunt-shell": "~0.3.1",
"harmony-collections": "~0.3.8",
"legal-eagle": "~0.6.0",
"legal-eagle": "~0.9.0",
"minidump": "~0.8",
"npm": "~1.4.5",
"rcedit": "~0.3.0",
+5 -1
Ver Arquivo
@@ -71,6 +71,7 @@ module.exports = (grunt) ->
path.join('build', 'Release', 'obj')
path.join('build', 'Release', '.deps')
path.join('vendor', 'apm')
path.join('resources', 'linux')
path.join('resources', 'mac')
path.join('resources', 'win')
@@ -143,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) ->
-1
Ver Arquivo
@@ -1,4 +1,3 @@
fs = require 'fs'
path = require 'path'
_ = require 'underscore-plus'
fs = require 'fs-plus'
+4
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'
+36 -3
Ver Arquivo
@@ -1,4 +1,5 @@
path = require 'path'
fs = require 'fs'
LessCache = require 'less-cache'
@@ -7,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')
@@ -25,7 +47,10 @@ module.exports = (grunt) ->
for theme in configuration
# TODO Use AtomPackage class once it runs outside of an Atom context
themePath = path.resolve('node_modules', theme)
stylesheetsDir = path.join(themePath, 'stylesheets')
if fs.existsSync(path.join(themePath, 'stylesheets'))
stylesheetsDir = path.join(themePath, 'stylesheets')
else
stylesheetsDir = path.join(themePath, 'styles')
{main} = grunt.file.readJSON(path.join(themePath, 'package.json'))
main ?= 'index.less'
mainPath = path.join(themePath, main)
@@ -38,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)
+25 -2
Ver Arquivo
@@ -101,7 +101,7 @@ getAssets = ->
logError = (message, error, details) ->
grunt.log.error(message)
grunt.log.error(error.message ? error) if error?
grunt.log.error(details) if details
grunt.log.error(require('util').inspect(details)) if details
zipAssets = (buildDir, assets, callback) ->
zip = (directory, sourcePath, assetName, callback) ->
@@ -142,7 +142,30 @@ getAtomDraftRelease = (callback) ->
firstDraft.assets = assets
callback(null, firstDraft)
else
callback(new Error('No draft release in atom/atom repo'))
createAtomDraftRelease(callback)
createAtomDraftRelease = (callback) ->
{version} = require('../../package.json')
options =
uri: 'https://api.github.com/repos/atom/atom/releases'
method: 'POST'
headers: defaultHeaders
json:
tag_name: "v#{version}"
name: version
draft: true
body: """
### Notable Changes
* Something new
"""
request options, (error, response, body='') ->
if error? or response.statusCode isnt 201
logError("Creating atom/atom draft release failed", error, body)
callback(error ? new Error(response.statusCode))
else
callback(null, body)
deleteRelease = (release) ->
options =
+12 -5
Ver Arquivo
@@ -12,11 +12,18 @@ module.exports = (grunt) ->
packageSpecQueue = null
logDeprecations = (label, {stderr}={}) ->
if process.env.JANKY_SHA1 and stderr?.indexOf('Calls to deprecated functions') isnt -1
grunt.log.error(label)
stderr = stderr.replace(/^\[.*\] "/g, '')
stderr = stderr.replace(/source: .*$/g, '')
grunt.log.error(stderr)
return unless process.env.JANKY_SHA1
stderr ?= ''
deprecatedStart = stderr.indexOf('Calls to deprecated functions')
return if deprecatedStart is -1
grunt.log.error(label)
stderr = stderr.substring(deprecatedStart)
stderr = stderr.replace(/^\s*\[[^\]]+\]\s+/gm, '')
stderr = stderr.replace(/source: .*$/gm, '')
stderr = stderr.replace(/^"/gm, '')
stderr = stderr.replace(/",\s*$/gm, '')
grunt.log.error(stderr)
getAppPath = ->
contentsDir = grunt.config.get('atom.contentsDir')
-22
Ver Arquivo
@@ -1,22 +0,0 @@
path = require 'path'
module.exports = (grunt) ->
grunt.registerTask 'update-octicons', 'Update octicon font and LESS variables', ->
pathToOcticons = path.resolve('..', 'octicons')
if grunt.file.isDir(pathToOcticons)
# Copy font-file
fontSrc = path.join(pathToOcticons, 'octicons', 'octicons.woff')
fontDest = path.resolve('static', 'octicons.woff')
grunt.file.copy(fontSrc, fontDest)
# Update Octicon UTF codes
glyphsSrc = path.join(pathToOcticons, 'data', 'glyphs.yml')
output = []
for {css, code} in grunt.file.readYAML(glyphsSrc)
output.push "@#{css}: \"\\#{code}\";"
octiconUtfDest = path.resolve('static', 'variables', 'octicon-utf-codes.less')
grunt.file.write(octiconUtfDest, "#{output.join('\n')}\n")
else
grunt.log.error("octicons repo must be cloned to #{pathToOcticons}")
false
+1 -1
Ver Arquivo
@@ -3,7 +3,7 @@
## Structure of a Keymap File
Keymap files are encoded as JSON or CSON files containing nested hashes. They
work much like stylesheets, but instead of applying style properties to elements
work much like style sheets, but instead of applying style properties to elements
matching the selector, they specify the meaning of keystrokes on elements
matching the selector. Here is an example of some bindings that apply when
keystrokes pass through `atom-text-editor` elements:
+9 -8
Ver Arquivo
@@ -30,8 +30,8 @@ All requests that take parameters require `application/json`.
Parameters:
- **page** (optional)
- **sort** (optional, values: `created_at`, `updated_at`, `downloads`)
- **direction** (optional, values: `asc`, `desc`)
- **sort** (optional) - One of `downloads`, `created_at`, `updated_at`, `stars`. Defaults to `downloads`
- **direction** (optional) - `asc` or `desc`. Defaults to `desc`. `stars` can only be ordered `desc`
Returns a list of all packages in the following format:
```json
@@ -61,17 +61,18 @@ Link: <https://www.atom.io/api/packages?page=1>; rel="self",
By default, results are sorted by download count, descending.
### Searching packages
#### GET /api/packages/search
Parameters:
- **q** String query to search
- **sort** (optional, values: `created_at`, `updated_at`, `downloads`)
- **direction** (optional, values: `asc`, `desc`)
- **q** (required) - Search query
- **page** (optional)
- **sort** (optional) - One of `downloads`, `created_at`, `updated_at`, `stars`. Defaults to the relevance of the search query.
- **direction** (optional) - `asc` or `desc`. Defaults to `desc`.
Returns a list of all packages in the same format as `/api/packages`.
By default, results sorted by relevance to search query.
Returns results in the same format as [listing packages](#listing-packages).
### Showing package details
+5 -1
Ver Arquivo
@@ -26,13 +26,17 @@ Ubuntu LTS 12.04 64-bit is the recommended platform.
### Arch
* `sudo pacman -S base-devel git nodejs libgnome-keyring python2`
* `sudo pacman -S gconf base-devel git nodejs libgnome-keyring python2`
* `export PYTHON=/usr/bin/python2` before building Atom.
### Slackware
* `sbopkg -k -i node -i atom`
### openSUSE
* `sudo zypper install nodejs make gcc gcc-c++ glibc-devel git-core libgnome-keyring-devel rpmdevtools`
## Instructions
If you have problems with permissions don't forget to prefix with `sudo`
+1 -1
Ver Arquivo
@@ -45,7 +45,7 @@ the editor to see it in action!
[atomio]: https://atom.io
[CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
[LESS]: http://lesscss.org
[Less]: http://lesscss.org
[plist]: http://en.wikipedia.org/wiki/Property_list
[R]: http://en.wikipedia.org/wiki/R_(programming_language)
[TextMate]: http://macromates.com
+2 -2
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.
@@ -62,7 +62,7 @@ __Syntax Theme__ dropdown menu to enable your new theme.
[atomio]: https://atom.io
[CSS]: http://en.wikipedia.org/wiki/Cascading_Style_Sheets
[LESS]: http://lesscss.org
[Less]: http://lesscss.org
[plist]: http://en.wikipedia.org/wiki/Property_list
[TextMate]: http://macromates.com
[TextMateThemes]: http://wiki.macromates.com/Themes/UserSubmittedThemes
+10 -10
Ver Arquivo
@@ -15,7 +15,7 @@ my-package/
menus/
spec/
snippets/
stylesheets/
styles/
index.coffee
package.json
```
@@ -38,10 +38,10 @@ In addition to the regular [npm package.json keys][npm-keys] available, Atom
package.json files have their own additions.
- `main` (**Required**): the path to the CoffeeScript file that's the entry point
to your package
- `stylesheets` (**Optional**): an Array of Strings identifying the order of the
to your package.
- `styles` (**Optional**): an Array of Strings identifying the order of the
style sheets your package needs to load. If not specified, style sheets in the
_stylesheets_ directory are added alphabetically.
_styles_ directory are added alphabetically.
- `keymaps`(**Optional**): an Array of Strings identifying the order of the
key mappings your package needs to load. If not specified, mappings in the
_keymaps_ directory are added alphabetically.
@@ -121,10 +121,10 @@ like you.
## Style Sheets
Style sheets for your package should be placed in the _stylesheets_ directory.
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
@@ -138,7 +138,7 @@ taken from the active theme's [ui-variables.less][ui-variables]. For more
information, see the [theme variables docs][theme-variables]. If you follow this
guideline, your package will look good out of the box with any theme!
An optional `stylesheets` array in your _package.json_ can list the style sheets
An optional `styleSheets` array in your _package.json_ can list the style sheets
by name to specify a loading order; otherwise, style sheets are loaded
alphabetically.
@@ -418,8 +418,8 @@ all the other available commands.
[underscore]: http://underscorejs.org/
[jasmine]: http://jasmine.github.io
[cson]: https://github.com/atom/season
[less]: http://lesscss.org
[ui-variables]: https://github.com/atom/atom-dark-ui/blob/master/stylesheets/ui-variables.less
[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
+7 -7
Ver Arquivo
@@ -1,8 +1,8 @@
# Creating a Theme
Atom's interface is rendered using HTML, and it's styled via [LESS] (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'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
elements such as the tree view, the tabs, drop-down lists, and the status bar.
@@ -17,7 +17,7 @@ section on the left hand side.
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
@@ -42,10 +42,10 @@ _Motif_ theme listed in the _Syntax Theme_ drop-down. Select it from the menu to
activate it, now when you open an editor you should see that your new
_motif-syntax_ theme in action.
Open up _stylesheets/colors.less_ to change the various colors variables which
Open up _styles/colors.less_ to change the various colors variables which
have been already been defined. For example, turn `@red` into `#f4c2c1`.
Then open _stylesheets/base.less_ and modify the various selectors that have
Then open _styles/base.less_ and modify the various selectors that have
been already been defined. These selectors style different parts of code in the
editor such as comments, strings and the line numbers in the gutter.
@@ -131,7 +131,7 @@ _styleguide_, or use the shortcut `cmd-ctrl-shift-g`.
![styleguide-img]
[atomio]: http://atom.io/packages
[less]: http://lesscss.org/
[Less]: http://lesscss.org/
[git]: http://git-scm.com/
[atom]: https://atom.io/
[package.json]: ./creating-a-package.html#package-json
+3 -3
Ver Arquivo
@@ -54,7 +54,7 @@ You can also use `apm` to find new packages to install:
## Customizing Key Bindings
Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
Atom keymaps work similarly to style sheets. Just as style sheets use selectors
to apply styles to elements, Atom keymaps use selectors to associate keystrokes
with events in specific contexts. Here's a small example, excerpted from Atom's
built-in keymaps:
@@ -174,12 +174,12 @@ atom-text-editor.is-focused .cursor {
}
```
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/
+27 -1
Ver Arquivo
@@ -3,7 +3,8 @@
Atom provides several tools to help you understand unexpected behavior and debug problems. This guide describes some of those tools and a few approaches to help you debug and provide more helpful information when [submitting issues]:
* [Update to the latest version](#update-to-the-latest-version)
* [Check Atom and package settings](#check-atom-and-package-settings)
* [Check for linked packages](#check-for-linked-packages)
* [Check Atom and package settings](#check-atom-and-package-settings)
* [Check the keybindings](#check-the-keybindings)
* [Check if the problem shows up in safe mode](#check-if-the-problem-shows-up-in-safe-mode)
* [Check your config files](#check-your-config-files)
@@ -24,6 +25,16 @@ $ atom --version
Head on over to the [list of releases][atom releases] and see if there's a more recent release. You can update to the most recent release by downloading Atom from the releases page, or with the in-app auto-updater. The in-app auto-updater checks for and downloads a new version after you restart Atom, or if you use the Atom > Check for Update menu option.
## Check for linked packages
If you develop or contribute to Atom packages, there may be left-over packages linked to your `~/.atom/packages` or `~/.atom/dev/packages` directories. You can use:
```shell
$ apm links
```
to list all linked development packages. You can remove the links using the `apm unlink` command. See `apm unlink --help` for details.
## Check Atom and package settings
In some cases, unexpected behavior might be caused by misconfigured or unconfigured settings in Atom or in one of the packages.
@@ -89,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
+625
Ver Arquivo
@@ -0,0 +1,625 @@
# Upgrading your package to 1.0 APIs
Atom is rapidly approaching 1.0. Much of the effort leading up to the 1.0 has been cleaning up APIs in an attempt to future proof, and make a more pleasant experience developing packages.
This document will guide you through the large bits of upgrading your package to work with 1.0 APIs.
## TL;DR
We've set deprecation messages and errors in strategic places to help make sure you don't miss anything. You should be able to get 95% of the way to an updated package just by fixing errors and deprecations. There are a couple of things you can do to get the full effect of all the errors and deprecations.
### Use atom-space-pen-views
If you use any class from `require 'atom'` with a `$` or `View` in the name, add the `atom-space-pen-views` module to your package's `package.json` file's dependencies:
```js
{
"dependencies": {
"atom-space-pen-views": "^2.0.3"
}
}
```
Then run `apm install` in your package directory.
### Require views from atom-space-pen-views
Anywhere you are requiring one of the following from `atom` you need to require them from `atom-space-pen-views` instead.
```coffee
# require these from 'atom-space-pen-views' rather than 'atom'
$
$$
$$$
View
TextEditorView
ScrollView
SelectListView
```
So this:
```coffee
# Old way
{$, TextEditorView, View, GitRepository} = require 'atom'
```
Would be replaced by this:
```coffee
# New way
{GitRepository} = require 'atom'
{$, TextEditorView, View} = require 'atom-space-pen-views'
```
### Run specs and test your package
You wrote specs, right!? Here's where they shine. Run them with `cmd-shift-P`, and search for `run package specs`. It will show all the deprecation messages and errors.
### Update the engines field in package.json
When you are deprecation free and all done converting, upgrade the `engines` field in your package.json:
```json
{
"engines": {
"atom": ">=0.174.0, <2.0.0"
}
}
```
### Examples
We have upgraded all the core packages. Please see [this issue](https://github.com/atom/atom/issues/4011) for a link to all the upgrade PRs.
## Deprecations
All of the methods in Atom core that have changes will emit deprecation messages when called. These messages are shown in two places: your **package specs**, and in **Deprecation Cop**.
### Specs
Just run your specs, and all the deprecations will be displayed in yellow.
![spec-deps](https://cloud.githubusercontent.com/assets/69169/5637943/b85114ba-95b5-11e4-8681-b81ea8f556d7.png)
### Deprecation Cop
Run an atom window in dev mode (`atom -d`) with your package loaded, and open Deprecation Cop (search for `deprecation` in the command palette). Deprecated methods will be appear in Deprecation Cop only after they have been called.
![dep-cop](https://cloud.githubusercontent.com/assets/69169/5637914/6e702fa2-95b5-11e4-92cc-a236ddacee21.png)
When deprecation cop is open, and deprecated methods are called, a `Refresh` button will appear in the top right of the Deprecation Cop interface. So exercise your package, then come back to Deprecation Cop and click the `Refresh` button.
## Upgrading your Views
Previous to 1.0, views were baked into Atom core. These views were based on jQuery and `space-pen`. They looked something like this:
```coffee
# The old way: getting views from atom
{$, TextEditorView, View} = require 'atom'
module.exports =
class SomeView extends View
@content: ->
@div class: 'find-and-replace', =>
@div class: 'block', =>
@subview 'myEditor', new TextEditorView(mini: true)
#...
```
### The New
`require 'atom'` no longer provides view helpers or jQuery. Atom core is now 'view agnostic'. The preexisting view system is available from a new npm package: `atom-space-pen-views`.
`atom-space-pen-views` now provides jQuery, `space-pen` views, and Atom specific views:
```coffee
# These are now provided by atom-space-pen-views
$
$$
$$$
View
TextEditorView
ScrollView
SelectListView
```
### Adding the module dependencies
To use the new views, you need to specify the `atom-space-pen-views` module in your package's `package.json` file's dependencies:
```js
{
"dependencies": {
"atom-space-pen-views": "^2.0.3"
}
}
```
`space-pen` bundles jQuery. If you do not need `space-pen` or any of the views, you can require jQuery directly.
```js
{
"dependencies": {
"jquery": "^2"
}
}
```
### Converting your views
Sometimes it is as simple as converting the requires at the top of each view page. I assume you read the 'TL;DR' section and have updated all of your requires.
### Upgrading classes extending any space-pen View
#### `afterAttach` and `beforeRemove` updated
The `afterAttach` and `beforeRemove` hooks have been replaced with
`attached` and `detached` and the semantics have changed.
`afterAttach` was called whenever the node was attached to another DOM node, even if that parent node wasn't present in the DOM. `afterAttach` also was called with a boolean indicating whether or not the element and its parents were on the DOM. Now the `attached` hook is _only_ called when the node and all of its parents are actually on the DOM, and is not called with a boolean.
`beforeRemove` was only called when `$.fn.remove` was called, which was typically used when the node was completely removed from the DOM. The new `detached` hook is called whenever the DOM node is _detached_, which could happen if the node is being detached for reattachment later. In short, if `beforeRemove` is called the node is never coming back. With `detached` it might be attached again later.
```coffee
# Old way
{View} = require 'atom'
class MyView extends View
afterAttach: (onDom) ->
#...
beforeRemove: ->
#...
```
```coffee
# New way
{View} = require 'atom-space-pen-views'
class MyView extends View
attached: ->
# Always called with the equivalent of @afterAttach(true)!
#...
detached: ->
#...
```
#### `subscribe` and `subscribeToCommand` methods removed
The `subscribe` and `subscribeToCommand` methods have been removed. See the Eventing and Disposables section for more info.
### Upgrading to the new TextEditorView
All of the atom-specific methods available on the `TextEditorView` have been moved to the `TextEditor`, available via `TextEditorView::getModel`. See the [`TextEditorView` docs][TextEditorView] and [`TextEditor` docs][TextEditor] for more info.
### Upgrading classes extending ScrollView
The `ScrollView` has very minor changes.
You can no longer use `@off` to remove default behavior for `core:move-up`, `core:move-down`, etc.
```coffee
# Old way to turn off default behavior
class ResultsView extends ScrollView
initialize: (@model) ->
super()
# turn off default scrolling behavior from ScrollView
@off 'core:move-up'
@off 'core:move-down'
@off 'core:move-left'
@off 'core:move-right'
```
```coffee
# New way to turn off default behavior
class ResultsView extends ScrollView
initialize: (@model) ->
disposable = super()
# turn off default scrolling behavior from ScrollView
disposable.dispose()
```
* Check out [an example](https://github.com/atom/find-and-replace/pull/311/files#diff-9) from find-and-replace.
* See the [docs][ScrollView] for all the options.
### Upgrading classes extending SelectListView
Your SelectListView might look something like this:
```coffee
# Old!
class CommandPaletteView extends SelectListView
initialize: ->
super()
@addClass('command-palette overlay from-top')
atom.workspaceView.command 'command-palette:toggle', => @toggle()
confirmed: ({name, jQuery}) ->
@cancel()
# do something with the result
toggle: ->
if @hasParent()
@cancel()
else
@attach()
attach: ->
@storeFocusedElement()
items = [] # TODO: build items
@setItems(items)
atom.workspaceView.append(this)
@focusFilterEditor()
confirmed: ({name, jQuery}) ->
@cancel()
```
This attaches and detaches itself from the dom when toggled, canceling magically detaches it from the DOM, and it uses the classes `overlay` and `from-top`.
The new SelectListView no longer automatically detaches itself from the DOM when cancelled. It's up to you to implement whatever cancel beahavior you want. Using the new APIs to mimic the sematics of the old class, it should look like this:
```coffee
# New!
class CommandPaletteView extends SelectListView
initialize: ->
super()
# no more need for the `overlay` and `from-top` classes
@addClass('command-palette')
atom.commands.add 'atom-workspace', 'command-palette:toggle', => @toggle()
# You need to implement the `cancelled` method and hide.
cancelled: ->
@hide()
confirmed: ({name, jQuery}) ->
@cancel()
# do something with the result
toggle: ->
# Toggling now checks panel visibility,
# and hides / shows rather than attaching to / detaching from the DOM.
if @panel?.isVisible()
@cancel()
else
@show()
show: ->
# Now you will add your select list as a modal panel to the workspace
@panel ?= atom.workspace.addModalPanel(item: this)
@panel.show()
@storeFocusedElement()
items = [] # TODO: build items
@setItems(items)
@focusFilterEditor()
hide: ->
@panel?.hide()
```
* And check out the [conversion of CommandPaletteView][selectlistview-example] as a real-world example.
* See the [SelectListView docs][SelectListView] for all options.
## Using the model layer rather than the view layer
The API no longer exposes any specialized view objects or view classes. `atom.workspaceView`, and all the view classes: `WorkspaceView`, `EditorView`, `PaneView`, etc. have been globally deprecated.
Nearly all of the atom-specific actions performed by the old view objects can now be managed via the model layer. For example, here's adding a panel to the interface using the `atom.workspace` model instead of the `workspaceView`:
```coffee
# Old!
div = document.createElement('div')
atom.workspaceView.appendToTop(div)
```
```coffee
# New!
div = document.createElement('div')
atom.workspace.addTopPanel(item: div)
```
For actions that still require the view, such as dispatching commands or munging css classes, you'll access the view via the `atom.views.getView()` method. This will return a subclass of `HTMLElement` rather than a jQuery object or an instance of a deprecated view class (e.g. `WorkspaceView`).
```coffee
# Old!
workspaceView = atom.workspaceView
editorView = workspaceView.getActiveEditorView()
paneView = editorView.getPaneView()
```
```coffee
# New!
# Generally, just use the models
workspace = atom.workspace
editor = workspace.getActiveTextEditor()
pane = editor.getPane()
# If you need views, get them with `getView`
workspaceElement = atom.views.getView(atom.workspace)
editorElement = atom.views.getView(editor)
paneElement = atom.views.getView(pane)
```
## Updating Specs
`atom.workspaceView`, the `WorkspaceView` class and the `EditorView` class have been deprecated. These two objects are used heavily throughout specs, mostly to dispatch events and commands. This section will explain how to remove them while still retaining the ability to dispatch events and commands.
### Removing WorkspaceView references
`WorkspaceView` has been deprecated. Everything you could do on the view, you can now do on the `Workspace` model.
Requiring `WorkspaceView` from `atom` and accessing any methods on it will throw a deprecation warning. Many specs lean heavily on `WorkspaceView` to trigger commands and fetch `EditorView` objects.
Your specs might contain something like this:
```coffee
# Old!
{WorkspaceView} = require 'atom'
describe 'FindView', ->
beforeEach ->
atom.workspaceView = new WorkspaceView()
```
Instead, we will use the `atom.views.getView()` method. This will return a plain `HTMLElement`, not a `WorkspaceView` or jQuery object.
```coffee
# New!
describe 'FindView', ->
workspaceElement = null
beforeEach ->
workspaceElement = atom.views.getView(atom.workspace)
```
### Attaching the workspace to the DOM
The workspace needs to be attached to the DOM in some cases. For example, view hooks only work (`attached()` on `View`, `attachedCallback()` on custom elements) when there is a descendant attached to the DOM.
You might see this in your specs:
```coffee
# Old!
atom.workspaceView.attachToDom()
```
Change it to:
```coffee
# New!
jasmine.attachToDOM(workspaceElement)
```
### Removing EditorView references
Like `WorkspaceView`, `EditorView` has been deprecated. Everything you needed to do on the view you are now able to do on the `TextEditor` model.
In many cases, you will not even need to get the editor's view anymore. Any of those instances should be updated to use the `TextEditor` instance instead. You should really only need the editor's view when you plan on triggering a command on the view in a spec.
Your specs might contain something like this:
```coffee
# Old!
describe 'Something', ->
[editorView] = []
beforeEach ->
editorView = atom.workspaceView.getActiveView()
```
We're going to use `atom.views.getView()` again to get the editor element. As in the case of the `workspaceElement`, `getView` will return a subclass of `HTMLElement` rather than an `EditorView` or jQuery object.
```coffee
# New!
describe 'Something', ->
[editor, editorElement] = []
beforeEach ->
editor = atom.workspace.getActiveTextEditor()
editorElement = atom.views.getView(editor)
```
### Dispatching commands
Since the `editorElement` objects are no longer `jQuery` objects, they no longer support `trigger()`. Additionally, Atom has a new command dispatcher, `atom.commands`, that we use rather than commandeering jQuery's `trigger` method.
From this:
```coffee
# Old!
workspaceView.trigger 'a-package:toggle'
editorView.trigger 'find-and-replace:show'
```
To this:
```coffee
# New!
atom.commands.dispatch workspaceElement, 'a-package:toggle'
atom.commands.dispatch editorElement, 'find-and-replace:show'
```
## Eventing and Disposables
A couple large things changed with respect to events:
1. All model events are now exposed as event subscription methods that return [`Disposable`][disposable] objects
1. The `subscribe()` method is no longer available on `space-pen` `View` objects
1. An Emitter is now provided from `require 'atom'`
### Consuming Events
All events from the Atom API are now methods that return a [`Disposable`][disposable] object, on which you can call `dispose()` to unsubscribe.
```coffee
# Old!
editor.on 'changed', ->
```
```coffee
# New!
disposable = editor.onDidChange ->
# You can unsubscribe at some point in the future via `dispose()`
disposable.dispose()
```
Deprecation warnings will guide you toward the correct methods.
#### Using a CompositeDisposable
You can group multiple disposables into a single disposable with a `CompositeDisposable`.
```coffee
{CompositeDisposable} = require 'atom'
class Something
constructor: ->
editor = atom.workspace.getActiveTextEditor()
@disposables = new CompositeDisposable
@disposables.add editor.onDidChange ->
@disposables.add editor.onDidChangePath ->
destroy: ->
@disposables.dispose()
```
### Removing View::subscribe and Subscriber::subscribe calls
There were a couple permutations of `subscribe()`. In these examples, a `CompositeDisposable` is used as it will commonly be useful where conversion is necessary.
#### subscribe(unsubscribable)
This one is very straight forward.
```coffee
# Old!
@subscribe editor.on 'changed', ->
```
```coffee
# New!
disposables = new CompositeDisposable
disposables.add editor.onDidChange ->
```
#### subscribe(modelObject, event, method)
When the modelObject is an Atom model object, the change is very simple. Just use the correct event method, and add it to your CompositeDisposable.
```coffee
# Old!
@subscribe editor, 'changed', ->
```
```coffee
# New!
disposables = new CompositeDisposable
disposables.add editor.onDidChange ->
```
#### subscribe(jQueryObject, selector(optional), event, method)
Things are a little more complicated when subscribing to a DOM or jQuery element. Atom no longer provides helpers for subscribing to elements. You can use jQuery or the native DOM APIs, whichever you prefer.
```coffee
# Old!
@subscribe $(window), 'focus', ->
```
```coffee
# New!
{Disposable, CompositeDisposable} = require 'atom'
disposables = new CompositeDisposable
# New with jQuery
focusCallback = ->
$(window).on 'focus', focusCallback
disposables.add new Disposable ->
$(window).off 'focus', focusCallback
# New with native APIs
focusCallback = ->
window.addEventListener 'focus', focusCallback
disposables.add new Disposable ->
window.removeEventListener 'focus', focusCallback
```
### Providing Events: Using the Emitter
You no longer need to require `emissary` to get an emitter. We now provide an `Emitter` class from `require 'atom'`. We have a specific pattern for use of the `Emitter`. Rather than mixing it in, we instantiate a member variable, and create explicit subscription methods. For more information see the [`Emitter` docs][emitter].
```coffee
# New!
{Emitter} = require 'atom'
class Something
constructor: ->
@emitter = new Emitter
destroy: ->
@emitter.dispose()
onDidChange: (callback) ->
@emitter.on 'did-change', callback
methodThatFiresAChange: ->
@emitter.emit 'did-change', {data: 2}
# Using the evented class
something = new Something
something.onDidChange (eventObject) ->
console.log eventObject.data # => 2
something.methodThatFiresAChange()
```
## Subscribing To Commands
`$.fn.command` and `View::subscribeToCommand` are no longer available. Now we use `atom.commands.add`, and collect the results in a `CompositeDisposable`. See [the docs][commands-add] for more info.
```coffee
# Old!
atom.workspaceView.command 'core:close core:cancel', ->
# When inside a View class, you might see this
@subscribeToCommand 'core:close core:cancel', ->
```
```coffee
# New!
@disposables.add atom.commands.add 'atom-workspace',
'core:close': ->
'core:cancel': ->
# You can register commands directly on individual DOM elements in addition to
# using selectors. When in a View class, you should have a `@element` object
# available. `@element` is a plain HTMLElement object
@disposables.add atom.commands.add @element,
'core:close': ->
'core:cancel': ->
```
## Upgrading your stylesheet's selectors
Many selectors have changed, and we have introduced the [Shadow DOM][shadowdom] to the editor. See [Upgrading Your Package Selectors guide][upgrading-selectors] for more information in upgrading your package stylesheets.
## Help us improve this guide!
Did you hit something painful that wasn't in here? Want to reword some bit of it? Find something incorrect? Please edit [this file][guide], and send a pull request. Contributions are greatly appreciated.
[texteditorview]:https://github.com/atom/atom-space-pen-views#texteditorview
[scrollview]:https://github.com/atom/atom-space-pen-views#scrollview
[selectlistview]:https://github.com/atom/atom-space-pen-views#selectlistview
[selectlistview-example]:https://github.com/atom/command-palette/pull/19/files
[emitter]:https://atom.io/docs/api/latest/Emitter
[texteditor]:https://atom.io/docs/api/latest/TextEditor
[disposable]:https://atom.io/docs/api/latest/Disposable
[commands-add]:https://atom.io/docs/api/latest/CommandRegistry#instance-add
[upgrading-selectors]:upgrading-your-ui-theme
[shadowdom]:http://blog.atom.io/2014/11/18/avoiding-style-pollution-with-the-shadow-dom.html
[guide]:https://github.com/atom/atom/blob/master/docs/upgrading/upgrading-your-package.md
+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... */
}
```
+4 -4
Ver Arquivo
@@ -1,6 +1,6 @@
# Upgrading Your UI Theme Or Package Selectors
In addition to changes in Atom's scripting API, we'll also be making some breaking changes to Atom's DOM structure, requiring stylesheets and keymaps in both packages and themes to be updated.
In addition to changes in Atom's scripting API, we'll also be making some breaking changes to Atom's DOM structure, requiring style sheets and keymaps in both packages and themes to be updated.
## Deprecation Cop
@@ -121,12 +121,12 @@ The selector features discussed above allow you to target shadow DOM content wit
```
my-ui-theme/
stylesheets/
styles/
index.less # loaded globally
index.atom-text-editor.less # loaded in the text editor shadow DOM
```
Check out this [style sheet](https://github.com/atom/decoration-example/blob/master/stylesheets/decoration-example.atom-text-editor.less) from the decoration-example package for an example of context-targeting.
Check out this [style sheet](https://github.com/atom/decoration-example/blob/master/styles/decoration-example.atom-text-editor.less) from the decoration-example package for an example of context-targeting.
Inside a context-targeted style sheet, there's no need to use the `::shadow` or `/deep/` expressions. If you want to refer to the element containing the shadow root, you can use the `::host` pseudo-element.
@@ -134,4 +134,4 @@ During the transition phase, style sheets targeting the `atom-text-editor` conte
[shadow-dom-101]: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom
[shadow-dom-201]: http://www.html5rocks.com/en/tutorials/webcomponents/shadowdom-201#toc-style-cat-hat
[find-and-replace]: https://github.com/atom/find-and-replace/blob/95351f261bc384960a69b66bf12eae8002da63f9/stylesheets/find-and-replace.less#L10
[find-and-replace]: https://github.com/atom/find-and-replace/blob/95351f261bc384960a69b66bf12eae8002da63f9/styles/find-and-replace.less#L10
+7
Ver Arquivo
@@ -127,3 +127,10 @@ describe "when a test is written", ->
expect("apples").toEqual("apples")
expect("oranges").not.toEqual("apples")
```
### Running on CI
It is now easy to run the specs in a CI environment like Travis and AppVeyor. See the
[Travis CI For Your Packages](http://blog.atom.io/2014/04/25/ci-for-your-packages.html)
and [AppVeyor CI For Your Packages](http://blog.atom.io/2014/07/28/windows-ci-for-your-packages.html)
posts for more details.
+4 -4
Ver Arquivo
@@ -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
+2 -2
Ver Arquivo
@@ -1,7 +1,7 @@
# Your keymap
#
# Atom keymaps work similarly to stylesheets. Just as stylesheets use selectors
# to apply styles to elements, Atom keymaps use selectors to associate
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts.
#
# You can create a new keybinding in this file by typing "key" and then hitting
+5 -1
Ver Arquivo
@@ -12,10 +12,14 @@
}
// style the background and foreground colors on the atom-text-editor-element
// itself
atom-text-editor {
}
atom-text-editor .cursor {
// To style other content in the text editor's shadow DOM, use the ::shadow
// expression
atom-text-editor::shadow .cursor {
}
+16 -16
Ver Arquivo
@@ -40,11 +40,11 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Object.defineProperty module.exports, '$', get: ->
deprecate """
Requiring `$` from `atom` is no longer supported.
If you are using `space-pen`, please require `$` from `space-pen`. Otherwise require `jquery` instead:
`{$} = require 'space-pen'`
If you are using `space-pen`, please require `$` from `atom-space-pen-views`. Otherwise require `jquery` instead:
`{$} = require 'atom-space-pen-views'`
or
`$ = require 'jquery'`
Add `"space-pen": "^4"` to your package dependencies.
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
Or add `"jquery": "^2"` to your package dependencies.
"""
$
@@ -52,27 +52,27 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Object.defineProperty module.exports, '$$', get: ->
deprecate """
Requiring `$$` from `atom` is no longer supported.
Please require `space-pen` instead:
`{$$} = require 'space-pen'`
Add `"space-pen": "^4"` to your package dependencies.
Please require `atom-space-pen-views` instead:
`{$$} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
$$
Object.defineProperty module.exports, '$$$', get: ->
deprecate """
Requiring `$$$` from `atom` is no longer supported.
Please require `space-pen` instead:
`{$$$} = require 'space-pen'`
Add `"space-pen": "^4"` to your package dependencies.
Please require `atom-space-pen-views` instead:
`{$$$} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
$$$
Object.defineProperty module.exports, 'View', get: ->
deprecate """
Requiring `View` from `atom` is no longer supported.
Please require `space-pen` instead:
`{View} = require 'space-pen'`
Add `"space-pen": "^4"` to your package dependencies.
Please require `atom-space-pen-views` instead:
`{View} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
View
@@ -81,7 +81,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Requiring `EditorView` from `atom` is no longer supported.
Please require `TextEditorView` from `atom-space-pen-view` instead:
`{TextEditorView} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^0"` to your package dependencies.
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
require '../src/text-editor-view'
@@ -90,7 +90,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Requiring `TextEditorView` from `atom` is no longer supported.
Please require `TextEditorView` from `atom-space-pen-view` instead:
`{TextEditorView} = require 'atom-space-pen-views'`
Add `"atom-space-pen-views": "^0"` to your package dependencies.
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
require '../src/text-editor-view'
@@ -100,7 +100,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Please require `ScrollView` from `atom-space-pen-view` instead:
`{ScrollView} = require 'atom-space-pen-views'`
Note that the API has changed slightly! Please read the docs at https://github.com/atom/atom-space-pen-views
Add `"atom-space-pen-views": "^0"` to your package dependencies.
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
require '../src/scroll-view'
@@ -110,7 +110,7 @@ unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE
Please require `SelectListView` from `atom-space-pen-view` instead:
`{SelectListView} = require 'atom-space-pen-views'`
Note that the API has changed slightly! Please read the docs at https://github.com/atom/atom-space-pen-views
Add `"atom-space-pen-views": "^0"` to your package dependencies.
Add `"atom-space-pen-views": "^2.0.3"` to your package dependencies.
"""
require '../src/select-list-view'
+93 -87
Ver Arquivo
@@ -1,7 +1,7 @@
{
"name": "atom",
"productName": "Atom",
"version": "0.165.0",
"version": "0.177.0",
"description": "A hackable text editor for the 21st Century.",
"main": "./src/browser/main.js",
"repository": {
@@ -17,135 +17,141 @@
"url": "http://github.com/atom/atom/raw/master/LICENSE.md"
}
],
"atomShellVersion": "0.19.4",
"atomShellVersion": "0.20.7",
"dependencies": {
"async": "0.2.6",
"atom-keymap": "^2.3.0",
"atom-keymap": "^2.5.2",
"bootstrap": "git+https://github.com/atom/bootstrap.git#6af81906189f1747fd6c93479e3d998ebe041372",
"clear-cut": "0.4.0",
"coffee-script": "1.7.0",
"coffeestack": "0.7.0",
"coffee-script": "1.8.0",
"coffeestack": "0.8.0",
"color": "^0.7.3",
"delegato": "^1",
"emissary": "^1.3.1",
"event-kit": "0.8.1",
"first-mate": "^2.2.0",
"event-kit": "^1.0.1",
"first-mate": "^2.2.5",
"fs-plus": "^2.3.2",
"fstream": "0.1.24",
"fuzzaldrin": "^2.1",
"git-utils": "^2.2",
"grim": "0.12.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": "git+https://github.com/atom/less-cache.git#018b1739ae03ee35aae9827d7d7b16d0799c5d42",
"marked": "^0.3",
"mixto": "^1",
"mkdirp": "0.3.5",
"nslog": "^1.0.1",
"oniguruma": "^3.0.4",
"oniguruma": "^3.0.6",
"optimist": "0.4.0",
"pathwatcher": "^2.3.5",
"pathwatcher": "^2.6.1",
"property-accessors": "^1",
"q": "^1.0.1",
"random-words": "0.0.1",
"react-atom-fork": "^0.11.1",
"react-atom-fork": "^0.11.4",
"reactionary-atom-fork": "^1.0.0",
"runas": "1.0.1",
"scandal": "1.0.3",
"scoped-property-store": "^0.15.4",
"scoped-property-store": "^0.16.2",
"scrollbar-style": "^1.0.2",
"season": "^1.0.2",
"season": "^5.1.1",
"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.8.2",
"text-buffer": "^3.10.1",
"theorist": "^1.0.2",
"underscore-plus": "^1.6.6",
"vm-compatibility-layer": "0.1.0"
},
"packageDependencies": {
"atom-dark-syntax": "0.23.0",
"atom-dark-ui": "0.42.0",
"atom-light-syntax": "0.22.0",
"atom-light-ui": "0.36.0",
"base16-tomorrow-dark-theme": "0.22.0",
"base16-tomorrow-light-theme": "0.5.0",
"solarized-dark-syntax": "0.29.0",
"solarized-light-syntax": "0.13.0",
"archive-view": "0.40.0",
"autocomplete": "0.34.0",
"autoflow": "0.20.0",
"autosave": "0.19.0",
"background-tips": "0.18.0",
"bookmarks": "0.31.0",
"bracket-matcher": "0.64.0",
"command-palette": "0.30.0",
"deprecation-cop": "0.20.0",
"dev-live-reload": "0.36.0",
"encoding-selector": "0.12.0",
"atom-dark-syntax": "0.26.0",
"atom-dark-ui": "0.46.0",
"atom-light-syntax": "0.26.0",
"atom-light-ui": "0.40.0",
"base16-tomorrow-dark-theme": "0.25.0",
"base16-tomorrow-light-theme": "0.8.0",
"one-dark-ui": "0.2.0",
"one-dark-syntax": "0.2.0",
"one-light-syntax": "0.2.0",
"one-light-ui": "0.1.0",
"solarized-dark-syntax": "0.32.0",
"solarized-light-syntax": "0.19.0",
"archive-view": "0.44.0",
"autocomplete": "0.43.0",
"autoflow": "0.21.0",
"autosave": "0.20.0",
"background-tips": "0.21.0",
"bookmarks": "0.35.0",
"bracket-matcher": "0.69.0",
"command-palette": "0.34.0",
"deprecation-cop": "0.33.0",
"dev-live-reload": "0.39.0",
"encoding-selector": "0.17.0",
"exception-reporting": "0.21.0",
"find-and-replace": "0.152.0",
"fuzzy-finder": "0.62.0",
"git-diff": "0.45.0",
"go-to-line": "0.27.0",
"grammar-selector": "0.40.0",
"image-view": "0.44.0",
"incompatible-packages": "0.16.0",
"keybinding-resolver": "0.24.0",
"link": "0.28.0",
"markdown-preview": "0.112.0",
"metrics": "0.40.0",
"notifications": "0.21.0",
"open-on-github": "0.31.0",
"package-generator": "0.34.0",
"release-notes": "0.43.0",
"settings-view": "0.161.0",
"snippets": "0.60.0",
"spell-check": "0.45.0",
"status-bar": "0.54.0",
"styleguide": "0.36.0",
"symbols-view": "0.70.0",
"tabs": "0.58.0",
"timecop": "0.24.0",
"tree-view": "0.139.0",
"find-and-replace": "0.156.0",
"fuzzy-finder": "0.65.0",
"git-diff": "0.50.0",
"go-to-line": "0.30.0",
"grammar-selector": "0.44.0",
"image-view": "0.47.0",
"incompatible-packages": "0.21.0",
"keybinding-resolver": "0.27.0",
"link": "0.29.0",
"markdown-preview": "0.126.0",
"metrics": "0.41.0",
"notifications": "0.26.0",
"open-on-github": "0.32.0",
"package-generator": "0.37.0",
"release-notes": "0.47.0",
"settings-view": "0.174.0",
"snippets": "0.70.0",
"spell-check": "0.51.0",
"status-bar": "0.58.0",
"styleguide": "0.42.0",
"symbols-view": "0.79.0",
"tabs": "0.64.0",
"timecop": "0.28.0",
"tree-view": "0.149.0",
"update-package-dependencies": "0.7.0",
"welcome": "0.21.0",
"whitespace": "0.27.0",
"wrap-guide": "0.27.0",
"language-c": "0.33.0",
"language-clojure": "0.9.0",
"language-coffee-script": "0.38.1",
"language-css": "0.24.0",
"language-gfm": "0.55.0",
"language-git": "0.9.0",
"language-go": "0.19.1",
"language-html": "0.27.0",
"whitespace": "0.28.0",
"wrap-guide": "0.31.0",
"language-c": "0.37.0",
"language-clojure": "0.10.0",
"language-coffee-script": "0.39.0",
"language-css": "0.26.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.13.0",
"language-javascript": "0.51.0",
"language-json": "0.10.0",
"language-less": "0.21.0",
"language-make": "0.12.0",
"language-java": "0.14.0",
"language-javascript": "0.55.0",
"language-json": "0.11.0",
"language-less": "0.24.0",
"language-make": "0.13.0",
"language-mustache": "0.11.0",
"language-objective-c": "0.12.0",
"language-perl": "0.9.0",
"language-php": "0.18.0",
"language-property-list": "0.7.0",
"language-python": "0.26.0",
"language-ruby": "0.45.0",
"language-objective-c": "0.15.0",
"language-perl": "0.10.0",
"language-php": "0.20.0",
"language-property-list": "0.8.0",
"language-python": "0.30.0",
"language-ruby": "0.47.0",
"language-ruby-on-rails": "0.18.0",
"language-sass": "0.29.0",
"language-shellscript": "0.10.1",
"language-source": "0.8.0",
"language-sql": "0.11.0",
"language-sass": "0.31.0",
"language-shellscript": "0.12.0",
"language-source": "0.9.0",
"language-sql": "0.14.0",
"language-text": "0.6.0",
"language-todo": "0.15.0",
"language-toml": "0.14.1",
"language-xml": "0.25.0",
"language-yaml": "0.21.0"
"language-toml": "0.15.0",
"language-xml": "0.27.0",
"language-yaml": "0.22.0"
},
"private": true,
"scripts": {
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 284 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 628 KiB

Arquivo binário não exibido.
Arquivo binário não exibido.
+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" %*
)
Arquivo binário não exibido.

Antes

Largura:  |  Altura:  |  Tamanho: 141 KiB

Depois

Largura:  |  Altura:  |  Tamanho: 182 KiB

+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
@@ -117,7 +117,7 @@ class AtomReporter extends View
@div class: 'result-message fail deprecation-message', =>
@raw marked(deprecation.message)
for stack in deprecation.stacks
for stack in deprecation.getStacks()
fullStack = stack.map ({functionName, location}) ->
if functionName is '<unknown>'
" at #{location}"
+1173 -835
Ver Arquivo
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+9 -4
Ver Arquivo
@@ -351,11 +351,16 @@ describe "DisplayBuffer", ->
expect(displayBuffer.tokenizedLineForScreenRow(1).text).toMatch /^10/
describe "when there is another display buffer pointing to the same buffer", ->
it "does not create folds in the other display buffer", ->
it "does not consider folds to be nested inside of folds from the other display buffer", ->
otherDisplayBuffer = new DisplayBuffer({buffer, tabLength})
otherDisplayBuffer.createFold(1, 5)
displayBuffer.createFold(2, 4)
expect(otherDisplayBuffer.foldsStartingAtBufferRow(2).length).toBe 0
expect(displayBuffer.tokenizedLineForScreenRow(2).text).toBe '2'
expect(displayBuffer.tokenizedLineForScreenRow(3).text).toBe '5'
describe "when the buffer changes", ->
[fold1, fold2] = []
beforeEach ->
@@ -1058,7 +1063,7 @@ describe "DisplayBuffer", ->
[marker, decoration, decorationProperties] = []
beforeEach ->
marker = displayBuffer.markBufferRange([[2, 13], [3, 15]])
decorationProperties = {type: 'gutter', class: 'one'}
decorationProperties = {type: 'line-number', class: 'one'}
decoration = displayBuffer.decorateMarker(marker, decorationProperties)
it "can add decorations associated with markers and remove them", ->
@@ -1079,11 +1084,11 @@ describe "DisplayBuffer", ->
describe "when a decoration is updated via Decoration::update()", ->
it "emits an 'updated' event containing the new and old params", ->
decoration.onDidChangeProperties updatedSpy = jasmine.createSpy()
decoration.setProperties type: 'gutter', class: 'two'
decoration.setProperties type: 'line-number', class: 'two'
{oldProperties, newProperties} = updatedSpy.mostRecentCall.args[0]
expect(oldProperties).toEqual decorationProperties
expect(newProperties).toEqual type: 'gutter', class: 'two', id: decoration.id
expect(newProperties).toEqual type: 'line-number', class: 'two', id: decoration.id
describe "::getDecorations(properties)", ->
it "returns decorations matching the given optional properties", ->
@@ -9,5 +9,3 @@ module.exports =
two:
type: 'integer'
default: 2
activate: -> # no-op
@@ -0,0 +1,5 @@
class TestItem
getUri: -> "test"
exports.activate = ->
atom.workspace.addOpener -> new TestItem
@@ -0,0 +1,4 @@
{
"name": "package-with-empty-keymap",
"version": "1.0.0"
}
@@ -0,0 +1,4 @@
{
"name": "package-with-empty-menu",
"version": "1.0.0"
}
@@ -0,0 +1 @@
styleSheets: ['2', '1']
@@ -1 +1 @@
stylesheets: ['2', '1']
styleSheets: ['2', '1']
@@ -1,4 +1,4 @@
{
"theme": "ui",
"stylesheets": ["editor.less"]
"styleSheets": ["editor.less"]
}
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
{
"theme": "ui",
"stylesheets": ["first.css", "second.less", "last.css"]
"styleSheets": ["first.css", "second.less", "last.css"]
}
@@ -1,4 +1,4 @@
{
"theme": "syntax",
"stylesheets": ["editor.less"]
"styleSheets": ["editor.less"]
}
+1 -1
Ver Arquivo
@@ -1,4 +1,4 @@
{
"theme": "ui",
"stylesheets": ["editor.less"]
"styleSheets": ["editor.less"]
}
+1
Ver Arquivo
@@ -1,2 +1,3 @@
module.exports = ->
emit("some-event", 1, 2, 3)
'hello'
+17
Ver Arquivo
@@ -381,6 +381,23 @@ describe "LanguageMode", ->
expect(languageMode.isFoldableAtBufferRow(3)).toBe false
expect(languageMode.isFoldableAtBufferRow(4)).toBe true
describe ".foldAllAtIndentLevel(indentLevel)", ->
it "folds blocks of text at the given indentation level", ->
languageMode.foldAllAtIndentLevel(0)
expect(editor.lineTextForScreenRow(0)).toBe "var quicksort = function () {"
expect(editor.getLastScreenRow()).toBe 0
languageMode.foldAllAtIndentLevel(1)
expect(editor.lineTextForScreenRow(0)).toBe "var quicksort = function () {"
expect(editor.lineTextForScreenRow(1)).toBe " var sort = function(items) {"
expect(editor.getLastScreenRow()).toBe 4
languageMode.foldAllAtIndentLevel(2)
expect(editor.lineTextForScreenRow(0)).toBe "var quicksort = function () {"
expect(editor.lineTextForScreenRow(1)).toBe " var sort = function(items) {"
expect(editor.lineTextForScreenRow(2)).toBe " if (items.length <= 1) return items;"
expect(editor.getLastScreenRow()).toBe 9
describe "folding with comments", ->
beforeEach ->
waitsForPromise ->
Diferenças do arquivo suprimidas por serem muito extensas Carregar Diff
+8 -8
Ver Arquivo
@@ -9,14 +9,14 @@ describe "Package", ->
spyOn(atom, 'inDevMode').andReturn(false)
it "does not activate it", ->
packagePath = atom.project.resolve('packages/package-with-incompatible-native-module')
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module')
pack = new Package(packagePath)
expect(pack.isCompatible()).toBe false
expect(pack.incompatibleModules[0].name).toBe 'native-module'
expect(pack.incompatibleModules[0].path).toBe path.join(packagePath, 'node_modules', 'native-module')
it "caches the incompatible native modules in local storage", ->
packagePath = atom.project.resolve('packages/package-with-incompatible-native-module')
packagePath = atom.project.getDirectories()[0]?.resolve('packages/package-with-incompatible-native-module')
cacheKey = null
cacheItem = null
@@ -46,14 +46,14 @@ describe "Package", ->
describe "when the theme contains a single style file", ->
it "loads and applies css", ->
expect($("atom-text-editor").css("padding-bottom")).not.toBe "1234px"
themePath = atom.project.resolve('packages/theme-with-index-css')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-index-css')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe "1234px"
it "parses, loads and applies less", ->
expect($("atom-text-editor").css("padding-bottom")).not.toBe "1234px"
themePath = atom.project.resolve('packages/theme-with-index-less')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-index-less')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe "4321px"
@@ -64,7 +64,7 @@ describe "Package", ->
expect($("atom-text-editor").css("padding-right")).not.toBe("102px")
expect($("atom-text-editor").css("padding-bottom")).not.toBe("103px")
themePath = atom.project.resolve('packages/theme-with-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe("101px")
@@ -77,7 +77,7 @@ describe "Package", ->
expect($("atom-text-editor").css("padding-right")).not.toBe "20px"
expect($("atom-text-editor").css("padding-bottom")).not.toBe "30px"
themePath = atom.project.resolve('packages/theme-without-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-without-package-file')
theme = new ThemePackage(themePath)
theme.activate()
expect($("atom-text-editor").css("padding-top")).toBe "10px"
@@ -86,7 +86,7 @@ describe "Package", ->
describe "reloading a theme", ->
beforeEach ->
themePath = atom.project.resolve('packages/theme-with-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file')
theme = new ThemePackage(themePath)
theme.activate()
@@ -97,7 +97,7 @@ describe "Package", ->
describe "events", ->
beforeEach ->
themePath = atom.project.resolve('packages/theme-with-package-file')
themePath = atom.project.getDirectories()[0]?.resolve('packages/theme-with-package-file')
theme = new ThemePackage(themePath)
theme.activate()
+1 -1
Ver Arquivo
@@ -129,7 +129,7 @@ describe "PaneContainer", ->
beforeEach ->
class TestItem
shouldPromptToSave: -> true
getUri: -> 'test'
getURI: -> 'test'
container = new PaneContainer
container.getRoot().splitRight()
+1 -1
Ver Arquivo
@@ -16,7 +16,7 @@ describe "PaneContainerView", ->
@content: -> @div tabindex: -1
initialize: (@name) -> @text(@name)
serialize: -> { deserializer: 'TestView', @name }
getUri: -> path.join(temp.dir, @name)
getURI: -> path.join(temp.dir, @name)
save: -> @saved = true
isEqual: (other) -> @name is other?.name
onDidChangeTitle: -> new Disposable(->)
+12 -12
Ver Arquivo
@@ -9,7 +9,7 @@ describe "Pane", ->
class Item extends Model
@deserialize: ({name, uri}) -> new this(name, uri)
constructor: (@name, @uri) ->
getUri: -> @uri
getURI: -> @uri
getPath: -> @path
serialize: -> {deserializer: 'Item', @name, @uri}
isEqual: (other) -> @name is other?.name
@@ -231,18 +231,18 @@ describe "Pane", ->
expect(pane.getActiveItem()).toBe item1
describe "if the item is modified", ->
itemUri = null
itemURI = null
beforeEach ->
item1.shouldPromptToSave = -> true
item1.save = jasmine.createSpy("save")
item1.saveAs = jasmine.createSpy("saveAs")
item1.getUri = -> itemUri
item1.getURI = -> itemURI
describe "if the [Save] option is selected", ->
describe "when the item has a uri", ->
it "saves the item before destroying it", ->
itemUri = "test"
itemURI = "test"
spyOn(atom, 'confirm').andReturn(0)
pane.destroyItem(item1)
@@ -252,7 +252,7 @@ describe "Pane", ->
describe "when the item has no uri", ->
it "presents a save-as dialog, then saves the item with the given uri before removing and destroying it", ->
itemUri = null
itemURI = null
spyOn(atom, 'showSaveDialogSync').andReturn("/selected/path")
spyOn(atom, 'confirm').andReturn(0)
@@ -404,15 +404,15 @@ describe "Pane", ->
pane.saveActiveItemAs()
expect(atom.showSaveDialogSync).not.toHaveBeenCalled()
describe "::itemForUri(uri)", ->
it "returns the item for which a call to .getUri() returns the given uri", ->
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")])
[item1, item2, item3] = pane.getItems()
item1.uri = "a"
item2.uri = "b"
expect(pane.itemForUri("a")).toBe item1
expect(pane.itemForUri("b")).toBe item2
expect(pane.itemForUri("bogus")).toBeUndefined()
expect(pane.itemForURI("a")).toBe item1
expect(pane.itemForURI("b")).toBe item2
expect(pane.itemForURI("bogus")).toBeUndefined()
describe "::moveItem(item, index)", ->
[pane, item1, item2, item3, item4] = []
@@ -589,7 +589,7 @@ describe "Pane", ->
[item1, item2] = pane.getItems()
item1.shouldPromptToSave = -> true
item1.getUri = -> "/test/path"
item1.getURI = -> "/test/path"
item1.save = jasmine.createSpy("save")
spyOn(atom, 'confirm').andReturn(0)
@@ -604,7 +604,7 @@ describe "Pane", ->
[item1, item2] = pane.getItems()
item1.shouldPromptToSave = -> true
item1.getUri = -> "/test/path"
item1.getURI = -> "/test/path"
item1.save = jasmine.createSpy("save")
spyOn(atom, 'confirm').andReturn(1)
+1 -1
Ver Arquivo
@@ -15,7 +15,7 @@ describe "PaneView", ->
initialize: ({@id, @text}) ->
@emitter = new Emitter
serialize: -> { deserializer: 'TestView', @id, @text }
getUri: -> @id
getURI: -> @id
isEqual: (other) -> other? and @id == other.id and @text == other.text
changeTitle: ->
@emitter.emit 'did-change-title', 'title'
+51 -308
Ver Arquivo
@@ -4,12 +4,11 @@ Project = require '../src/project'
_ = require 'underscore-plus'
fs = require 'fs-plus'
path = require 'path'
platform = require './spec-helper-platform'
BufferedProcess = require '../src/buffered-process'
describe "Project", ->
beforeEach ->
atom.project.setPaths([atom.project.resolve('dir')])
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])
describe "serialization", ->
deserializedProject = null
@@ -38,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
@@ -52,6 +77,29 @@ describe "Project", ->
editor.saveAs(tempFile)
expect(atom.project.getPaths()[0]).toBe path.dirname(tempFile)
describe "when a watch error is thrown from the TextBuffer", ->
editor = null
beforeEach ->
waitsForPromise ->
atom.project.open(require.resolve('./fixtures/dir/a')).then (o) -> editor = o
it "creates a warning notification", ->
atom.notifications.onDidAddNotification noteSpy = jasmine.createSpy()
error = new Error('SomeError')
error.eventType = 'resurrect'
editor.buffer.emitter.emit 'will-throw-watch-error',
handle: jasmine.createSpy()
error: error
expect(noteSpy).toHaveBeenCalled()
notification = noteSpy.mostRecentCall.args[0]
expect(notification.getType()).toBe 'warning'
expect(notification.getDetail()).toBe 'SomeError'
expect(notification.getMessage()).toContain '`resurrect`'
expect(notification.getMessage()).toContain 'fixtures/dir/a'
describe ".open(path)", ->
[absolutePath, newBufferHandler] = []
@@ -110,7 +158,7 @@ describe "Project", ->
expect(newBufferHandler).toHaveBeenCalledWith(editor.buffer)
it "returns number of read bytes as progress indicator", ->
filePath = atom.project.resolve 'a'
filePath = atom.project.getDirectories()[0]?.resolve 'a'
totalBytes = 0
promise = atom.project.open(filePath)
promise.progress (bytesRead) -> totalBytes = bytesRead
@@ -149,27 +197,6 @@ describe "Project", ->
atom.project.bufferForPath("b").then (anotherBuffer) ->
expect(anotherBuffer).not.toBe buffer
describe ".resolve(uri)", ->
describe "when passed an absolute or relative path", ->
it "returns an absolute path based on the atom.project's root", ->
absolutePath = require.resolve('./fixtures/dir/a')
expect(atom.project.resolve('a')).toBe absolutePath
expect(atom.project.resolve(absolutePath + '/../a')).toBe absolutePath
expect(atom.project.resolve('a/../a')).toBe absolutePath
expect(atom.project.resolve()).toBeUndefined()
describe "when passed a uri with a scheme", ->
it "does not modify uris that begin with a scheme", ->
expect(atom.project.resolve('http://zombo.com')).toBe 'http://zombo.com'
describe "when the project has no path", ->
it "returns undefined for relative URIs", ->
atom.project.setPaths([])
expect(atom.project.resolve('test.txt')).toBeUndefined()
expect(atom.project.resolve('http://github.com')).toBe 'http://github.com'
absolutePath = fs.absolute(__dirname)
expect(atom.project.resolve(absolutePath)).toBe absolutePath
describe ".setPaths(path)", ->
describe "when path is a file", ->
it "sets its path to the files parent directory and updates the root directory", ->
@@ -195,290 +222,6 @@ describe "Project", ->
expect(atom.project.getPaths()[0]).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
expect(atom.project.getDirectories()[0].path).toEqual path.dirname(require.resolve('./fixtures/dir/a'))
describe ".replace()", ->
[filePath, commentFilePath, sampleContent, sampleCommentContent] = []
beforeEach ->
atom.project.setPaths([atom.project.resolve('../')])
filePath = atom.project.resolve('sample.js')
commentFilePath = atom.project.resolve('sample-with-comments.js')
sampleContent = fs.readFileSync(filePath).toString()
sampleCommentContent = fs.readFileSync(commentFilePath).toString()
afterEach ->
fs.writeFileSync(filePath, sampleContent)
fs.writeFileSync(commentFilePath, sampleCommentContent)
describe "when a file doesn't exist", ->
it "calls back with an error", ->
errors = []
missingPath = path.resolve('/not-a-file.js')
expect(fs.existsSync(missingPath)).toBeFalsy()
waitsForPromise ->
atom.project.replace /items/gi, 'items', [missingPath], (result, error) ->
errors.push(error)
runs ->
expect(errors).toHaveLength 1
expect(errors[0].path).toBe missingPath
describe "when called with unopened files", ->
it "replaces properly", ->
results = []
waitsForPromise ->
atom.project.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
describe "when a buffer is already open", ->
it "replaces properly and saves when not modified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
expect(editor.isModified()).toBeFalsy()
waitsForPromise ->
atom.project.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeFalsy()
it "does not replace when the path is not specified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('sample-with-comments.js').then (o) -> editor = o
waitsForPromise ->
atom.project.replace /items/gi, 'items', [commentFilePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe commentFilePath
it "does NOT save when modified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
editor.buffer.setTextInRange([[0,0],[0,0]], 'omg')
expect(editor.isModified()).toBeTruthy()
waitsForPromise ->
atom.project.replace /items/gi, 'okthen', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeTruthy()
describe ".scan(options, callback)", ->
describe "when called with a regex", ->
it "calls the callback with all regex results in all files in the project", ->
results = []
waitsForPromise ->
atom.project.scan /(a)+/, (result) ->
results.push(result)
runs ->
expect(results).toHaveLength(3)
expect(results[0].filePath).toBe atom.project.resolve('a')
expect(results[0].matches).toHaveLength(3)
expect(results[0].matches[0]).toEqual
matchText: 'aaa'
lineText: 'aaa bbb'
lineTextOffset: 0
range: [[0, 0], [0, 3]]
it "works with with escaped literals (like $ and ^)", ->
results = []
waitsForPromise ->
atom.project.scan /\$\w+/, (result) -> results.push(result)
runs ->
expect(results.length).toBe 1
{filePath, matches} = results[0]
expect(filePath).toBe atom.project.resolve('a')
expect(matches).toHaveLength 1
expect(matches[0]).toEqual
matchText: '$bill'
lineText: 'dollar$bill'
lineTextOffset: 0
range: [[2, 6], [2, 11]]
it "works on evil filenames", ->
platform.generateEvilFiles()
atom.project.setPaths([path.join(__dirname, 'fixtures', 'evil-files')])
paths = []
matches = []
waitsForPromise ->
atom.project.scan /evil/, (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
runs ->
_.each(matches, (m) -> expect(m.matchText).toEqual 'evil')
if platform.isWindows()
expect(paths.length).toBe 3
expect(paths[0]).toMatch /a_file_with_utf8.txt$/
expect(paths[1]).toMatch /file with spaces.txt$/
expect(path.basename(paths[2])).toBe "utfa\u0306.md"
else
expect(paths.length).toBe 5
expect(paths[0]).toMatch /a_file_with_utf8.txt$/
expect(paths[1]).toMatch /file with spaces.txt$/
expect(paths[2]).toMatch /goddam\nnewlines$/m
expect(paths[3]).toMatch /quote".txt$/m
expect(path.basename(paths[4])).toBe "utfa\u0306.md"
it "ignores case if the regex includes the `i` flag", ->
results = []
waitsForPromise ->
atom.project.scan /DOLLAR/i, (result) -> results.push(result)
runs ->
expect(results).toHaveLength 1
describe "when the core.excludeVcsIgnoredPaths config is truthy", ->
[projectPath, ignoredPath] = []
beforeEach ->
sourceProjectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
projectPath = path.join(temp.mkdirSync("atom"))
writerStream = fstream.Writer(projectPath)
fstream.Reader(sourceProjectPath).pipe(writerStream)
waitsFor (done) ->
writerStream.on 'close', done
writerStream.on 'error', done
runs ->
fs.rename(path.join(projectPath, 'git.git'), path.join(projectPath, '.git'))
ignoredPath = path.join(projectPath, 'ignored.txt')
fs.writeFileSync(ignoredPath, 'this match should not be included')
afterEach ->
fs.removeSync(projectPath) if fs.existsSync(projectPath)
it "excludes ignored files", ->
atom.project.setPaths([projectPath])
atom.config.set('core.excludeVcsIgnoredPaths', true)
resultHandler = jasmine.createSpy("result found")
waitsForPromise ->
atom.project.scan /match/, (results) ->
resultHandler()
runs ->
expect(resultHandler).not.toHaveBeenCalled()
it "includes only files when a directory filter is specified", ->
projectPath = path.join(path.join(__dirname, 'fixtures', 'dir'))
atom.project.setPaths([projectPath])
filePath = path.join(projectPath, 'a-dir', 'oh-git')
paths = []
matches = []
waitsForPromise ->
atom.project.scan /aaa/, paths: ["a-dir#{path.sep}"], (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
runs ->
expect(paths.length).toBe 1
expect(paths[0]).toBe filePath
expect(matches.length).toBe 1
it "includes files and folders that begin with a '.'", ->
projectPath = temp.mkdirSync()
filePath = path.join(projectPath, '.text')
fs.writeFileSync(filePath, 'match this')
atom.project.setPaths([projectPath])
paths = []
matches = []
waitsForPromise ->
atom.project.scan /match this/, (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
runs ->
expect(paths.length).toBe 1
expect(paths[0]).toBe filePath
expect(matches.length).toBe 1
it "excludes values in core.ignoredNames", ->
projectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
ignoredNames = atom.config.get("core.ignoredNames")
ignoredNames.push("a")
atom.config.set("core.ignoredNames", ignoredNames)
resultHandler = jasmine.createSpy("result found")
waitsForPromise ->
atom.project.scan /dollar/, (results) ->
resultHandler()
runs ->
expect(resultHandler).not.toHaveBeenCalled()
it "scans buffer contents if the buffer is modified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('a').then (o) ->
editor = o
editor.setText("Elephant")
waitsForPromise ->
atom.project.scan /a|Elephant/, (result) -> results.push result
runs ->
expect(results).toHaveLength 3
resultForA = _.find results, ({filePath}) -> path.basename(filePath) == 'a'
expect(resultForA.matches).toHaveLength 1
expect(resultForA.matches[0].matchText).toBe 'Elephant'
it "ignores buffers outside the project", ->
editor = null
results = []
waitsForPromise ->
atom.project.open(temp.openSync().path).then (o) ->
editor = o
editor.setText("Elephant")
waitsForPromise ->
atom.project.scan /Elephant/, (result) -> results.push result
runs ->
expect(results).toHaveLength 0
describe ".eachBuffer(callback)", ->
beforeEach ->
atom.project.bufferForPathSync('a')
+19 -10
Ver Arquivo
@@ -84,6 +84,10 @@ beforeEach ->
atom.workspaceViewParentSelector = '#jasmine-content'
window.resetTimeouts()
spyOn(_._, "now").andCallFake -> window.now
spyOn(window, "setTimeout").andCallFake window.fakeSetTimeout
spyOn(window, "clearTimeout").andCallFake window.fakeClearTimeout
atom.packages.packageStates = {}
serializedWindowState = null
@@ -102,9 +106,9 @@ beforeEach ->
spyOn(atom.menu, 'sendToBrowserProcess')
# reset config before each spec; don't load or save from/to `config.json`
spyOn(Config::, 'load')
spyOn(Config::, 'save')
config = new Config({resourcePath, configDirPath: atom.getConfigDirPath()})
spyOn(config, 'load')
spyOn(config, 'save')
atom.config = config
atom.loadConfig()
config.set "core.destroyEmptyPanes", false
@@ -114,6 +118,8 @@ beforeEach ->
config.set "core.disabledPackages", ["package-that-throws-an-exception",
"package-with-broken-package-json", "package-with-broken-keymap"]
config.set "editor.useShadowDOM", true
advanceClock(1000)
window.setTimeout.reset()
config.load.reset()
config.save.reset()
@@ -121,8 +127,6 @@ beforeEach ->
TextEditorElement::setUpdatedSynchronously(true)
spyOn(atom, "setRepresentedFilename")
spyOn(window, "setTimeout").andCallFake window.fakeSetTimeout
spyOn(window, "clearTimeout").andCallFake window.fakeClearTimeout
spyOn(pathwatcher.File.prototype, "detectResurrectionAfterDelay").andCallFake -> @detectResurrection()
spyOn(TextEditor.prototype, "shouldPromptToSave").andReturn false
@@ -204,10 +208,15 @@ jasmine.attachToDOM = (element) ->
deprecationsSnapshot = null
jasmine.snapshotDeprecations = ->
deprecationsSnapshot = Grim.getDeprecations() # suppress deprecations!!
deprecationsSnapshot = _.clone(Grim.deprecations)
jasmine.restoreDeprecationsSnapshot = ->
Grim.grimDeprecations = deprecationsSnapshot
Grim.deprecations = deprecationsSnapshot
jasmine.useRealClock = ->
jasmine.unspy(window, 'setTimeout')
jasmine.unspy(window, 'clearTimeout')
jasmine.unspy(_._, 'now')
addCustomMatchers = (spec) ->
spec.addMatchers
@@ -294,13 +303,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()
+10
Ver Arquivo
@@ -25,6 +25,16 @@ describe "Windows squirrel updates", ->
else
originalSpawn('ls')
it "ignores errors spawning Squirrel", ->
jasmine.unspy(ChildProcess, 'spawn')
spyOn(ChildProcess, 'spawn').andCallFake -> throw new Error("EBUSY")
app = quit: jasmine.createSpy('quit')
expect(SquirrelUpdate.handleStartupEvent(app, '--squirrel-install')).toBe true
waitsFor ->
app.quit.callCount is 1
it "quits the app on all squirrel events", ->
app = quit: jasmine.createSpy('quit')
+9 -7
Ver Arquivo
@@ -53,14 +53,16 @@ describe "StyleManager", ->
expect(addEvents[0].getAttribute('source-path')).toBe '/foo/bar'
expect(addEvents[0].textContent).toBe "a {color: yellow;}"
describe "when a group parameter is specified", ->
it "inserts the stylesheet at the end of any existing stylesheets for the same group", ->
manager.addStyleSheet("a {color: red}", group: 'a')
manager.addStyleSheet("a {color: blue}", group: 'b')
manager.addStyleSheet("a {color: green}", group: 'a')
describe "when a priority parameter is specified", ->
it "inserts the style sheet based on the priority", ->
manager.addStyleSheet("a {color: red}", priority: 1)
manager.addStyleSheet("a {color: blue}", priority: 0)
manager.addStyleSheet("a {color: green}", priority: 2)
manager.addStyleSheet("a {color: yellow}", priority: 1)
expect(manager.getStyleElements().map (elt) -> elt.textContent).toEqual [
"a {color: red}"
"a {color: green}"
"a {color: blue}"
"a {color: red}"
"a {color: yellow}"
"a {color: green}"
]
+9 -7
Ver Arquivo
@@ -32,16 +32,18 @@ describe "StylesElement", ->
expect(element.children[initialChildCount].textContent).toBe "a {color: blue;}"
expect(removedStyleElements).toEqual [addedStyleElements[0]]
it "orders style elements by group", ->
it "orders style elements by priority", ->
initialChildCount = element.children.length
atom.styles.addStyleSheet("a {color: red}", group: 'a')
atom.styles.addStyleSheet("a {color: blue}", group: 'b')
atom.styles.addStyleSheet("a {color: green}", group: 'a')
atom.styles.addStyleSheet("a {color: red}", priority: 1)
atom.styles.addStyleSheet("a {color: blue}", priority: 0)
atom.styles.addStyleSheet("a {color: green}", priority: 2)
atom.styles.addStyleSheet("a {color: yellow}", priority: 1)
expect(element.children[initialChildCount].textContent).toBe "a {color: red}"
expect(element.children[initialChildCount + 1].textContent).toBe "a {color: green}"
expect(element.children[initialChildCount + 2].textContent).toBe "a {color: blue}"
expect(element.children[initialChildCount].textContent).toBe "a {color: blue}"
expect(element.children[initialChildCount + 1].textContent).toBe "a {color: red}"
expect(element.children[initialChildCount + 2].textContent).toBe "a {color: yellow}"
expect(element.children[initialChildCount + 3].textContent).toBe "a {color: green}"
it "updates existing style nodes when style elements are updated", ->
initialChildCount = element.children.length
+23
Ver Arquivo
@@ -20,3 +20,26 @@ describe "Task", ->
expect(handlerResult).toBe 'hello'
expect(childProcess.kill).toHaveBeenCalled()
expect(processErrored).toBe false
it "calls listeners registered with ::on when events are emitted in the task", ->
task = new Task(require.resolve('./fixtures/task-spec-handler'))
eventSpy = jasmine.createSpy('eventSpy')
task.on("some-event", eventSpy)
waitsFor (done) -> task.start(done)
runs ->
expect(eventSpy).toHaveBeenCalledWith(1, 2, 3)
it "unregisters listeners when the Disposable returned by ::on is disposed", ->
task = new Task(require.resolve('./fixtures/task-spec-handler'))
eventSpy = jasmine.createSpy('eventSpy')
disposable = task.on("some-event", eventSpy)
disposable.dispose()
waitsFor (done) -> task.start(done)
runs ->
expect(eventSpy).not.toHaveBeenCalled()
+69 -56
Ver Arquivo
@@ -429,7 +429,7 @@ describe "TextEditorComponent", ->
it "excludes the null byte from character measurement", ->
editor.setText("a\0b")
nextAnimationFrame()
expect(editor.pixelPositionForScreenPosition([0, Infinity]).left).toEqual 2 * charWidth
expect(wrapperNode.pixelPositionForScreenPosition([0, Infinity]).left).toEqual 2 * charWidth
describe "when there is a fold", ->
it "renders a fold marker on the folded line", ->
@@ -552,14 +552,29 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
expect(lineNumbersNode.style.backgroundColor).toBe 'rgb(255, 0, 0)'
describe "when the editor.showLineNumbers config is false", ->
it "doesn't render any line numbers", ->
expect(component.refs.gutter).toBeDefined()
atom.config.set("editor.showLineNumbers", false)
expect(component.refs.gutter).not.toBeDefined()
atom.config.set("editor.showLineNumbers", true)
expect(component.refs.gutter).toBeDefined()
expect(component.lineNumberNodeForScreenRow(3)).toBeDefined()
it "hides or shows the gutter based on the '::isGutterVisible' property on the model and the global 'editor.showLineNumbers' config setting", ->
expect(component.refs.gutter?).toBe true
editor.setGutterVisible(false)
nextAnimationFrame()
expect(component.refs.gutter?).toBe false
atom.config.set("editor.showLineNumbers", false)
expect(nextAnimationFrame).toBe noAnimationFrame
expect(component.refs.gutter?).toBe false
editor.setGutterVisible(true)
expect(nextAnimationFrame).toBe noAnimationFrame
expect(component.refs.gutter?).toBe false
atom.config.set("editor.showLineNumbers", true)
nextAnimationFrame()
expect(component.refs.gutter?).toBe true
expect(component.lineNumberNodeForScreenRow(3)?).toBe true
describe "fold decorations", ->
describe "rendering fold decorations", ->
@@ -755,7 +770,6 @@ describe "TextEditorComponent", ->
expect(cursorNode.offsetWidth).toBe charWidth
it "blinks cursors when they aren't moving", ->
spyOn(_._, 'now').andCallFake -> window.now # Ensure _.debounce is based on our fake spec timeline
cursorsNode = componentNode.querySelector('.cursors')
expect(cursorsNode.classList.contains('blink-off')).toBe false
@@ -802,7 +816,7 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
cursorNode = componentNode.querySelector('.cursor')
{left} = editor.pixelPositionForScreenPosition([1, 10])
{left} = wrapperNode.pixelPositionForScreenPosition([1, 10])
expect(cursorNode.style['-webkit-transform']).toBe "translate(#{left}px, #{editor.getLineHeightInPixels()}px)"
describe "selection rendering", ->
@@ -896,7 +910,7 @@ describe "TextEditorComponent", ->
nextAnimationFrame()
selectionNode = componentNode.querySelector('.region')
expect(selectionNode.offsetTop).toBe editor.getLineHeightInPixels()
expect(selectionNode.offsetLeft).toBe editor.pixelPositionForScreenPosition([1, 6]).left
expect(selectionNode.offsetLeft).toBe wrapperNode.pixelPositionForScreenPosition([1, 6]).left
it "will flash the selection when flash:true is passed to editor::setSelectedBufferRange", ->
editor.setSelectedBufferRange([[1, 6], [1, 10]], flash: true)
@@ -917,7 +931,7 @@ describe "TextEditorComponent", ->
beforeEach ->
marker = editor.displayBuffer.markBufferRange([[2, 13], [3, 15]], invalidate: 'inside')
decorationParams = {type: ['gutter', 'line'], class: 'a'}
decorationParams = {type: ['line-number', 'line'], class: 'a'}
decoration = editor.decorateMarker(marker, decorationParams)
nextAnimationFrame()
@@ -932,7 +946,7 @@ describe "TextEditorComponent", ->
# Add decorations that are out of range
marker2 = editor.displayBuffer.markBufferRange([[9, 0], [9, 0]])
editor.decorateMarker(marker2, type: ['gutter', 'line'], class: 'b')
editor.decorateMarker(marker2, type: ['line-number', 'line'], class: 'b')
nextAnimationFrame()
# Scroll decorations into view
@@ -956,7 +970,7 @@ describe "TextEditorComponent", ->
marker.destroy()
marker = editor.markBufferRange([[0, 0], [0, 2]])
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'b')
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'b')
nextAnimationFrame()
expect(lineNumberHasClass(0, 'b')).toBe true
expect(lineNumberHasClass(1, 'b')).toBe false
@@ -1025,7 +1039,7 @@ describe "TextEditorComponent", ->
describe "when the decoration's 'onlyHead' property is true", ->
it "only applies the decoration's class to lines containing the marker's head", ->
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'only-head', onlyHead: true)
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'only-head', onlyHead: true)
nextAnimationFrame()
expect(lineAndLineNumberHaveClass(1, 'only-head')).toBe false
expect(lineAndLineNumberHaveClass(2, 'only-head')).toBe false
@@ -1034,7 +1048,7 @@ describe "TextEditorComponent", ->
describe "when the decoration's 'onlyEmpty' property is true", ->
it "only applies the decoration when its marker is empty", ->
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'only-empty', onlyEmpty: true)
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'only-empty', onlyEmpty: true)
nextAnimationFrame()
expect(lineAndLineNumberHaveClass(2, 'only-empty')).toBe false
expect(lineAndLineNumberHaveClass(3, 'only-empty')).toBe false
@@ -1046,7 +1060,7 @@ describe "TextEditorComponent", ->
describe "when the decoration's 'onlyNonEmpty' property is true", ->
it "only applies the decoration when its marker is non-empty", ->
editor.decorateMarker(marker, type: ['gutter', 'line'], class: 'only-non-empty', onlyNonEmpty: true)
editor.decorateMarker(marker, type: ['line-number', 'line'], class: 'only-non-empty', onlyNonEmpty: true)
nextAnimationFrame()
expect(lineAndLineNumberHaveClass(2, 'only-non-empty')).toBe true
expect(lineAndLineNumberHaveClass(3, 'only-non-empty')).toBe true
@@ -1231,7 +1245,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 5])
position = wrapperNode.pixelPositionForBufferPosition([2, 5])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1241,7 +1255,7 @@ describe "TextEditorComponent", ->
editor.moveRight()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 7])
position = wrapperNode.pixelPositionForBufferPosition([2, 7])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1252,7 +1266,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 10])
position = wrapperNode.pixelPositionForBufferPosition([2, 10])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1263,7 +1277,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 5])
position = wrapperNode.pixelPositionForBufferPosition([2, 5])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1274,7 +1288,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', position: 'tail', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 5])
position = wrapperNode.pixelPositionForBufferPosition([2, 5])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1304,7 +1318,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 26])
position = wrapperNode.pixelPositionForBufferPosition([0, 26])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1313,7 +1327,7 @@ describe "TextEditorComponent", ->
editor.insertText('a')
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 27])
position = wrapperNode.pixelPositionForBufferPosition([0, 27])
expect(overlay.style.left).toBe position.left - itemWidth + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1323,7 +1337,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([4, 0])
position = wrapperNode.pixelPositionForBufferPosition([4, 0])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1332,7 +1346,7 @@ describe "TextEditorComponent", ->
editor.insertNewline()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([5, 0])
position = wrapperNode.pixelPositionForBufferPosition([5, 0])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top - itemHeight + 'px'
@@ -1354,7 +1368,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 2])
position = wrapperNode.pixelPositionForBufferPosition([0, 2])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1363,7 +1377,7 @@ describe "TextEditorComponent", ->
editor.insertText('a')
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 3])
position = wrapperNode.pixelPositionForBufferPosition([0, 3])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1373,7 +1387,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([1, 0])
position = wrapperNode.pixelPositionForBufferPosition([1, 0])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1382,7 +1396,7 @@ describe "TextEditorComponent", ->
editor.insertNewline()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([2, 0])
position = wrapperNode.pixelPositionForBufferPosition([2, 0])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1395,7 +1409,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 28])
position = wrapperNode.pixelPositionForBufferPosition([0, 28])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1404,7 +1418,7 @@ describe "TextEditorComponent", ->
editor.insertText('a')
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([0, 29])
position = wrapperNode.pixelPositionForBufferPosition([0, 29])
expect(overlay.style.left).toBe position.left - itemWidth + 'px'
expect(overlay.style.top).toBe position.top + editor.getLineHeightInPixels() + 'px'
@@ -1415,7 +1429,7 @@ describe "TextEditorComponent", ->
decoration = editor.decorateMarker(marker, {type: 'overlay', item})
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([6, 0])
position = wrapperNode.pixelPositionForBufferPosition([6, 0])
overlay = component.getTopmostDOMNode().querySelector('atom-overlay')
expect(overlay.style.left).toBe position.left + 'px'
@@ -1424,7 +1438,7 @@ describe "TextEditorComponent", ->
editor.insertNewline()
nextAnimationFrame()
position = editor.pixelPositionForBufferPosition([7, 0])
position = wrapperNode.pixelPositionForBufferPosition([7, 0])
expect(overlay.style.left).toBe position.left + 'px'
expect(overlay.style.top).toBe position.top - itemHeight + 'px'
@@ -2048,8 +2062,6 @@ describe "TextEditorComponent", ->
expect(component.mouseWheelScreenRow).toBe null
it "clears the mouseWheelScreenRow after a delay even if the event does not cause scrolling", ->
spyOn(_._, 'now').andCallFake -> window.now # Ensure _.debounce is based on our fake spec timeline
expect(editor.getScrollTop()).toBe 0
lineNode = componentNode.querySelector('.line')
@@ -2505,7 +2517,8 @@ describe "TextEditorComponent", ->
describe "when the 'mini' property is true", ->
beforeEach ->
component.setProps(mini: true)
editor.setMini(true)
nextAnimationFrame()
it "does not render the gutter", ->
expect(componentNode.querySelector('.gutter')).toBeNull()
@@ -2593,9 +2606,9 @@ describe "TextEditorComponent", ->
describe 'soft wrap settings', ->
beforeEach ->
atom.config.set '.source.coffee', 'editor.softWrap', true
atom.config.set '.source.coffee', 'editor.preferredLineLength', 17
atom.config.set '.source.coffee', 'editor.softWrapAtPreferredLineLength', true
atom.config.set 'editor.softWrap', true, scopeSelector: '.source.coffee'
atom.config.set 'editor.preferredLineLength', 17, scopeSelector: '.source.coffee'
atom.config.set 'editor.softWrapAtPreferredLineLength', true, scopeSelector: '.source.coffee'
editor.setEditorWidthInChars(20)
coffeeEditor.setEditorWidthInChars(20)
@@ -2605,18 +2618,18 @@ describe "TextEditorComponent", ->
expect(coffeeEditor.lineTextForScreenRow(3)).toEqual ' return items '
it 'updates the wrapped lines when editor.preferredLineLength changes', ->
atom.config.set '.source.coffee', 'editor.preferredLineLength', 20
atom.config.set 'editor.preferredLineLength', 20, scopeSelector: '.source.coffee'
expect(coffeeEditor.lineTextForScreenRow(2)).toEqual ' return items if '
it 'updates the wrapped lines when editor.softWrapAtPreferredLineLength changes', ->
atom.config.set '.source.coffee', 'editor.softWrapAtPreferredLineLength', false
atom.config.set 'editor.softWrapAtPreferredLineLength', false, scopeSelector: '.source.coffee'
expect(coffeeEditor.lineTextForScreenRow(2)).toEqual ' return items if '
it 'updates the wrapped lines when editor.softWrap changes', ->
atom.config.set '.source.coffee', 'editor.softWrap', false
atom.config.set 'editor.softWrap', false, scopeSelector: '.source.coffee'
expect(coffeeEditor.lineTextForScreenRow(2)).toEqual ' return items if items.length <= 1'
atom.config.set '.source.coffee', 'editor.softWrap', true
atom.config.set 'editor.softWrap', true, scopeSelector: '.source.coffee'
expect(coffeeEditor.lineTextForScreenRow(3)).toEqual ' return items '
it 'updates the wrapped lines when the grammar changes', ->
@@ -2644,11 +2657,11 @@ describe "TextEditorComponent", ->
tab: 'F'
cr: 'E'
atom.config.set '.source.js', 'editor.showInvisibles', true
atom.config.set '.source.js', 'editor.invisibles', jsInvisibles
atom.config.set 'editor.showInvisibles', true, scopeSelector: '.source.js'
atom.config.set 'editor.invisibles', jsInvisibles, scopeSelector: '.source.js'
atom.config.set '.source.coffee', 'editor.showInvisibles', false
atom.config.set '.source.coffee', 'editor.invisibles', coffeeInvisibles
atom.config.set 'editor.showInvisibles', false, scopeSelector: '.source.coffee'
atom.config.set 'editor.invisibles', coffeeInvisibles, scopeSelector: '.source.coffee'
editor.setText " a line with tabs\tand spaces \n"
nextAnimationFrame()
@@ -2664,7 +2677,7 @@ describe "TextEditorComponent", ->
it "re-renders the invisibles when the invisible settings change", ->
jsGrammar = editor.getGrammar()
editor.setGrammar(coffeeEditor.getGrammar())
atom.config.set '.source.coffee', 'editor.showInvisibles', true
atom.config.set 'editor.showInvisibles', true, scopeSelector: '.source.coffee'
nextAnimationFrame()
expect(component.lineNodeForScreenRow(0).textContent).toBe "#{coffeeInvisibles.space}a line with tabs#{coffeeInvisibles.tab}and spaces#{coffeeInvisibles.space}#{coffeeInvisibles.eol}"
@@ -2673,7 +2686,7 @@ describe "TextEditorComponent", ->
space: 'E'
tab: 'W'
cr: 'I'
atom.config.set '.source.coffee', 'editor.invisibles', newInvisibles
atom.config.set 'editor.invisibles', newInvisibles, scopeSelector: '.source.coffee'
nextAnimationFrame()
expect(component.lineNodeForScreenRow(0).textContent).toBe "#{newInvisibles.space}a line with tabs#{newInvisibles.tab}and spaces#{newInvisibles.space}#{newInvisibles.eol}"
@@ -2683,8 +2696,8 @@ describe "TextEditorComponent", ->
describe 'editor.showIndentGuide', ->
beforeEach ->
atom.config.set '.source.js', 'editor.showIndentGuide', true
atom.config.set '.source.coffee', 'editor.showIndentGuide', false
atom.config.set 'editor.showIndentGuide', true, scopeSelector: '.source.js'
atom.config.set 'editor.showIndentGuide', false, scopeSelector: '.source.coffee'
it "has an 'indent-guide' class when scoped editor.showIndentGuide is true, but not when scoped editor.showIndentGuide is false", ->
line1LeafNodes = getLeafNodes(component.lineNodeForScreenRow(1))
@@ -2705,7 +2718,7 @@ describe "TextEditorComponent", ->
expect(line1LeafNodes[0].classList.contains('indent-guide')).toBe true
expect(line1LeafNodes[1].classList.contains('indent-guide')).toBe false
atom.config.set '.source.js', 'editor.showIndentGuide', false
atom.config.set 'editor.showIndentGuide', false, scopeSelector: '.source.js'
line1LeafNodes = getLeafNodes(component.lineNodeForScreenRow(1))
expect(line1LeafNodes[0].textContent).toBe ' '
@@ -2754,14 +2767,14 @@ describe "TextEditorComponent", ->
event
clientCoordinatesForScreenPosition = (screenPosition) ->
positionOffset = editor.pixelPositionForScreenPosition(screenPosition)
positionOffset = wrapperNode.pixelPositionForScreenPosition(screenPosition)
scrollViewClientRect = componentNode.querySelector('.scroll-view').getBoundingClientRect()
clientX = scrollViewClientRect.left + positionOffset.left - editor.getScrollLeft()
clientY = scrollViewClientRect.top + positionOffset.top - editor.getScrollTop()
{clientX, clientY}
clientCoordinatesForScreenRowInGutter = (screenRow) ->
positionOffset = editor.pixelPositionForScreenPosition([screenRow, 1])
positionOffset = wrapperNode.pixelPositionForScreenPosition([screenRow, 1])
gutterClientRect = componentNode.querySelector('.gutter').getBoundingClientRect()
clientX = gutterClientRect.left + positionOffset.left - editor.getScrollLeft()
clientY = gutterClientRect.top + positionOffset.top - editor.getScrollTop()
+28 -4
Ver Arquivo
@@ -10,16 +10,21 @@ describe "TextEditorElement", ->
jasmineContent = document.body.querySelector('#jasmine-content')
describe "instantiation", ->
it "honors the mini attribute", ->
it "honors the 'mini' attribute", ->
jasmineContent.innerHTML = "<atom-text-editor mini>"
element = jasmineContent.firstChild
expect(element.getModel().isMini()).toBe true
it "honors the placeholder-text attribute", ->
it "honors the 'placeholder-text' attribute", ->
jasmineContent.innerHTML = "<atom-text-editor placeholder-text='testing'>"
element = jasmineContent.firstChild
expect(element.getModel().getPlaceholderText()).toBe 'testing'
it "honors the 'gutter-hidden' attribute", ->
jasmineContent.innerHTML = "<atom-text-editor gutter-hidden>"
element = jasmineContent.firstChild
expect(element.getModel().isGutterVisible()).toBe false
it "honors the text content", ->
jasmineContent.innerHTML = "<atom-text-editor>testing</atom-text-editor>"
element = jasmineContent.firstChild
@@ -42,9 +47,12 @@ describe "TextEditorElement", ->
component = element.component
expect(component.isMounted()).toBe true
element.getModel().destroy()
element.remove()
expect(component.isMounted()).toBe false
jasmine.attachToDOM(element)
expect(element.component.isMounted()).toBe true
describe "when the editor.useShadowDOM config option is false", ->
it "mounts the react component and unmounts when removed from the dom", ->
atom.config.set('editor.useShadowDOM', false)
@@ -95,6 +103,22 @@ describe "TextEditorElement", ->
document.body.focus()
expect(blurCalled).toBe true
describe "when focused while a parent node is being attached to the DOM", ->
class ElementThatFocusesChild extends HTMLDivElement
attachedCallback: ->
@firstChild.focus()
document.registerElement("element-that-focuses-child",
prototype: ElementThatFocusesChild.prototype
)
it "proxies the focus event to the hidden input", ->
element = new TextEditorElement
parentElement = document.createElement("element-that-focuses-child")
parentElement.appendChild(element)
jasmineContent.appendChild(parentElement)
expect(element.shadowRoot.activeElement).toBe element.shadowRoot.querySelector('input')
describe "when the themes finish loading", ->
[themeReloadCallback, initialThemeLoadComplete, element] = []
@@ -104,7 +128,7 @@ describe "TextEditorElement", ->
spyOn(atom.themes, 'isInitialLoadComplete').andCallFake ->
initialThemeLoadComplete
spyOn(atom.themes, 'onDidReloadAll').andCallFake (fn) ->
spyOn(atom.themes, 'onDidChangeActiveThemes').andCallFake (fn) ->
themeReloadCallback = fn
atom.config.set("editor.useShadowDOM", false)
+81 -15
Ver Arquivo
@@ -62,7 +62,6 @@ describe "TextEditor", ->
atom.workspace.open('sample.less', initialLine: 5).then (o) -> editor = o
runs ->
buffer = editor.buffer
expect(editor.getLastCursor().getBufferPosition().row).toEqual 5
expect(editor.getLastCursor().getBufferPosition().column).toEqual 0
@@ -74,10 +73,37 @@ describe "TextEditor", ->
atom.workspace.open('sample.less', initialColumn: 8).then (o) -> editor = o
runs ->
buffer = editor.buffer
expect(editor.getLastCursor().getBufferPosition().row).toEqual 0
expect(editor.getLastCursor().getBufferPosition().column).toEqual 8
describe "when the editor is reopened with an initialLine option", ->
it "positions the cursor on the specified line", ->
editor = null
waitsForPromise ->
atom.workspace.open('sample.less', initialLine: 5).then (o) -> editor = o
waitsForPromise ->
atom.workspace.open('sample.less', initialLine: 4).then (o) -> editor = o
runs ->
expect(editor.getLastCursor().getBufferPosition().row).toEqual 4
expect(editor.getLastCursor().getBufferPosition().column).toEqual 0
describe "when the editor is reopened with an initialColumn option", ->
it "positions the cursor on the specified column", ->
editor = null
waitsForPromise ->
atom.workspace.open('sample.less', initialColumn: 8).then (o) -> editor = o
waitsForPromise ->
atom.workspace.open('sample.less', initialColumn: 7).then (o) -> editor = o
runs ->
expect(editor.getLastCursor().getBufferPosition().row).toEqual 0
expect(editor.getLastCursor().getBufferPosition().column).toEqual 7
describe ".copy()", ->
it "returns a different edit session with the same initial state", ->
editor.setSelectedBufferRange([[1, 2], [3, 4]])
@@ -129,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", ->
@@ -918,6 +963,15 @@ describe "TextEditor", ->
editor.undo()
expect(editor.getScrollTop()).toBe 0
describe '.logCursorScope()', ->
beforeEach ->
spyOn(atom.notifications, 'addInfo')
it 'opens a notification', ->
editor.logCursorScope()
expect(atom.notifications.addInfo).toHaveBeenCalled()
describe "selection", ->
selection = null
@@ -1327,7 +1381,7 @@ describe "TextEditor", ->
coffeeEditor.selectWordsContainingCursors()
expect(coffeeEditor.getSelectedBufferRange()).toEqual [[0, 6], [0, 15]]
atom.config.set '.source.coffee', 'editor.nonWordCharacters', 'qusort'
atom.config.set 'editor.nonWordCharacters', 'qusort', scopeSelector: '.source.coffee'
coffeeEditor.setCursorBufferPosition [0, 9]
coffeeEditor.selectWordsContainingCursors()
@@ -2595,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", ->
@@ -2697,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", ->
@@ -3276,7 +3338,7 @@ describe "TextEditor", ->
atom.packages.unloadPackages()
it 'returns correct values based on the scope of the set grammars', ->
atom.config.set '.source.coffee', 'editor.tabLength', 6
atom.config.set 'editor.tabLength', 6, scopeSelector: '.source.coffee'
expect(editor.getTabLength()).toBe 2
expect(coffeeEditor.getTabLength()).toBe 6
@@ -3298,12 +3360,12 @@ describe "TextEditor", ->
expect(editor.getTabLength()).toBe 2
expect(editor.tokenizedLineForScreenRow(5).tokens[0].firstNonWhitespaceIndex).toBe 2
atom.config.set '.source.js', 'editor.tabLength', 6
atom.config.set 'editor.tabLength', 6, scopeSelector: '.source.js'
expect(editor.getTabLength()).toBe 6
expect(editor.tokenizedLineForScreenRow(5).tokens[0].firstNonWhitespaceIndex).toBe 6
it 'updates the tab length when the grammar changes', ->
atom.config.set '.source.coffee', 'editor.tabLength', 6
atom.config.set 'editor.tabLength', 6, scopeSelector: '.source.coffee'
expect(editor.getTabLength()).toBe 2
expect(editor.tokenizedLineForScreenRow(5).tokens[0].firstNonWhitespaceIndex).toBe 2
@@ -3473,8 +3535,8 @@ describe "TextEditor", ->
atom.project.open('coffee.coffee', autoIndent: false).then (o) -> coffeeEditor = o
runs ->
atom.config.set('.source.js', 'editor.autoIndent', true)
atom.config.set('.source.coffee', 'editor.autoIndent', false)
atom.config.set('editor.autoIndent', true, scopeSelector: '.source.js')
atom.config.set('editor.autoIndent', false, scopeSelector: '.source.coffee')
afterEach: ->
atom.packages.deactivatePackages()
@@ -3766,8 +3828,12 @@ describe "TextEditor", ->
it "updates the grammar based on grammar overrides", ->
expect(editor.getGrammar().name).toBe 'JavaScript'
atom.grammars.setGrammarOverrideForPath(editor.getPath(), 'source.coffee')
callback = jasmine.createSpy('callback')
editor.onDidChangeGrammar(callback)
editor.reloadGrammar()
expect(editor.getGrammar().name).toBe 'CoffeeScript'
expect(callback.callCount).toBe 1
expect(callback.argsForCall[0][0]).toBe atom.grammars.grammarForScopeName('source.coffee')
describe "when the editor's grammar has an injection selector", ->
beforeEach ->
+140 -101
Ver Arquivo
@@ -73,65 +73,90 @@ describe "ThemeManager", ->
describe "when the core.themes config value changes", ->
it "add/removes stylesheets to reflect the new config value", ->
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
spyOn(atom.styles, 'getUserStyleSheetPath').andCallFake -> null
waitsForPromise ->
themeManager.activateThemes()
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
atom.config.set('core.themes', [])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
didChangeActiveThemesHandler.reset()
expect($('style.theme')).toHaveLength 0
atom.config.set('core.themes', ['atom-dark-ui'])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
expect($('style[group=theme]')).toHaveLength 2
expect($('style[group=theme]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/
didChangeActiveThemesHandler.reset()
expect($('style[priority=1]')).toHaveLength 2
expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/
atom.config.set('core.themes', ['atom-light-ui', 'atom-dark-ui'])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
expect($('style[group=theme]')).toHaveLength 2
expect($('style[group=theme]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/
expect($('style[group=theme]:eq(1)').attr('source-path')).toMatch /atom-light-ui/
didChangeActiveThemesHandler.reset()
expect($('style[priority=1]')).toHaveLength 2
expect($('style[priority=1]:eq(0)').attr('source-path')).toMatch /atom-dark-ui/
expect($('style[priority=1]:eq(1)').attr('source-path')).toMatch /atom-light-ui/
atom.config.set('core.themes', [])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
reloadHandler.reset()
expect($('style[group=theme]')).toHaveLength 2
didChangeActiveThemesHandler.reset()
expect($('style[priority=1]')).toHaveLength 2
# atom-dark-ui has an directory path, the syntax one doesn't
atom.config.set('core.themes', ['theme-with-index-less', 'atom-dark-ui'])
waitsFor ->
reloadHandler.callCount == 1
didChangeActiveThemesHandler.callCount == 1
runs ->
expect($('style[group=theme]')).toHaveLength 2
expect($('style[priority=1]')).toHaveLength 2
importPaths = themeManager.getImportPaths()
expect(importPaths.length).toBe 1
expect(importPaths[0]).toContain 'atom-dark-ui'
it 'adds theme-* classes to the workspace for each active theme', ->
workspaceElement = atom.views.getView(atom.workspace)
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
waitsForPromise ->
themeManager.activateThemes()
runs ->
expect(workspaceElement).toHaveClass 'theme-atom-dark-ui'
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
didChangeActiveThemesHandler.callCount > 0
runs ->
# `theme-` twice as it prefixes the name with `theme-`
expect(workspaceElement).toHaveClass 'theme-theme-with-ui-variables'
expect(workspaceElement).toHaveClass 'theme-theme-with-syntax-variables'
expect(workspaceElement).not.toHaveClass 'theme-atom-dark-ui'
expect(workspaceElement).not.toHaveClass 'theme-atom-dark-syntax'
describe "when a theme fails to load", ->
it "logs a warning", ->
spyOn(console, 'warn')
expect(-> atom.packages.activatePackage('a-theme-that-will-not-be-found')).toThrow()
atom.packages.activatePackage('a-theme-that-will-not-be-found')
expect(console.warn.callCount).toBe 1
expect(console.warn.argsForCall[0][0]).toContain "Could not resolve 'a-theme-that-will-not-be-found'"
describe "::requireStylesheet(path)", ->
beforeEach ->
@@ -145,7 +170,7 @@ describe "ThemeManager", ->
themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
cssPath = atom.project.resolve('css.css')
cssPath = atom.project.getDirectories()[0]?.resolve('css.css')
lengthBefore = $('head style').length
themeManager.requireStylesheet(cssPath)
@@ -169,7 +194,7 @@ describe "ThemeManager", ->
$('head style[id*="css.css"]').remove()
it "synchronously loads and parses less files at the given path and installs a style tag for it in the head", ->
lessPath = atom.project.resolve('sample.less')
lessPath = atom.project.getDirectories()[0]?.resolve('sample.less')
lengthBefore = $('head style').length
themeManager.requireStylesheet(lessPath)
expect($('head style').length).toBe lengthBefore + 1
@@ -193,9 +218,9 @@ describe "ThemeManager", ->
it "supports requiring css and less stylesheets without an explicit extension", ->
themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'css')
expect($('head style[source-path*="css.css"]').attr('source-path')).toBe themeManager.stringToId(atom.project.resolve('css.css'))
expect($('head style[source-path*="css.css"]').attr('source-path')).toBe themeManager.stringToId(atom.project.getDirectories()[0]?.resolve('css.css'))
themeManager.requireStylesheet path.join(__dirname, 'fixtures', 'sample')
expect($('head style[source-path*="sample.less"]').attr('source-path')).toBe themeManager.stringToId(atom.project.resolve('sample.less'))
expect($('head style[source-path*="sample.less"]').attr('source-path')).toBe themeManager.stringToId(atom.project.getDirectories()[0]?.resolve('sample.less'))
$('head style[id*="css.css"]').remove()
$('head style[id*="sample.less"]').remove()
@@ -223,11 +248,9 @@ describe "ThemeManager", ->
expect(stylesheetsChangedHandler).toHaveBeenCalled()
describe "base stylesheet loading", ->
describe "base style sheet loading", ->
workspaceElement = null
beforeEach ->
jasmine.snapshotDeprecations()
workspaceElement = atom.views.getView(atom.workspace)
jasmine.attachToDOM(workspaceElement)
workspaceElement.appendChild document.createElement('atom-text-editor')
@@ -235,15 +258,12 @@ describe "ThemeManager", ->
waitsForPromise ->
themeManager.activateThemes()
beforeEach ->
jasmine.restoreDeprecationsSnapshot()
it "loads the correct values from the theme's ui-variables file", ->
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
reloadHandler.callCount > 0
didChangeActiveThemesHandler.callCount > 0
runs ->
# an override loaded in the base css
@@ -256,11 +276,11 @@ describe "ThemeManager", ->
describe "when there is a theme with incomplete variables", ->
it "loads the correct values from the fallback ui-variables", ->
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
themeManager.onDidChangeActiveThemes didChangeActiveThemesHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-incomplete-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
reloadHandler.callCount > 0
didChangeActiveThemesHandler.callCount > 0
runs ->
# an override loaded in the base css
@@ -269,85 +289,104 @@ describe "ThemeManager", ->
# from within the theme itself
expect($("atom-text-editor").css("background-color")).toBe "rgb(0, 152, 255)"
describe "theme classes on the workspace", ->
it 'adds theme-* classes to the workspace for each active theme', ->
expect(workspaceElement).toHaveClass 'theme-atom-dark-ui'
themeManager.onDidReloadAll reloadHandler = jasmine.createSpy()
atom.config.set('core.themes', ['theme-with-ui-variables', 'theme-with-syntax-variables'])
waitsFor ->
reloadHandler.callCount > 0
runs ->
# `theme-` twice as it prefixes the name with `theme-`
expect(workspaceElement).toHaveClass 'theme-theme-with-ui-variables'
expect(workspaceElement).toHaveClass 'theme-theme-with-syntax-variables'
expect(workspaceElement).not.toHaveClass 'theme-atom-dark-ui'
expect(workspaceElement).not.toHaveClass 'theme-atom-dark-syntax'
describe "when the user stylesheet changes", ->
describe "user stylesheet", ->
userStylesheetPath = null
beforeEach ->
jasmine.snapshotDeprecations()
afterEach ->
jasmine.restoreDeprecationsSnapshot()
it "reloads it", ->
[styleElementAddedHandler, styleElementRemovedHandler] = []
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
userStylesheetPath = path.join(temp.mkdirSync("atom"), 'styles.less')
fs.writeFileSync(userStylesheetPath, 'body {border-style: dotted !important;}')
spyOn(atom.styles, 'getUserStyleSheetPath').andReturn userStylesheetPath
waitsForPromise ->
themeManager.activateThemes()
describe "when the user stylesheet changes", ->
beforeEach ->
jasmine.snapshotDeprecations()
runs ->
atom.styles.onDidRemoveStyleElement styleElementRemovedHandler = jasmine.createSpy("styleElementRemovedHandler")
atom.styles.onDidAddStyleElement styleElementAddedHandler = jasmine.createSpy("styleElementAddedHandler")
afterEach ->
jasmine.restoreDeprecationsSnapshot()
themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.onDidRemoveStylesheet stylesheetRemovedHandler = jasmine.createSpy("stylesheetRemovedHandler")
themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
spyOn(themeManager, 'loadUserStylesheet').andCallThrough()
it "reloads it", ->
[styleElementAddedHandler, styleElementRemovedHandler] = []
[stylesheetRemovedHandler, stylesheetAddedHandler, stylesheetsChangedHandler] = []
expect($(document.body).css('border-style')).toBe 'dotted'
fs.writeFileSync(userStylesheetPath, 'body {border-style: dashed}')
waitsForPromise ->
themeManager.activateThemes()
waitsFor ->
themeManager.loadUserStylesheet.callCount is 1
runs ->
atom.styles.onDidRemoveStyleElement styleElementRemovedHandler = jasmine.createSpy("styleElementRemovedHandler")
atom.styles.onDidAddStyleElement styleElementAddedHandler = jasmine.createSpy("styleElementAddedHandler")
runs ->
expect($(document.body).css('border-style')).toBe 'dashed'
themeManager.onDidChangeStylesheets stylesheetsChangedHandler = jasmine.createSpy("stylesheetsChangedHandler")
themeManager.onDidRemoveStylesheet stylesheetRemovedHandler = jasmine.createSpy("stylesheetRemovedHandler")
themeManager.onDidAddStylesheet stylesheetAddedHandler = jasmine.createSpy("stylesheetAddedHandler")
spyOn(themeManager, 'loadUserStylesheet').andCallThrough()
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dotted'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dotted'
expect($(document.body).css('border-style')).toBe 'dotted'
fs.writeFileSync(userStylesheetPath, 'body {border-style: dashed}')
expect(styleElementAddedHandler).toHaveBeenCalled()
expect(styleElementAddedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetAddedHandler).toHaveBeenCalled()
expect(stylesheetAddedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
waitsFor ->
themeManager.loadUserStylesheet.callCount is 1
expect(stylesheetsChangedHandler).toHaveBeenCalled()
runs ->
expect($(document.body).css('border-style')).toBe 'dashed'
styleElementRemovedHandler.reset()
stylesheetRemovedHandler.reset()
stylesheetsChangedHandler.reset()
fs.removeSync(userStylesheetPath)
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dotted'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dotted'
waitsFor ->
themeManager.loadUserStylesheet.callCount is 2
expect(styleElementAddedHandler).toHaveBeenCalled()
expect(styleElementAddedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetAddedHandler).toHaveBeenCalled()
expect(stylesheetAddedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
runs ->
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
expect($(document.body).css('border-style')).toBe 'none'
expect(stylesheetsChangedHandler).toHaveBeenCalled()
expect(stylesheetsChangedHandler).toHaveBeenCalled()
styleElementRemovedHandler.reset()
stylesheetRemovedHandler.reset()
stylesheetsChangedHandler.reset()
fs.removeSync(userStylesheetPath)
waitsFor ->
themeManager.loadUserStylesheet.callCount is 2
runs ->
expect(styleElementRemovedHandler).toHaveBeenCalled()
expect(styleElementRemovedHandler.argsForCall[0][0].textContent).toContain 'dashed'
expect(stylesheetRemovedHandler).toHaveBeenCalled()
expect(stylesheetRemovedHandler.argsForCall[0][0].cssRules[0].style.border).toBe 'dashed'
expect($(document.body).css('border-style')).toBe 'none'
expect(stylesheetsChangedHandler).toHaveBeenCalled()
describe "when there is an error reading the stylesheet", ->
addErrorHandler = null
beforeEach ->
themeManager.loadUserStylesheet()
spyOn(themeManager.lessCache, 'cssForFile').andCallFake ->
throw new Error('EACCES permission denied "styles.less"')
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
it "creates an error notification", ->
themeManager.loadUserStylesheet()
expect(addErrorHandler).toHaveBeenCalled()
note = addErrorHandler.mostRecentCall.args[0]
expect(note.getType()).toBe 'error'
expect(note.getMessage()).toContain 'Error loading'
describe "when there is an error watching the user stylesheet", ->
addErrorHandler = null
beforeEach ->
{File} = require 'pathwatcher'
spyOn(File::, 'on').andCallFake (event) ->
if event.indexOf('contents-changed') > -1
throw new Error('Unable to watch path')
spyOn(themeManager, 'loadStylesheet').andReturn ''
atom.notifications.onDidAddNotification addErrorHandler = jasmine.createSpy()
it "creates an error notification", ->
themeManager.loadUserStylesheet()
expect(addErrorHandler).toHaveBeenCalled()
note = addErrorHandler.mostRecentCall.args[0]
expect(note.getType()).toBe 'error'
expect(note.getMessage()).toContain 'Unable to watch path'
describe "when a non-existent theme is present in the config", ->
beforeEach ->
@@ -358,7 +397,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark UI and syntax themes and logs a warning', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(console.warn.callCount).toBe 2
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-dark-ui')
@@ -376,7 +415,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the enabled themes', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-light-ui')
expect(activeThemeNames).toContain('atom-dark-syntax')
@@ -389,7 +428,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark UI and syntax themes', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-dark-ui')
expect(activeThemeNames).toContain('atom-dark-syntax')
@@ -402,7 +441,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark UI theme', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-dark-ui')
expect(activeThemeNames).toContain('atom-light-syntax')
@@ -415,7 +454,7 @@ describe "ThemeManager", ->
themeManager.activateThemes()
it 'uses the default dark syntax theme', ->
activeThemeNames = themeManager.getActiveNames()
activeThemeNames = themeManager.getActiveThemeNames()
expect(activeThemeNames.length).toBe(2)
expect(activeThemeNames).toContain('atom-light-ui')
expect(activeThemeNames).toContain('atom-dark-syntax')
+3 -3
Ver Arquivo
@@ -14,14 +14,14 @@ describe "ViewRegistry", ->
expect(registry.getView(node)).toBe node
describe "when passed a SpacePen view", ->
it "returns the root node of the view with a __spacePenView property pointing at the SpacePen view", ->
it "returns the root node of the view with a .spacePenView property pointing at the SpacePen view", ->
class TestView extends View
@content: -> @div "Hello"
view = new TestView
node = registry.getView(view)
expect(node.textContent).toBe "Hello"
expect(node.__spacePenView).toBe view
expect(node.spacePenView).toBe view
describe "when passed a model object", ->
describe "when a view provider is registered matching the object's constructor", ->
@@ -62,7 +62,7 @@ describe "ViewRegistry", ->
node = registry.getView(model)
expect(node.textContent).toBe "hello"
view = node.__spacePenView
view = node.spacePenView
expect(view instanceof TestView).toBe true
expect(view.model).toBe model
+8
Ver Arquivo
@@ -169,6 +169,14 @@ describe "Window", ->
$("<a href='#scroll-me'>link</a>").appendTo(document.body).click().remove()
expect(shell.openExternal).not.toHaveBeenCalled()
describe "when a form is submitted", ->
it "prevents the default so that the window's URL isn't changed", ->
submitSpy = jasmine.createSpy('submit')
$(document).on('submit', 'form', submitSpy)
$("<form>foo</form>").appendTo(document.body).submit().remove()
expect(submitSpy.callCount).toBe 1
expect(submitSpy.argsForCall[0][0].isDefaultPrevented()).toBe true
describe "core:focus-next and core:focus-previous", ->
describe "when there is no currently focused element", ->
it "focuses the element with the lowest/highest tabindex", ->
+490 -14
Ver Arquivo
@@ -1,13 +1,19 @@
path = require 'path'
temp = require 'temp'
Workspace = require '../src/workspace'
Pane = require '../src/pane'
{View} = require '../src/space-pen-extensions'
platform = require './spec-helper-platform'
_ = require 'underscore-plus'
fstream = require 'fstream'
fs = require 'fs-plus'
Grim = require 'grim'
describe "Workspace", ->
workspace = null
beforeEach ->
atom.project.setPaths([atom.project.resolve('dir')])
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])
atom.workspace = workspace = new Workspace
describe "::open(uri, options)", ->
@@ -66,19 +72,19 @@ describe "Workspace", ->
expect(openEvents).toEqual [
{
uri: atom.project.resolve('a')
uri: atom.project.getDirectories()[0]?.resolve('a')
item: editor1
pane: atom.workspace.getActivePane()
index: 0
}
{
uri: atom.project.resolve('b')
uri: atom.project.getDirectories()[0]?.resolve('b')
item: editor2
pane: atom.workspace.getActivePane()
index: 1
}
{
uri: atom.project.resolve('a')
uri: atom.project.getDirectories()[0]?.resolve('a')
item: editor1
pane: atom.workspace.getActivePane()
index: 0
@@ -92,7 +98,7 @@ describe "Workspace", ->
workspace.open('a').then (o) -> editor = o
runs ->
expect(editor.getUri()).toBe atom.project.resolve('a')
expect(editor.getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(workspace.getActivePaneItem()).toBe editor
expect(workspace.getActivePane().items).toEqual [editor]
expect(workspace.getActivePane().activate).toHaveBeenCalled()
@@ -226,7 +232,7 @@ describe "Workspace", ->
workspace.addOpener(barOpener)
waitsForPromise ->
pathToOpen = atom.project.resolve('a.foo')
pathToOpen = atom.project.getDirectories()[0]?.resolve('a.foo')
workspace.open(pathToOpen, hey: "there").then (item) ->
expect(item).toEqual { foo: pathToOpen, options: {hey: "there"} }
@@ -246,6 +252,116 @@ describe "Workspace", ->
runs ->
expect(newEditorHandler.argsForCall[0][0].textEditor).toBe editor
it "records a deprecation warning on the appropriate package if the item has a ::getUri method instead of ::getURI", ->
jasmine.snapshotDeprecations()
waitsForPromise -> atom.packages.activatePackage('package-with-deprecated-pane-item-method')
waitsForPromise ->
atom.workspace.open("test")
runs ->
deprecations = Grim.getDeprecations()
expect(deprecations.length).toBe 1
expect(deprecations[0].message).toBe "Pane item with class `TestItem` should implement `::getURI` instead of `::getUri`."
expect(deprecations[0].getStacks()[0].metadata.packageName).toBe "package-with-deprecated-pane-item-method"
jasmine.restoreDeprecationsSnapshot()
describe "when there is an error opening the file", ->
notificationSpy = null
beforeEach ->
atom.notifications.onDidAddNotification notificationSpy = jasmine.createSpy()
describe "when a large file is opened", ->
beforeEach ->
spyOn(fs, 'getSizeSync').andReturn 2 * 1048577 # 2MB
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 '< 2MB'
describe "when a file does not exist", ->
it "creates an empty buffer for the specified path", ->
waitsForPromise ->
workspace.open('not-a-file.md')
runs ->
editor = workspace.getActiveTextEditor()
expect(notificationSpy).not.toHaveBeenCalled()
expect(editor.getPath()).toContain 'not-a-file.md'
describe "when the user does not have access to the file", ->
beforeEach ->
spyOn(fs, 'openSync').andCallFake (path) ->
error = new Error("EACCES, permission denied '#{path}'")
error.path = path
error.code = 'EACCES'
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 '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) ->
throw new Error("I dont even know what is happening right now!!")
it "creates a notification", ->
open = -> workspace.open('file1', workspace.getActivePane())
expect(open).toThrow()
describe "::reopenItem()", ->
it "opens the uri associated with the last closed pane that isn't currently open", ->
pane = workspace.getActivePane()
@@ -257,21 +373,21 @@ describe "Workspace", ->
runs ->
# does not reopen items with no uri
expect(workspace.getActivePaneItem().getUri()).toBeUndefined()
expect(workspace.getActivePaneItem().getURI()).toBeUndefined()
pane.destroyActiveItem()
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).not.toBeUndefined()
expect(workspace.getActivePaneItem().getURI()).not.toBeUndefined()
# destroy all items
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('file1')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('file1')
pane.destroyActiveItem()
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('b')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('b')
pane.destroyActiveItem()
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('a')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
pane.destroyActiveItem()
# reopens items with uris
@@ -281,20 +397,20 @@ describe "Workspace", ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('a')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('a')
# does not reopen items that are already open
waitsForPromise ->
workspace.open('b')
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('b')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('b')
waitsForPromise ->
workspace.reopenItem()
runs ->
expect(workspace.getActivePaneItem().getUri()).toBe atom.project.resolve('file1')
expect(workspace.getActivePaneItem().getURI()).toBe atom.project.getDirectories()[0]?.resolve('file1')
describe "::increase/decreaseFontSize()", ->
it "increases/decreases the font size without going below 1", ->
@@ -553,3 +669,363 @@ describe "Workspace", ->
expect(atom.workspace.panelForItem(item)).toBe panel
expect(atom.workspace.panelForItem(itemWithNoPanel)).toBe null
describe "::scan(regex, options, callback)", ->
describe "when called with a regex", ->
it "calls the callback with all regex results in all files in the project", ->
results = []
waitsForPromise ->
atom.workspace.scan /(a)+/, (result) ->
results.push(result)
runs ->
expect(results).toHaveLength(3)
expect(results[0].filePath).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(results[0].matches).toHaveLength(3)
expect(results[0].matches[0]).toEqual
matchText: 'aaa'
lineText: 'aaa bbb'
lineTextOffset: 0
range: [[0, 0], [0, 3]]
it "works with with escaped literals (like $ and ^)", ->
results = []
waitsForPromise ->
atom.workspace.scan /\$\w+/, (result) -> results.push(result)
runs ->
expect(results.length).toBe 1
{filePath, matches} = results[0]
expect(filePath).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(matches).toHaveLength 1
expect(matches[0]).toEqual
matchText: '$bill'
lineText: 'dollar$bill'
lineTextOffset: 0
range: [[2, 6], [2, 11]]
it "works on evil filenames", ->
platform.generateEvilFiles()
atom.project.setPaths([path.join(__dirname, 'fixtures', 'evil-files')])
paths = []
matches = []
waitsForPromise ->
atom.workspace.scan /evil/, (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
runs ->
_.each(matches, (m) -> expect(m.matchText).toEqual 'evil')
if platform.isWindows()
expect(paths.length).toBe 3
expect(paths[0]).toMatch /a_file_with_utf8.txt$/
expect(paths[1]).toMatch /file with spaces.txt$/
expect(path.basename(paths[2])).toBe "utfa\u0306.md"
else
expect(paths.length).toBe 5
expect(paths[0]).toMatch /a_file_with_utf8.txt$/
expect(paths[1]).toMatch /file with spaces.txt$/
expect(paths[2]).toMatch /goddam\nnewlines$/m
expect(paths[3]).toMatch /quote".txt$/m
expect(path.basename(paths[4])).toBe "utfa\u0306.md"
it "ignores case if the regex includes the `i` flag", ->
results = []
waitsForPromise ->
atom.workspace.scan /DOLLAR/i, (result) -> results.push(result)
runs ->
expect(results).toHaveLength 1
describe "when the core.excludeVcsIgnoredPaths config is truthy", ->
[projectPath, ignoredPath] = []
beforeEach ->
sourceProjectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
projectPath = path.join(temp.mkdirSync("atom"))
writerStream = fstream.Writer(projectPath)
fstream.Reader(sourceProjectPath).pipe(writerStream)
waitsFor (done) ->
writerStream.on 'close', done
writerStream.on 'error', done
runs ->
fs.rename(path.join(projectPath, 'git.git'), path.join(projectPath, '.git'))
ignoredPath = path.join(projectPath, 'ignored.txt')
fs.writeFileSync(ignoredPath, 'this match should not be included')
afterEach ->
fs.removeSync(projectPath) if fs.existsSync(projectPath)
it "excludes ignored files", ->
atom.project.setPaths([projectPath])
atom.config.set('core.excludeVcsIgnoredPaths', true)
resultHandler = jasmine.createSpy("result found")
waitsForPromise ->
atom.workspace.scan /match/, (results) ->
resultHandler()
runs ->
expect(resultHandler).not.toHaveBeenCalled()
it "includes only files when a directory filter is specified", ->
projectPath = path.join(path.join(__dirname, 'fixtures', 'dir'))
atom.project.setPaths([projectPath])
filePath = path.join(projectPath, 'a-dir', 'oh-git')
paths = []
matches = []
waitsForPromise ->
atom.workspace.scan /aaa/, paths: ["a-dir#{path.sep}"], (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
runs ->
expect(paths.length).toBe 1
expect(paths[0]).toBe filePath
expect(matches.length).toBe 1
it "includes files and folders that begin with a '.'", ->
projectPath = temp.mkdirSync()
filePath = path.join(projectPath, '.text')
fs.writeFileSync(filePath, 'match this')
atom.project.setPaths([projectPath])
paths = []
matches = []
waitsForPromise ->
atom.workspace.scan /match this/, (result) ->
paths.push(result.filePath)
matches = matches.concat(result.matches)
runs ->
expect(paths.length).toBe 1
expect(paths[0]).toBe filePath
expect(matches.length).toBe 1
it "excludes values in core.ignoredNames", ->
projectPath = path.join(__dirname, 'fixtures', 'git', 'working-dir')
ignoredNames = atom.config.get("core.ignoredNames")
ignoredNames.push("a")
atom.config.set("core.ignoredNames", ignoredNames)
resultHandler = jasmine.createSpy("result found")
waitsForPromise ->
atom.workspace.scan /dollar/, (results) ->
resultHandler()
runs ->
expect(resultHandler).not.toHaveBeenCalled()
it "scans buffer contents if the buffer is modified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('a').then (o) ->
editor = o
editor.setText("Elephant")
waitsForPromise ->
atom.workspace.scan /a|Elephant/, (result) -> results.push result
runs ->
expect(results).toHaveLength 3
resultForA = _.find results, ({filePath}) -> path.basename(filePath) == 'a'
expect(resultForA.matches).toHaveLength 1
expect(resultForA.matches[0].matchText).toBe 'Elephant'
it "ignores buffers outside the project", ->
editor = null
results = []
waitsForPromise ->
atom.project.open(temp.openSync().path).then (o) ->
editor = o
editor.setText("Elephant")
waitsForPromise ->
atom.workspace.scan /Elephant/, (result) -> results.push result
runs ->
expect(results).toHaveLength 0
describe "::replace(regex, replacementText, paths, iterator)", ->
[filePath, commentFilePath, sampleContent, sampleCommentContent] = []
beforeEach ->
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('../')])
filePath = atom.project.getDirectories()[0]?.resolve('sample.js')
commentFilePath = atom.project.getDirectories()[0]?.resolve('sample-with-comments.js')
sampleContent = fs.readFileSync(filePath).toString()
sampleCommentContent = fs.readFileSync(commentFilePath).toString()
afterEach ->
fs.writeFileSync(filePath, sampleContent)
fs.writeFileSync(commentFilePath, sampleCommentContent)
describe "when a file doesn't exist", ->
it "calls back with an error", ->
errors = []
missingPath = path.resolve('/not-a-file.js')
expect(fs.existsSync(missingPath)).toBeFalsy()
waitsForPromise ->
atom.workspace.replace /items/gi, 'items', [missingPath], (result, error) ->
errors.push(error)
runs ->
expect(errors).toHaveLength 1
expect(errors[0].path).toBe missingPath
describe "when called with unopened files", ->
it "replaces properly", ->
results = []
waitsForPromise ->
atom.workspace.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
describe "when a buffer is already open", ->
it "replaces properly and saves when not modified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
expect(editor.isModified()).toBeFalsy()
waitsForPromise ->
atom.workspace.replace /items/gi, 'items', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeFalsy()
it "does not replace when the path is not specified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('sample-with-comments.js').then (o) -> editor = o
waitsForPromise ->
atom.workspace.replace /items/gi, 'items', [commentFilePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe commentFilePath
it "does NOT save when modified", ->
editor = null
results = []
waitsForPromise ->
atom.project.open('sample.js').then (o) -> editor = o
runs ->
editor.buffer.setTextInRange([[0,0],[0,0]], 'omg')
expect(editor.isModified()).toBeTruthy()
waitsForPromise ->
atom.workspace.replace /items/gi, 'okthen', [filePath], (result) ->
results.push(result)
runs ->
expect(results).toHaveLength 1
expect(results[0].filePath).toBe filePath
expect(results[0].replacements).toBe 6
expect(editor.isModified()).toBeTruthy()
describe "::saveActivePaneItem()", ->
describe "when there is an error", ->
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("'/some/file' is a directory")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the directory cannot be written to", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the user does not have permission", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
error = new Error("EACCES, permission denied '/Some/dir/and-a-file.js'")
error.code = 'EACCES'
error.path = '/Some/dir/and-a-file.js'
throw error
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the operation is not permitted", ->
spyOn(Pane::, 'saveActiveItem').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(Pane::, 'saveActiveItem').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(Pane::, 'saveActiveItem').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 ->
throw new Error("no one knows")
save = -> atom.workspace.saveActivePaneItem()
expect(save).toThrow()
+6 -43
Ver Arquivo
@@ -3,7 +3,6 @@ Q = require 'q'
path = require 'path'
temp = require 'temp'
TextEditorView = require '../src/text-editor-view'
Pane = require '../src/pane'
PaneView = require '../src/pane-view'
Workspace = require '../src/workspace'
@@ -13,8 +12,8 @@ describe "WorkspaceView", ->
beforeEach ->
jasmine.snapshotDeprecations()
atom.project.setPaths([atom.project.resolve('dir')])
pathToOpen = atom.project.resolve('a')
atom.project.setPaths([atom.project.getDirectories()[0]?.resolve('dir')])
pathToOpen = atom.project.getDirectories()[0]?.resolve('a')
atom.workspace = new Workspace
atom.workspaceView = atom.views.getView(atom.workspace).__spacePenView
atom.workspaceView.enableKeymap()
@@ -93,11 +92,11 @@ describe "WorkspaceView", ->
editorView2 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane atom-text-editor:eq(0)').view()
editorView4 = atom.workspaceView.panes.find('atom-pane-axis.horizontal > atom-pane-axis.vertical > atom-pane atom-text-editor:eq(1)').view()
expect(editorView1.getEditor().getPath()).toBe atom.project.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.resolve('../sample.js')
expect(editorView1.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('a')
expect(editorView2.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('b')
expect(editorView3.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('../sample.js')
expect(editorView3.getEditor().getCursorScreenPosition()).toEqual [2, 4]
expect(editorView4.getEditor().getPath()).toBe atom.project.resolve('../sample.txt')
expect(editorView4.getEditor().getPath()).toBe atom.project.getDirectories()[0]?.resolve('../sample.txt')
expect(editorView4.getEditor().getCursorScreenPosition()).toEqual [0, 2]
# ensure adjust pane dimensions is called
@@ -295,39 +294,3 @@ describe "WorkspaceView", ->
modalContainer = workspaceElement.querySelector('atom-panel-container.modal')
expect(modalContainer.parentNode).toBe workspaceElement
describe "::saveActivePaneItem()", ->
describe "when there is an error", ->
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("'/some/file' is a directory")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the directory cannot be written to", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("ENOTDIR, not a directory '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the user does not have permission", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("EACCES, permission denied '/Some/dir/and-a-file.js'")
atom.notifications.onDidAddNotification addedSpy = jasmine.createSpy()
atom.workspace.saveActivePaneItem()
expect(addedSpy).toHaveBeenCalled()
expect(addedSpy.mostRecentCall.args[0].getType()).toBe 'warning'
it "emits a warning notification when the file cannot be saved", ->
spyOn(Pane::, 'saveActiveItem').andCallFake ->
throw new Error("no one knows")
save = -> atom.workspace.saveActivePaneItem()
expect(save).toThrow()
+8 -15
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'
@@ -280,8 +279,6 @@ class Atom extends Model
deprecate "The atom.syntax global is deprecated. Use atom.grammars instead."
@grammars
@subscribe @packages.onDidActivateAll => @watchThemes()
Project = require './project'
TextBuffer = require 'text-buffer'
@deserializers.add(TextBuffer)
@@ -547,6 +544,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}
@@ -580,7 +578,10 @@ class Atom extends Model
@watchProjectPath()
@packages.activate()
@packages.activate().then =>
maximize = dimensions?.maximized and process.platform isnt 'darwin'
@displayWindow({maximize})
@keymaps.loadUserKeymap()
@requireUserInitScript() unless safeMode
@@ -589,9 +590,6 @@ class Atom extends Model
@setAutoHideMenuBar(newValue)
@setAutoHideMenuBar(true) if @config.get('core.autoHideMenuBar')
maximize = dimensions?.maximized and process.platform isnt 'darwin'
@displayWindow({maximize})
unloadEditorWindow: ->
return if not @project
@@ -720,13 +718,6 @@ class Atom extends Model
loadThemes: ->
@themes.load()
watchThemes: ->
@themes.onDidReloadAll =>
# Only reload stylesheets from non-theme packages
for pack in @packages.getActivePackages() when pack.getType() isnt 'theme'
pack.reloadStylesheets?()
null
# Notify the browser project of the window's current project path
watchProjectPath: ->
onProjectPathChanged = =>
@@ -776,7 +767,9 @@ class Atom extends Model
try
require(userInitScriptPath) if fs.isFileSync(userInitScriptPath)
catch error
console.error "Failed to load `#{userInitScriptPath}`", error.stack, error
atom.notifications.addError "Failed to load `#{userInitScriptPath}`",
detail: error.message
dismissable: true
# Require the module with the given globals.
#
+1 -1
Ver Arquivo
@@ -359,7 +359,7 @@ class AtomApplication
if existingWindow?
openedWindow = existingWindow
openedWindow.openPath(pathToOpen, initialLine)
openedWindow.openPath(pathToOpen, initialLine, initialColumn)
if openedWindow.isMinimized()
openedWindow.restore()
else
-2
Ver Arquivo
@@ -10,7 +10,6 @@ module.exports =
class AtomWindow
_.extend @prototype, EventEmitter.prototype
@iconPath: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
@includeShellLoadTime: true
browserWindow: null
@@ -26,7 +25,6 @@ class AtomWindow
@browserWindow = new BrowserWindow
show: false
title: 'Atom'
icon: @constructor.iconPath
'web-preferences':
'direct-write': false
'subpixel-font-scaling': false
+16 -4
Ver Arquivo
@@ -1,6 +1,7 @@
autoUpdater = null
_ = require 'underscore-plus'
{EventEmitter} = require 'events'
path = require 'path'
IdleState = 'idle'
CheckingState = 'checking'
@@ -51,8 +52,7 @@ class AutoUpdateManager
@emitUpdateAvailableEvent(@getWindows()...)
# Only released versions should check for updates.
unless /\w{7}/.test(@version)
@check(hidePopups: true)
@check(hidePopups: true) unless /\w{7}/.test(@version)
switch process.platform
when 'win32'
@@ -86,12 +86,24 @@ class AutoUpdateManager
onUpdateNotAvailable: =>
autoUpdater.removeListener 'error', @onUpdateError
dialog = require 'dialog'
dialog.showMessageBox type: 'info', buttons: ['OK'], message: 'No update available.', detail: "Version #{@version} is the latest version."
dialog.showMessageBox
type: 'info'
buttons: ['OK']
icon: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
message: 'No update available.'
title: 'No Update Available'
detail: "Version #{@version} is the latest version."
onUpdateError: (event, message) =>
autoUpdater.removeListener 'update-not-available', @onUpdateNotAvailable
dialog = require 'dialog'
dialog.showMessageBox type: 'warning', buttons: ['OK'], message: 'There was an error checking for updates.', detail: message
dialog.showMessageBox
type: 'warning'
buttons: ['OK']
icon: path.resolve(__dirname, '..', '..', 'resources', 'atom.png')
message: 'There was an error checking for updates.'
title: 'Update Error'
detail: message
getWindows: ->
global.atomApplication.windows
+5 -11
Ver Arquivo
@@ -13,16 +13,6 @@ 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 = ->
if process.platform is 'win32'
SquirrelUpdate = require './squirrel-update'
@@ -50,8 +40,12 @@ 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())
if cwd
path.resolve(cwd, pathToOpen.toString())
else
path.resolve(pathToOpen.toString())
setupCoffeeScript()
if args.devMode

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