├── spec ├── fixtures │ ├── dir │ │ ├── file1 │ │ ├── b │ │ ├── a-dir │ │ │ └── oh-git │ │ └── a │ ├── cson.cson │ ├── git │ │ ├── working-dir │ │ │ ├── a.txt │ │ │ ├── .gitignore │ │ │ └── git.git │ │ │ │ ├── HEAD │ │ │ │ ├── refs │ │ │ │ └── heads │ │ │ │ │ └── master │ │ │ │ ├── index │ │ │ │ ├── config │ │ │ │ └── objects │ │ │ │ ├── 16 │ │ │ │ └── 735fb793d7b038818219c4b8c6295346e20eef │ │ │ │ ├── 52 │ │ │ │ └── f56457b6fca045ce41bb9d32e6ca79d23192af │ │ │ │ ├── 65 │ │ │ │ └── a457425a679cbe9adf0d2741785d3ceabb44a7 │ │ │ │ ├── 66 │ │ │ │ └── dc9051da651c15d98d017a88658263cab28f02 │ │ │ │ ├── 06 │ │ │ │ └── 15f9a45968b3515e0a202530ef9f61aba26b6c │ │ │ │ ├── 5b │ │ │ │ └── 24ab4c3baadf534242b1acc220c8fa051b9b20 │ │ │ │ ├── 8a │ │ │ │ └── 9c86f1cb1f14b8f436eb91f4b052c8802ca99e │ │ │ │ ├── e6 │ │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ │ ├── ec │ │ │ │ └── 5e386905ff2d36e291086a1207f2585aaa8920 │ │ │ │ ├── ef │ │ │ │ └── 046e9eecaa5255ea5e9817132d4001724d6ae1 │ │ │ │ ├── fe │ │ │ │ └── bde178cdf35e9df6279d87aa27590c6d92e354 │ │ │ │ └── ff │ │ │ │ └── c8218bd2240a0cb92f6f02548d45784428349b │ │ ├── repo-with-submodules │ │ │ ├── README │ │ │ ├── git.git │ │ │ │ ├── HEAD │ │ │ │ ├── modules │ │ │ │ │ ├── jstips │ │ │ │ │ │ ├── gitdir │ │ │ │ │ │ ├── HEAD │ │ │ │ │ │ ├── ORIG_HEAD │ │ │ │ │ │ ├── refs │ │ │ │ │ │ │ ├── heads │ │ │ │ │ │ │ │ ├── test │ │ │ │ │ │ │ │ └── master │ │ │ │ │ │ │ └── remotes │ │ │ │ │ │ │ │ └── origin │ │ │ │ │ │ │ │ └── HEAD │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── index │ │ │ │ │ │ ├── packed-refs │ │ │ │ │ │ ├── logs │ │ │ │ │ │ │ ├── refs │ │ │ │ │ │ │ │ ├── heads │ │ │ │ │ │ │ │ │ ├── master │ │ │ │ │ │ │ │ │ └── test │ │ │ │ │ │ │ │ └── remotes │ │ │ │ │ │ │ │ │ └── origin │ │ │ │ │ │ │ │ │ └── HEAD │ │ │ │ │ │ │ └── HEAD │ │ │ │ │ │ ├── objects │ │ │ │ │ │ │ ├── 05 │ │ │ │ │ │ │ │ └── 25ef667328cb1f86b1ddf523db4a064e1590fa │ │ │ │ │ │ │ ├── 1a │ │ │ │ │ │ │ │ └── dd860234dad4a8bf59340363e9c88bb0457cb7 │ │ │ │ │ │ │ ├── 5b │ │ │ │ │ │ │ │ └── 35953562dbb4f2debe88fcc9ac1805064e1e5a │ │ │ │ │ │ │ └── pack │ │ │ │ │ │ │ │ ├── pack-e568a55e02b6b7b75582924204669e4f3ed5276f.idx │ │ │ │ │ │ │ │ └── pack-e568a55e02b6b7b75582924204669e4f3ed5276f.pack │ │ │ │ │ │ ├── hooks │ │ │ │ │ │ │ ├── post-update.sample │ │ │ │ │ │ │ ├── pre-applypatch.sample │ │ │ │ │ │ │ ├── applypatch-msg.sample │ │ │ │ │ │ │ ├── commit-msg.sample │ │ │ │ │ │ │ └── prepare-commit-msg.sample │ │ │ │ │ │ ├── COMMIT_EDITMSG │ │ │ │ │ │ ├── info │ │ │ │ │ │ │ └── exclude │ │ │ │ │ │ └── config │ │ │ │ │ └── You-Dont-Need-jQuery │ │ │ │ │ │ ├── gitdir │ │ │ │ │ │ ├── HEAD │ │ │ │ │ │ ├── ORIG_HEAD │ │ │ │ │ │ ├── refs │ │ │ │ │ │ ├── heads │ │ │ │ │ │ │ └── master │ │ │ │ │ │ └── remotes │ │ │ │ │ │ │ └── origin │ │ │ │ │ │ │ └── HEAD │ │ │ │ │ │ ├── description │ │ │ │ │ │ ├── packed-refs │ │ │ │ │ │ ├── index │ │ │ │ │ │ ├── logs │ │ │ │ │ │ ├── refs │ │ │ │ │ │ │ ├── remotes │ │ │ │ │ │ │ │ └── origin │ │ │ │ │ │ │ │ │ └── HEAD │ │ │ │ │ │ │ └── heads │ │ │ │ │ │ │ │ └── master │ │ │ │ │ │ └── HEAD │ │ │ │ │ │ ├── objects │ │ │ │ │ │ ├── a7 │ │ │ │ │ │ │ └── 8b35a896b890f0a2a4f1f924c5739776415250 │ │ │ │ │ │ ├── ae │ │ │ │ │ │ │ └── 897dce6e0590f08dddfe9a5152e237e955ca57 │ │ │ │ │ │ ├── be │ │ │ │ │ │ │ └── 8ed228c0a080145d28ed625a5f487caae6a3f9 │ │ │ │ │ │ └── pack │ │ │ │ │ │ │ ├── pack-d38b3bc339acd655e8dae9c0dcea8bb2ec174d16.idx │ │ │ │ │ │ │ └── pack-d38b3bc339acd655e8dae9c0dcea8bb2ec174d16.pack │ │ │ │ │ │ ├── hooks │ │ │ │ │ │ ├── post-update.sample │ │ │ │ │ │ ├── pre-applypatch.sample │ │ │ │ │ │ ├── applypatch-msg.sample │ │ │ │ │ │ ├── commit-msg.sample │ │ │ │ │ │ └── prepare-commit-msg.sample │ │ │ │ │ │ ├── info │ │ │ │ │ │ └── exclude │ │ │ │ │ │ ├── COMMIT_EDITMSG │ │ │ │ │ │ └── config │ │ │ │ ├── refs │ │ │ │ │ ├── heads │ │ │ │ │ │ └── master │ │ │ │ │ └── remotes │ │ │ │ │ │ └── origin │ │ │ │ │ │ └── master │ │ │ │ ├── description │ │ │ │ ├── index │ │ │ │ ├── objects │ │ │ │ │ ├── 40 │ │ │ │ │ │ └── f4e79926a85134d4c905d04e70573b6616f3bc │ │ │ │ │ ├── 50 │ │ │ │ │ │ └── b89367d8f0acd312ef5aa012eac20a75c91351 │ │ │ │ │ ├── 54 │ │ │ │ │ │ └── 3b9bebdc6bd5c4b22136034a95dd097a57d3dd │ │ │ │ │ ├── 3e │ │ │ │ │ │ └── 2fe2f8226faab789f70d6d8a7231e4f2bd54df │ │ │ │ │ ├── d2 │ │ │ │ │ │ └── b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 │ │ │ │ │ ├── d3 │ │ │ │ │ │ └── e073baf592c56614c68ead9e2cd0a3880140cd │ │ │ │ │ └── e6 │ │ │ │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ │ ├── hooks │ │ │ │ │ ├── post-update.sample │ │ │ │ │ ├── pre-applypatch.sample │ │ │ │ │ ├── applypatch-msg.sample │ │ │ │ │ ├── commit-msg.sample │ │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ │ └── pre-push.sample │ │ │ │ ├── info │ │ │ │ │ └── exclude │ │ │ │ ├── logs │ │ │ │ │ ├── HEAD │ │ │ │ │ └── refs │ │ │ │ │ │ └── heads │ │ │ │ │ │ └── master │ │ │ │ ├── COMMIT_EDITMSG │ │ │ │ └── config │ │ │ ├── jstips │ │ │ │ ├── git.git │ │ │ │ ├── resources │ │ │ │ │ ├── log.js │ │ │ │ │ └── jstips-header-blog.gif │ │ │ │ └── CONTRIBUTING.md │ │ │ ├── You-Dont-Need-jQuery │ │ │ │ ├── test │ │ │ │ │ ├── css.spec.js │ │ │ │ │ ├── dom.spec.js │ │ │ │ │ ├── utilities.spec.js │ │ │ │ │ └── README.md │ │ │ │ ├── .babelrc │ │ │ │ ├── git.git │ │ │ │ ├── .gitignore │ │ │ │ ├── .travis.yml │ │ │ │ ├── .eslintrc │ │ │ │ └── LICENSE │ │ │ └── .gitmodules │ │ ├── ignore.git │ │ │ ├── info │ │ │ │ └── exclude │ │ │ ├── HEAD │ │ │ ├── refs │ │ │ │ └── heads │ │ │ │ │ └── master │ │ │ ├── index │ │ │ ├── config │ │ │ └── objects │ │ │ │ ├── 65 │ │ │ │ └── a457425a679cbe9adf0d2741785d3ceabb44a7 │ │ │ │ ├── e6 │ │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ │ └── ef │ │ │ │ └── 046e9eecaa5255ea5e9817132d4001724d6ae1 │ │ └── master.git │ │ │ ├── HEAD │ │ │ ├── refs │ │ │ └── heads │ │ │ │ └── master │ │ │ ├── index │ │ │ ├── config │ │ │ └── objects │ │ │ ├── 65 │ │ │ └── a457425a679cbe9adf0d2741785d3ceabb44a7 │ │ │ ├── e6 │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ └── ef │ │ │ └── 046e9eecaa5255ea5e9817132d4001724d6ae1 │ ├── testdir │ │ ├── sample-theme-1 │ │ │ ├── readme │ │ │ └── src │ │ │ │ └── js │ │ │ │ └── main.js │ │ └── sample-theme-2 │ │ │ ├── readme │ │ │ └── src │ │ │ └── js │ │ │ ├── main.js │ │ │ └── plugin │ │ │ └── main.js │ ├── sample.txt │ ├── packages │ │ ├── package-with-empty-menu │ │ │ ├── menus │ │ │ │ └── menu.cson │ │ │ └── package.json │ │ ├── package-with-empty-keymap │ │ │ ├── keymaps │ │ │ │ └── keymap.cson │ │ │ └── package.json │ │ ├── theme-with-invalid-styles │ │ │ ├── index.less │ │ │ └── package.json │ │ ├── package-with-incompatible-native-module │ │ │ ├── main.js │ │ │ ├── node_modules │ │ │ │ └── native-module │ │ │ │ │ ├── build │ │ │ │ │ └── Release │ │ │ │ │ │ └── native.node │ │ │ │ │ ├── main.js │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── theme-with-syntax-variables │ │ │ ├── styles │ │ │ │ └── editor.less │ │ │ └── package.json │ │ ├── package-with-cached-incompatible-native-module │ │ │ ├── main.js │ │ │ └── package.json │ │ ├── package-with-ignored-incompatible-native-module │ │ │ ├── main.js │ │ │ ├── node_modules │ │ │ │ ├── compatible-native-module │ │ │ │ │ ├── main.js │ │ │ │ │ ├── build │ │ │ │ │ │ └── Release │ │ │ │ │ │ │ └── native.node │ │ │ │ │ └── package.json │ │ │ │ └── native-module │ │ │ │ │ ├── build │ │ │ │ │ └── Release │ │ │ │ │ │ └── native.node │ │ │ │ │ ├── main.js │ │ │ │ │ └── package.json │ │ │ └── package.json │ │ ├── package-with-invalid-styles │ │ │ ├── styles │ │ │ │ └── index.less │ │ │ └── package.json │ │ ├── package-with-styles │ │ │ └── styles │ │ │ │ ├── 4.css │ │ │ │ ├── 1.css │ │ │ │ ├── 3.test-context.css │ │ │ │ └── 2.less │ │ ├── package-with-broken-keymap │ │ │ └── keymaps │ │ │ │ └── broken.json │ │ ├── package-with-broken-package-json │ │ │ └── package.json │ │ ├── package-with-invalid-grammar │ │ │ ├── grammars │ │ │ │ └── grammar.json │ │ │ └── package.json │ │ ├── package-with-invalid-settings │ │ │ ├── settings │ │ │ │ └── settings.json │ │ │ └── package.json │ │ ├── package-with-no-activate │ │ │ ├── index.js │ │ │ └── package.json │ │ ├── package-without-module │ │ │ └── package.cson │ │ ├── theme-with-index-css │ │ │ ├── package.json │ │ │ └── index.css │ │ ├── package-with-index │ │ │ └── index.coffee │ │ ├── package-with-serialize-error │ │ │ ├── package.cson │ │ │ └── index.coffee │ │ ├── theme-with-index-less │ │ │ ├── package.json │ │ │ └── index.less │ │ ├── package-with-main │ │ │ ├── main-module.coffee │ │ │ └── package.cson │ │ ├── package-with-menus-manifest │ │ │ ├── package.cson │ │ │ └── menus │ │ │ │ ├── menu-3.cson │ │ │ │ ├── menu-1.cson │ │ │ │ └── menu-2.cson │ │ ├── package-with-style-sheets-manifest │ │ │ ├── package.cson │ │ │ └── styles │ │ │ │ ├── 1.css │ │ │ │ ├── 3.css │ │ │ │ └── 2.less │ │ ├── package-with-stylesheets-manifest │ │ │ └── package.cson │ │ ├── package-with-keymaps-manifest │ │ │ ├── package.cson │ │ │ └── keymaps │ │ │ │ ├── keymap-3.cson │ │ │ │ ├── keymap-1.json │ │ │ │ └── keymap-2.cson │ │ ├── package-with-empty-activation-commands │ │ │ ├── index.coffee │ │ │ └── package.json │ │ ├── package-with-empty-activation-hooks │ │ │ ├── index.coffee │ │ │ └── package.json │ │ ├── package-with-keymaps │ │ │ └── keymaps │ │ │ │ ├── keymap-1.cson │ │ │ │ ├── keymap-2.cson │ │ │ │ └── keymap-3.cjson │ │ ├── wordcount │ │ │ └── package.json │ │ ├── sublime-tabs │ │ │ └── package.json │ │ ├── package-with-deactivate │ │ │ └── index.coffee │ │ ├── package-that-throws-an-exception │ │ │ └── index.coffee │ │ ├── theme-with-ui-variables │ │ │ ├── package.json │ │ │ └── styles │ │ │ │ └── editor.less │ │ ├── package-with-activation-commands │ │ │ ├── package.cson │ │ │ └── index.coffee │ │ ├── package-with-settings │ │ │ └── settings │ │ │ │ └── omg.cson │ │ ├── package-with-missing-consumed-services │ │ │ ├── index.coffee │ │ │ └── package.json │ │ ├── package-with-missing-provided-services │ │ │ ├── index.coffee │ │ │ └── package.json │ │ ├── package-with-rb-filetype │ │ │ ├── package.json │ │ │ └── grammars │ │ │ │ └── rb.cson │ │ ├── theme-with-incomplete-ui-variables │ │ │ ├── package.json │ │ │ └── styles │ │ │ │ ├── ui-variables.less │ │ │ │ └── editor.less │ │ ├── theme-without-package-file │ │ │ └── styles │ │ │ │ ├── b.css │ │ │ │ ├── c.less │ │ │ │ ├── a.css │ │ │ │ └── d.csv │ │ ├── package-with-invalid-context-menu │ │ │ ├── package.json │ │ │ └── menus │ │ │ │ └── menu.json │ │ ├── theme-with-package-file │ │ │ ├── package.json │ │ │ └── styles │ │ │ │ ├── last.css │ │ │ │ ├── first.css │ │ │ │ └── second.less │ │ ├── package-with-activation-hooks │ │ │ ├── index.coffee │ │ │ └── package.cson │ │ ├── package-with-different-directory-name │ │ │ └── package.json │ │ ├── package-with-invalid-url-package-json │ │ │ └── package.json │ │ ├── package-with-short-url-package-json │ │ │ └── package.json │ │ ├── package-that-throws-on-activate │ │ │ └── index.coffee │ │ ├── package-that-throws-on-deactivate │ │ │ └── index.coffee │ │ ├── package-with-config-defaults │ │ │ └── index.coffee │ │ ├── package-with-eval-time-api-calls │ │ │ ├── package.json │ │ │ └── index.js │ │ ├── package-with-serialization │ │ │ └── index.coffee │ │ ├── package-with-deprecated-pane-item-method │ │ │ └── index.coffee │ │ ├── package-with-injection-selector │ │ │ └── grammars │ │ │ │ └── grammar.cson │ │ ├── package-with-menus │ │ │ └── menus │ │ │ │ ├── menu-2.cson │ │ │ │ ├── menu-1.cson │ │ │ │ └── menu-3.cson │ │ ├── package-with-consumed-services │ │ │ ├── index.coffee │ │ │ └── package.json │ │ ├── package-with-invalid-activation-commands │ │ │ └── package.json │ │ ├── package-with-deserializers │ │ │ ├── package.json │ │ │ └── index.js │ │ ├── package-with-grammars │ │ │ └── grammars │ │ │ │ ├── alot.cson │ │ │ │ └── alittle.cson │ │ ├── package-with-json-config-schema │ │ │ └── package.json │ │ ├── package-with-config-schema │ │ │ └── index.coffee │ │ ├── package-with-view-providers │ │ │ ├── package.json │ │ │ └── index.js │ │ ├── package-with-provided-services │ │ │ ├── index.coffee │ │ │ └── package.json │ │ └── package-with-prefixed-and-suffixed-repo-url │ │ │ └── package.json │ ├── module-cache │ │ └── file.json │ ├── script.js │ ├── shebang │ ├── typescript │ │ ├── invalid.ts │ │ └── valid.ts │ ├── native-cache │ │ ├── file-1.js │ │ ├── file-2.js │ │ ├── file-3.js │ │ └── file-4.js │ ├── babel │ │ ├── babel-comment.js │ │ ├── babel-double-quotes.js │ │ ├── babel-single-quotes.js │ │ ├── invalid.js │ │ └── flow-comment.js │ ├── script-with-deprecations.js │ ├── task-spec-handler.coffee │ ├── css.css │ ├── sample.less │ ├── sample-with-tabs.coffee │ ├── task-handler-with-deprecations.coffee │ ├── sample-with-many-folds.js │ ├── sample-with-tabs-and-leading-comment.coffee │ ├── sample-with-tabs-and-initial-comment.js │ ├── sample.js │ ├── coffee.coffee │ └── sample-with-comments.js ├── sample-with-comments.js ├── integration │ ├── fixtures │ │ └── atom-home │ │ │ └── config.cson │ └── helpers │ │ └── atom-launcher.sh ├── atom-protocol-handler-spec.coffee ├── typescript-spec.coffee ├── clipboard-spec.coffee ├── main-process │ └── mocha-test-runner.js ├── panel-spec.coffee ├── default-directory-searcher-spec.coffee ├── async-spec-helpers.coffee ├── spec-helper-platform.coffee ├── buffered-node-process-spec.coffee ├── token-iterator-spec.coffee └── pane-axis-element-spec.coffee ├── .python-version ├── .coffeelintignore ├── apm ├── .npmrc ├── README.md └── package.json ├── docs ├── contributing.md ├── README.md ├── build-instructions │ ├── freebsd.md │ └── macos.md └── native-profiling.md ├── CHANGELOG.md ├── circle.yml ├── dot-atom ├── packages │ └── README.md ├── .gitignore ├── init.coffee ├── snippets.cson ├── styles.less └── keymap.cson ├── static ├── octicons.woff ├── images │ ├── octocat-spinner-128.gif │ └── transparent-background.gif ├── babelrc.json ├── links.less ├── icons.less ├── markdown.less ├── linux.less ├── popover-list.less ├── index.html ├── messages.less ├── text.less ├── select-list.less ├── workspace-view.less ├── sections.less ├── bootstrap-overrides.less ├── atom.less ├── syntax.less ├── variables │ ├── octicon-mixins.less │ └── syntax-variables.less ├── cursors.less ├── bootstrap.less └── utilities.less ├── resources ├── mac │ ├── file.icns │ ├── helper-Info.plist │ └── speakeasy.pem ├── win │ ├── loading.gif │ ├── apm.cmd │ ├── apm.sh │ ├── atom.js │ ├── atom.sh │ └── atom.cmd ├── app-icons │ ├── beta │ │ ├── atom.ico │ │ ├── atom.icns │ │ └── png │ │ │ ├── 128.png │ │ │ ├── 16.png │ │ │ ├── 24.png │ │ │ ├── 256.png │ │ │ ├── 32.png │ │ │ ├── 48.png │ │ │ ├── 512.png │ │ │ ├── 64.png │ │ │ └── 1024.png │ ├── dev │ │ ├── atom.icns │ │ ├── atom.ico │ │ └── png │ │ │ ├── 1024.png │ │ │ ├── 128.png │ │ │ ├── 16.png │ │ │ ├── 24.png │ │ │ ├── 256.png │ │ │ ├── 32.png │ │ │ ├── 48.png │ │ │ ├── 512.png │ │ │ └── 64.png │ └── stable │ │ ├── atom.icns │ │ ├── atom.ico │ │ └── png │ │ ├── 128.png │ │ ├── 16.png │ │ ├── 24.png │ │ ├── 256.png │ │ ├── 32.png │ │ ├── 48.png │ │ ├── 512.png │ │ ├── 64.png │ │ └── 1024.png └── linux │ ├── atom.desktop.in │ ├── debian │ ├── lintian-overrides │ └── control.in │ └── redhat │ └── atom.spec.in ├── .npmrc ├── script ├── build.cmd ├── clean.cmd ├── grunt.cmd ├── utils │ ├── compile-main-to-app │ ├── clean-open-with-menu │ ├── fix-author │ ├── run-grunt.js │ ├── clean-merged-branches │ ├── fingerprint.js │ └── child-process-wrapper.js ├── rpmbuild ├── cibuild.cmd ├── bootstrap.cmd ├── grunt ├── copy-folder.cmd ├── test ├── cibuild-atom-rpm ├── cibuild-atom-linux ├── set-version ├── mkrpm ├── build ├── mktar └── mkdeb ├── src ├── special-token-symbols.coffee ├── safe-clipboard.coffee ├── marker-observation-window.coffee ├── item-registry.coffee ├── window-load-settings-helpers.coffee ├── model.coffee ├── repository-status-handler.coffee ├── replace-handler.coffee ├── custom-event-mixin.coffee ├── scoped-properties.coffee ├── token.coffee ├── theme-package.coffee ├── window.coffee ├── main-process │ ├── context-menu.coffee │ ├── atom-protocol-handler.coffee │ ├── atom-portable.coffee │ └── spawner.coffee ├── less-compile-cache.coffee ├── storage-folder.coffee ├── input-component.coffee ├── panel-element.coffee ├── ipc-helpers.js ├── delegated-listener.js ├── gutter-component-helpers.coffee ├── coffee-script.js ├── scrollbar-corner-component.coffee ├── deprecated-packages.coffee ├── token-iterator.coffee └── typescript.js ├── .gitignore ├── .pairs ├── Dockerfile ├── .gitattributes ├── keymaps └── emacs.cson ├── coffeelint.json ├── appveyor.yml ├── .travis.yml ├── LICENSE.md ├── exports └── atom.coffee └── ISSUE_TEMPLATE.md /spec/fixtures/dir/file1: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.python-version: -------------------------------------------------------------------------------- 1 | 2.7.6 2 | -------------------------------------------------------------------------------- /spec/fixtures/cson.cson: -------------------------------------------------------------------------------- 1 | a: 4 2 | -------------------------------------------------------------------------------- /spec/fixtures/dir/b: -------------------------------------------------------------------------------- 1 | aaa ccc 2 | -------------------------------------------------------------------------------- /.coffeelintignore: -------------------------------------------------------------------------------- 1 | spec/fixtures 2 | -------------------------------------------------------------------------------- /apm/.npmrc: -------------------------------------------------------------------------------- 1 | cache = ~/.atom/.npm 2 | -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | ../CONTRIBUTING.md -------------------------------------------------------------------------------- /spec/fixtures/dir/a-dir/oh-git: -------------------------------------------------------------------------------- 1 | bbb aaaa -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/a.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/sample-with-comments.js: -------------------------------------------------------------------------------- 1 | undefined -------------------------------------------------------------------------------- /spec/fixtures/testdir/sample-theme-1/readme: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/testdir/sample-theme-2/readme: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | See https://atom.io/releases 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/README: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/info/exclude: -------------------------------------------------------------------------------- 1 | a.txt 2 | -------------------------------------------------------------------------------- /spec/fixtures/testdir/sample-theme-1/src/js/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/testdir/sample-theme-2/src/js/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/dir/a: -------------------------------------------------------------------------------- 1 | aaa bbb 2 | cc aa cc 3 | dollar$bill -------------------------------------------------------------------------------- /spec/fixtures/sample.txt: -------------------------------------------------------------------------------- 1 | Some textSome textSome text. 2 | -------------------------------------------------------------------------------- /spec/fixtures/testdir/sample-theme-2/src/js/plugin/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-menu/menus/menu.cson: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/.gitignore: -------------------------------------------------------------------------------- 1 | poop 2 | ignored.txt 3 | -------------------------------------------------------------------------------- /spec/fixtures/module-cache/file.json: -------------------------------------------------------------------------------- 1 | { 2 | "foo": "bar" 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-keymap/keymaps/keymap.cson: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-invalid-styles/index.less: -------------------------------------------------------------------------------- 1 | <> 2 | -------------------------------------------------------------------------------- /spec/fixtures/script.js: -------------------------------------------------------------------------------- 1 | process.stdout.write(process.argv[2]); 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-incompatible-native-module/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-syntax-variables/styles/editor.less: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /circle.yml: -------------------------------------------------------------------------------- 1 | general: 2 | branches: 3 | only: 4 | - io-circle-ci 5 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/gitdir: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-cached-incompatible-native-module/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-styles/styles/index.less: -------------------------------------------------------------------------------- 1 | { 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-styles/styles/4.css: -------------------------------------------------------------------------------- 1 | a { color: red } 2 | -------------------------------------------------------------------------------- /spec/fixtures/shebang: -------------------------------------------------------------------------------- 1 | #!/usr/bin/ruby 2 | 3 | puts "Atom fixture test" 4 | -------------------------------------------------------------------------------- /spec/fixtures/typescript/invalid.ts: -------------------------------------------------------------------------------- 1 | var foo = 123 123; // Syntax error 2 | -------------------------------------------------------------------------------- /spec/fixtures/typescript/valid.ts: -------------------------------------------------------------------------------- 1 | var inc = v => v + 1 2 | export = inc 3 | -------------------------------------------------------------------------------- /spec/fixtures/native-cache/file-1.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { return 1; } 2 | -------------------------------------------------------------------------------- /spec/fixtures/native-cache/file-2.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { return 2; } 2 | -------------------------------------------------------------------------------- /spec/fixtures/native-cache/file-3.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { return 3; } 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-broken-keymap/keymaps/broken.json: -------------------------------------------------------------------------------- 1 | INVALID 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-broken-package-json/package.json: -------------------------------------------------------------------------------- 1 | INVALID 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-grammar/grammars/grammar.json: -------------------------------------------------------------------------------- 1 | >< 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-settings/settings/settings.json: -------------------------------------------------------------------------------- 1 | >< 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-no-activate/index.js: -------------------------------------------------------------------------------- 1 | module.exports = {} 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-without-module/package.cson: -------------------------------------------------------------------------------- 1 | "name": "perfect" 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/jstips/git.git: -------------------------------------------------------------------------------- 1 | gitdir: ../.git/modules/jstips 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-index-css/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "ui" 3 | } 4 | -------------------------------------------------------------------------------- /dot-atom/packages/README.md: -------------------------------------------------------------------------------- 1 | All packages in this directory will be automatically loaded 2 | -------------------------------------------------------------------------------- /spec/fixtures/babel/babel-comment.js: -------------------------------------------------------------------------------- 1 | /** @babel */ 2 | 3 | module.exports = v => v + 1 4 | -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/refs/heads/master: -------------------------------------------------------------------------------- 1 | ef046e9eecaa5255ea5e9817132d4001724d6ae1 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/refs/heads/master: -------------------------------------------------------------------------------- 1 | ef046e9eecaa5255ea5e9817132d4001724d6ae1 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/gitdir: -------------------------------------------------------------------------------- 1 | .git 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/test 2 | -------------------------------------------------------------------------------- /spec/fixtures/native-cache/file-4.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { return "file-4" } 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-index/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-serialize-error/package.cson: -------------------------------------------------------------------------------- 1 | 'main': 'index.coffee' 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-index-less/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "ui" 3 | } 4 | -------------------------------------------------------------------------------- /static/octicons.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/static/octicons.woff -------------------------------------------------------------------------------- /resources/mac/file.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/mac/file.icns -------------------------------------------------------------------------------- /spec/fixtures/babel/babel-double-quotes.js: -------------------------------------------------------------------------------- 1 | "use babel"; 2 | 3 | module.exports = v => v + 1 4 | -------------------------------------------------------------------------------- /spec/fixtures/babel/babel-single-quotes.js: -------------------------------------------------------------------------------- 1 | 'use babel'; 2 | 3 | module.exports = v => v + 1 4 | -------------------------------------------------------------------------------- /spec/fixtures/babel/invalid.js: -------------------------------------------------------------------------------- 1 | 'use 6to6'; 2 | 3 | module.exports = async function hello() {} 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-main/main-module.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus-manifest/package.cson: -------------------------------------------------------------------------------- 1 | menus: ["menu-2", "menu-1"] 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-style-sheets-manifest/package.cson: -------------------------------------------------------------------------------- 1 | styleSheets: ['2', '1'] 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-stylesheets-manifest/package.cson: -------------------------------------------------------------------------------- 1 | styleSheets: ['2', '1'] 2 | -------------------------------------------------------------------------------- /resources/win/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/win/loading.gif -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/test/css.spec.js: -------------------------------------------------------------------------------- 1 | // test for CSS related -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/refs/heads/master: -------------------------------------------------------------------------------- 1 | 8a9c86f1cb1f14b8f436eb91f4b052c8802ca99e 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps-manifest/package.cson: -------------------------------------------------------------------------------- 1 | keymaps: ["keymap-2", "keymap-1"] 2 | -------------------------------------------------------------------------------- /.npmrc: -------------------------------------------------------------------------------- 1 | cache = ~/.atom/.npm 2 | runtime = electron 3 | disturl = https://atom.io/download/atom-shell 4 | -------------------------------------------------------------------------------- /dot-atom/.gitignore: -------------------------------------------------------------------------------- 1 | blob-store 2 | compile-cache 3 | dev 4 | storage 5 | .apm 6 | .node-gyp 7 | .npm 8 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-activation-commands/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = activate: -> 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-activation-hooks/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = activate: -> 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps/keymaps/keymap-1.cson: -------------------------------------------------------------------------------- 1 | ".test-1": 2 | "ctrl-z": "test-1" 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps/keymaps/keymap-2.cson: -------------------------------------------------------------------------------- 1 | ".test-2": 2 | "ctrl-z": "test-2" 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps/keymaps/keymap-3.cjson: -------------------------------------------------------------------------------- 1 | ".test-3": 2 | "ctrl-z": "test-3" 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-styles/styles/1.css: -------------------------------------------------------------------------------- 1 | #jasmine-content { 2 | font-size: 1px; 3 | } 4 | -------------------------------------------------------------------------------- /resources/win/apm.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | "%~dp0\..\app\apm\bin\node.exe" "%~dp0\..\app\apm\lib\cli.js" %* 4 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/test/dom.spec.js: -------------------------------------------------------------------------------- 1 | // test for CSS and style related -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/test/utilities.spec.js: -------------------------------------------------------------------------------- 1 | // test for Utilities related -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/refs/heads/master: -------------------------------------------------------------------------------- 1 | d2b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/jstips/resources/log.js: -------------------------------------------------------------------------------- 1 | (() => { 2 | console.log('Hello world'); 3 | })(); -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-main/package.cson: -------------------------------------------------------------------------------- 1 | 'main': 'main-module.coffee' 2 | 'version': '2.3.4' 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-index-css/index.css: -------------------------------------------------------------------------------- 1 | atom-text-editor { 2 | padding-top: 1234px; 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/wordcount/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "wordcount", 3 | "version": "2.0.9" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/script-with-deprecations.js: -------------------------------------------------------------------------------- 1 | require('fs').existsSync('hi'); 2 | process.stdout.write('hi'); 3 | -------------------------------------------------------------------------------- /spec/fixtures/task-spec-handler.coffee: -------------------------------------------------------------------------------- 1 | module.exports = -> 2 | emit("some-event", 1, 2, 3) 3 | 'hello' 4 | -------------------------------------------------------------------------------- /resources/app-icons/beta/atom.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/atom.ico -------------------------------------------------------------------------------- /resources/app-icons/dev/atom.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/atom.icns -------------------------------------------------------------------------------- /resources/app-icons/dev/atom.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/atom.ico -------------------------------------------------------------------------------- /spec/fixtures/babel/flow-comment.js: -------------------------------------------------------------------------------- 1 | /* @flow */ 2 | 3 | const f: Function = v => v + 1 4 | module.exports = f 5 | -------------------------------------------------------------------------------- /spec/fixtures/css.css: -------------------------------------------------------------------------------- 1 | body { 2 | font-size: 1234px; 3 | width: 110%; 4 | font-weight: bold !important; 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | presets: ["es2015", "stage-0"] 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/git.git: -------------------------------------------------------------------------------- 1 | gitdir: ../.git/modules/You-Dont-Need-jQuery 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/ORIG_HEAD: -------------------------------------------------------------------------------- 1 | 9f0218b7652b622afea799a4723490c43e1af1fe 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/refs/remotes/origin/master: -------------------------------------------------------------------------------- 1 | d2b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/node_modules/compatible-native-module/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/build/Release/native.node: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-3.cson: -------------------------------------------------------------------------------- 1 | ".test-3": 2 | "ctrl-y": "keymap-3" 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/sublime-tabs/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sublime-tabs", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /resources/app-icons/beta/atom.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/atom.icns -------------------------------------------------------------------------------- /resources/app-icons/beta/png/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/128.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/16.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/24.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/256.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/32.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/48.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/512.png -------------------------------------------------------------------------------- /resources/app-icons/beta/png/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/64.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/1024.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/128.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/16.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/24.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/256.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/32.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/48.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/512.png -------------------------------------------------------------------------------- /resources/app-icons/dev/png/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/dev/png/64.png -------------------------------------------------------------------------------- /resources/app-icons/stable/atom.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/atom.icns -------------------------------------------------------------------------------- /resources/app-icons/stable/atom.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/atom.ico -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/ignore.git/index -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/master.git/index -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/refs/heads/test: -------------------------------------------------------------------------------- 1 | 0525ef667328cb1f86b1ddf523db4a064e1590fa 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/refs/remotes/origin/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/remotes/origin/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-deactivate/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | deactivate: -> 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/node_modules/native-module/build/Release/native.node: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-style-sheets-manifest/styles/1.css: -------------------------------------------------------------------------------- 1 | #jasmine-content { 2 | font-size: 1px; 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-style-sheets-manifest/styles/3.css: -------------------------------------------------------------------------------- 1 | #jasmine-content { 2 | font-size: 3px; 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-styles/styles/3.test-context.css: -------------------------------------------------------------------------------- 1 | #jasmine-content { 2 | font-size: 3px; 3 | } 4 | -------------------------------------------------------------------------------- /spec/fixtures/sample.less: -------------------------------------------------------------------------------- 1 | @color: #4D926F; 2 | 3 | #header { 4 | color: @color; 5 | } 6 | h2 { 7 | color: @color; 8 | } -------------------------------------------------------------------------------- /apm/README.md: -------------------------------------------------------------------------------- 1 | This folder is where [apm](https://github.com/atom/apm) is installed to so that 2 | it is bundled with Atom. 3 | -------------------------------------------------------------------------------- /resources/app-icons/beta/png/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/beta/png/1024.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/128.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/16.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/24.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/256.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/32.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/48.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/512.png -------------------------------------------------------------------------------- /resources/app-icons/stable/png/64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/64.png -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/refs/heads/master: -------------------------------------------------------------------------------- 1 | 9f0218b7652b622afea799a4723490c43e1af1fe 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-that-throws-an-exception/index.coffee: -------------------------------------------------------------------------------- 1 | throw new Error("This package throws an exception") 2 | -------------------------------------------------------------------------------- /static/images/octocat-spinner-128.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/static/images/octocat-spinner-128.gif -------------------------------------------------------------------------------- /resources/app-icons/stable/png/1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/resources/app-icons/stable/png/1024.png -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | *.log 3 | node_modules 4 | coverage 5 | logs 6 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/ORIG_HEAD: -------------------------------------------------------------------------------- 1 | 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-styles/styles/2.less: -------------------------------------------------------------------------------- 1 | @size: 2px; 2 | 3 | #jasmine-content { 4 | font-size: @size; 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-ui-variables/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "ui", 3 | "styleSheets": ["editor.less"] 4 | } 5 | -------------------------------------------------------------------------------- /static/images/transparent-background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/static/images/transparent-background.gif -------------------------------------------------------------------------------- /script/build.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\build" %* 3 | ) ELSE ( 4 | node "%~dp0\build" %* 5 | ) 6 | -------------------------------------------------------------------------------- /script/clean.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\clean" %* 3 | ) ELSE ( 4 | node "%~dp0\clean" %* 5 | ) 6 | -------------------------------------------------------------------------------- /script/grunt.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\grunt" %* 3 | ) ELSE ( 4 | node "%~dp0\grunt" %* 5 | ) 6 | -------------------------------------------------------------------------------- /script/utils/compile-main-to-app: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | coffee -c -o /Applications/Atom.app/Contents/Resources/app/src/ src/main.coffee 4 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/refs/heads/master: -------------------------------------------------------------------------------- 1 | a78b35a896b890f0a2a4f1f924c5739776415250 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/refs/remotes/origin/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/remotes/origin/master 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/index -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-activation-commands/package.cson: -------------------------------------------------------------------------------- 1 | 'activationCommands': 2 | '.workspace': 'activation-command' 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-empty-menu", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/node_modules/compatible-native-module/build/Release/native.node: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-settings/settings/omg.cson: -------------------------------------------------------------------------------- 1 | '.source.omg': 2 | 'editor': 3 | 'increaseIndentPattern': '^a' 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-invalid-styles/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "theme-with-invalid-styles", 3 | "theme": "ui" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-syntax-variables/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "syntax", 3 | "styleSheets": ["editor.less"] 4 | } 5 | -------------------------------------------------------------------------------- /script/rpmbuild: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | script/build 6 | script/grunt mkrpm publish-build --stack --no-color --install-dir /usr 7 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-keymap/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-empty-keymap", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-1.json: -------------------------------------------------------------------------------- 1 | { 2 | ".test-1": { 3 | "ctrl-z": "keymap-1" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-keymaps-manifest/keymaps/keymap-2.cson: -------------------------------------------------------------------------------- 1 | ".test-1": 2 | "ctrl-z": "keymap-2" 3 | "ctrl-n": "keymap-2" 4 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-missing-consumed-services/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | 4 | deactivate: -> 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-missing-provided-services/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | 4 | deactivate: -> 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-no-activate/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-no-activate", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-rb-filetype/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-rb-filetype", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-incomplete-ui-variables/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "ui", 3 | "styleSheets": ["editor.less"] 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-index-less/index.less: -------------------------------------------------------------------------------- 1 | @padding: 4321px; 2 | 3 | atom-text-editor { 4 | padding-top: @padding; 5 | } 6 | -------------------------------------------------------------------------------- /script/cibuild.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\cibuild" %* 3 | ) ELSE ( 4 | node "%~dp0\cibuild" %* 5 | ) 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-grammar/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-invalid-grammar", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-styles/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-invalid-styles", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-style-sheets-manifest/styles/2.less: -------------------------------------------------------------------------------- 1 | @size: 2px; 2 | 3 | #jasmine-content { 4 | font-size: @size; 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-without-package-file/styles/b.css: -------------------------------------------------------------------------------- 1 | atom-text-editor { 2 | padding-right: 20px; 3 | padding-bottom: 20px; 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-without-package-file/styles/c.less: -------------------------------------------------------------------------------- 1 | @number: 30px; 2 | 3 | atom-text-editor { 4 | padding-bottom: @number; 5 | } 6 | -------------------------------------------------------------------------------- /resources/win/apm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | directory=$(dirname "$0") 4 | "$directory/../app/apm/bin/node.exe" "$directory/../app/apm/lib/cli.js" "$@" 5 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-settings/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-invalid-settings", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/sample-with-tabs.coffee: -------------------------------------------------------------------------------- 1 | # Econ 101 2 | if this.studyingEconomics 3 | buy() while supply > demand 4 | sell() until supply > demand 5 | -------------------------------------------------------------------------------- /spec/fixtures/task-handler-with-deprecations.coffee: -------------------------------------------------------------------------------- 1 | {deprecate} = require 'grim' 2 | 3 | deprecate('Fake task deprecation') 4 | module.exports = -> 5 | -------------------------------------------------------------------------------- /script/bootstrap.cmd: -------------------------------------------------------------------------------- 1 | @IF EXIST "%~dp0\node.exe" ( 2 | "%~dp0\node.exe" "%~dp0\bootstrap" %* 3 | ) ELSE ( 4 | node "%~dp0\bootstrap" %* 5 | ) 6 | 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/index -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-context-menu/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-invalid-context-menu", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-package-file/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "theme": "ui", 3 | "styleSheets": ["first.css", "second.less", "last.css"] 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-activation-hooks/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activateCallCount: 0 3 | 4 | activate: -> 5 | @activateCallCount++ 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-different-directory-name/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-a-totally-different-name", 3 | "version": "1.0.0" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-url-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-invalid-url-package-json", 3 | "repository": "foo" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus-manifest/menus/menu-3.cson: -------------------------------------------------------------------------------- 1 | 'context-menu': 2 | '.test-1': [ 3 | {label: 'Menu item 3', command: 'command-3'} 4 | ] 5 | -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/main.js: -------------------------------------------------------------------------------- 1 | throw new Error("this simulates a native module's failure to load") 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-incompatible-native-module/node_modules/native-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "native-module", 3 | "main": "./main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-short-url-package-json/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-short-url-package-json", 3 | "repository": "example/repo" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-package-file/styles/last.css: -------------------------------------------------------------------------------- 1 | atom-text-editor { 2 | /* padding-top: 103px; 3 | padding-right: 103px;*/ 4 | padding-bottom: 103px; 5 | } -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-without-package-file/styles/a.css: -------------------------------------------------------------------------------- 1 | atom-text-editor { 2 | padding-top: 10px; 3 | padding-right: 10px; 4 | padding-bottom: 10px; 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-that-throws-on-activate/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> throw new Error('Top that') 3 | deactivate: -> 4 | serialize: -> 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-that-throws-on-deactivate/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | deactivate: -> throw new Error('Top that') 4 | serialize: -> 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-config-defaults/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | configDefaults: 3 | numbers: { one: 1, two: 2 } 4 | 5 | activate: -> # no-op 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/node_modules/native-module/main.js: -------------------------------------------------------------------------------- 1 | throw new Error("this simulates a native module's failure to load") 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-without-package-file/styles/d.csv: -------------------------------------------------------------------------------- 1 | atom-text-editor { 2 | padding-top: 100px; 3 | padding-right: 100px; 4 | padding-bottom: 100px; 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-eval-time-api-calls/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-eval-time-api-calls", 3 | "version": "1.2.3", 4 | "main": "./index" 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/node_modules/native-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "native-module", 3 | "main": "./main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/sample-with-many-folds.js: -------------------------------------------------------------------------------- 1 | 1; 2 | 2; 3 | function f3() { 4 | return 4; 5 | }; 6 | 6; 7 | 7; 8 | function f8() { 9 | return 9; 10 | }; 11 | 11; 12 | 12; 13 | -------------------------------------------------------------------------------- /spec/fixtures/sample-with-tabs-and-leading-comment.coffee: -------------------------------------------------------------------------------- 1 | # This is a comment 2 | if this.studyingEconomics 3 | buy() while supply > demand 4 | sell() until supply > demand 5 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/index -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/packed-refs: -------------------------------------------------------------------------------- 1 | # pack-refs with: peeled fully-peeled 2 | 9f0218b7652b622afea799a4723490c43e1af1fe refs/remotes/origin/master 3 | -------------------------------------------------------------------------------- /spec/integration/fixtures/atom-home/config.cson: -------------------------------------------------------------------------------- 1 | "*": 2 | welcome: 3 | showOnStartup: false 4 | "exception-reporting": 5 | userId: "7c0a3c52-795c-5e20-5323-64efcf91f212" 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-activation-hooks/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-empty-activation-hooks", 3 | "version": "0.1.0", 4 | "activationHooks": [] 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-serialization/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: ({@someNumber}) -> 3 | @someNumber ?= 1 4 | 5 | serialize: -> 6 | {@someNumber} 7 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-package-file/styles/first.css: -------------------------------------------------------------------------------- 1 | atom-text-editor { 2 | padding-top: 101px; 3 | padding-right: 101px; 4 | padding-bottom: 101px; 5 | 6 | color: red; 7 | } -------------------------------------------------------------------------------- /static/babelrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "breakConfig": true, 3 | "sourceMap": "inline", 4 | "blacklist": ["es6.forOf", "useStrict"], 5 | "optional": ["asyncToGenerator"], 6 | "stage": 0 7 | } 8 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-deprecated-pane-item-method/index.coffee: -------------------------------------------------------------------------------- 1 | class TestItem 2 | getUri: -> "test" 3 | 4 | exports.activate = -> 5 | atom.workspace.addOpener -> new TestItem 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-incompatible-native-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-incompatible-native-module", 3 | "version": "1.0.0", 4 | "main": "./main.js" 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/packed-refs: -------------------------------------------------------------------------------- 1 | # pack-refs with: peeled fully-peeled 2 | 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a refs/remotes/origin/master 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/node_modules/compatible-native-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "compatible-native-module", 3 | "main": "./main.js" 4 | } 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-serialize-error/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | 4 | deactivate: -> 5 | 6 | serialize: -> 7 | throw new Error("I'm no good at this.") 8 | -------------------------------------------------------------------------------- /script/grunt: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var runGrunt = require('./utils/run-grunt.js'); 3 | 4 | // build/node_modules/.bin/grunt "$@" 5 | var args = process.argv.slice(2); 6 | runGrunt(args, process.exit); 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/ignore.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7 -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/ignore.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /spec/fixtures/git/ignore.git/objects/ef/046e9eecaa5255ea5e9817132d4001724d6ae1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/ignore.git/objects/ef/046e9eecaa5255ea5e9817132d4001724d6ae1 -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/master.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7 -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/master.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /spec/fixtures/git/master.git/objects/ef/046e9eecaa5255ea5e9817132d4001724d6ae1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/master.git/objects/ef/046e9eecaa5255ea5e9817132d4001724d6ae1 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/jstips/resources/jstips-header-blog.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/jstips/resources/jstips-header-blog.gif -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-injection-selector/grammars/grammar.cson: -------------------------------------------------------------------------------- 1 | 'name': 'test' 2 | 'scopeName': 'source.test' 3 | 'injectionSelector': 'comment' 4 | 'patterns': [{'include': 'source.sql'}] 5 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-package-file/styles/second.less: -------------------------------------------------------------------------------- 1 | @number: 102px; 2 | 3 | atom-text-editor { 4 | /* padding-top: 102px;*/ 5 | padding-right: @number; 6 | padding-bottom: @number; 7 | } -------------------------------------------------------------------------------- /script/utils/clean-open-with-menu: -------------------------------------------------------------------------------- 1 | /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -kill -r -domain local -domain system -domain user 2 | killall Finder 3 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/index -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-activation-hooks/package.cson: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-activation-hooks", 3 | "version": "0.1.0", 4 | "activationHooks": ['language-fictitious:grammar-used'] 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus/menus/menu-2.cson: -------------------------------------------------------------------------------- 1 | 'menu': [ 2 | { 'label': 'Last' } 3 | ] 4 | 5 | 'context-menu': 6 | '.test-1': [ 7 | {label: 'Menu item 2', command: 'command-2'} 8 | ] 9 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-eval-time-api-calls/index.js: -------------------------------------------------------------------------------- 1 | atom.deserializers.add('MyDeserializer', function (state) { 2 | return {state: state, a: 'b'} 3 | }) 4 | 5 | exports.activate = function () {} 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus/menus/menu-1.cson: -------------------------------------------------------------------------------- 1 | 'menu': [ 2 | {'label': 'Second to Last'} 3 | ] 4 | 5 | 'context-menu': 6 | '.test-1': [ 7 | {label: 'Menu item 1', command: 'command-1'} 8 | ] 9 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-empty-activation-commands/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-empty-activation-commands", 3 | "version": "0.1.0", 4 | "activationCommands": {"atom-workspace": []} 5 | } 6 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus-manifest/menus/menu-1.cson: -------------------------------------------------------------------------------- 1 | 'menu': [ 2 | { 'label': 'Last' } 3 | ] 4 | 5 | 'context-menu': 6 | '.test-1': [ 7 | {label: 'Menu item 1', command: 'command-1'} 8 | ] 9 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus/menus/menu-3.cson: -------------------------------------------------------------------------------- 1 | 'menu': [ 2 | { 'label': 'Second to Last' } 3 | ] 4 | 5 | 'context-menu': 6 | '.test-1': [ 7 | {label: 'Menu item 3', command: 'command-3'} 8 | ] 9 | -------------------------------------------------------------------------------- /src/special-token-symbols.coffee: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | SoftTab: Symbol('SoftTab') 3 | HardTab: Symbol('HardTab') 4 | PairedCharacter: Symbol('PairedCharacter') 5 | SoftWrapIndent: Symbol('SoftWrapIndent') 6 | } 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/06/15f9a45968b3515e0a202530ef9f61aba26b6c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/06/15f9a45968b3515e0a202530ef9f61aba26b6c -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/16/735fb793d7b038818219c4b8c6295346e20eef: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/16/735fb793d7b038818219c4b8c6295346e20eef -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/52/f56457b6fca045ce41bb9d32e6ca79d23192af: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/52/f56457b6fca045ce41bb9d32e6ca79d23192af -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/5b/24ab4c3baadf534242b1acc220c8fa051b9b20: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/5b/24ab4c3baadf534242b1acc220c8fa051b9b20 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/65/a457425a679cbe9adf0d2741785d3ceabb44a7 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/66/dc9051da651c15d98d017a88658263cab28f02: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/66/dc9051da651c15d98d017a88658263cab28f02 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/8a/9c86f1cb1f14b8f436eb91f4b052c8802ca99e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/8a/9c86f1cb1f14b8f436eb91f4b052c8802ca99e -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/ec/5e386905ff2d36e291086a1207f2585aaa8920: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/ec/5e386905ff2d36e291086a1207f2585aaa8920 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/ef/046e9eecaa5255ea5e9817132d4001724d6ae1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/ef/046e9eecaa5255ea5e9817132d4001724d6ae1 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/fe/bde178cdf35e9df6279d87aa27590c6d92e354: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/fe/bde178cdf35e9df6279d87aa27590c6d92e354 -------------------------------------------------------------------------------- /spec/fixtures/git/working-dir/git.git/objects/ff/c8218bd2240a0cb92f6f02548d45784428349b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/working-dir/git.git/objects/ff/c8218bd2240a0cb92f6f02548d45784428349b -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-menus-manifest/menus/menu-2.cson: -------------------------------------------------------------------------------- 1 | 'menu': [ 2 | { 'label': 'Second to Last' } 3 | ] 4 | 5 | 'context-menu': 6 | '.test-1': [ 7 | {label: 'Menu item 2', command: 'command-2'} 8 | ] 9 | -------------------------------------------------------------------------------- /static/links.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | a { 4 | cursor: pointer; 5 | color: @text-color-highlight; 6 | &:hover { 7 | color: @text-color-highlight; 8 | text-decoration: underline; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-incomplete-ui-variables/styles/ui-variables.less: -------------------------------------------------------------------------------- 1 | // This does not contain all of the ui-variables available. 2 | @app-background-color: #00f; // Changed 3 | @input-background-color: #f00; // Changed 4 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/3e/2fe2f8226faab789f70d6d8a7231e4f2bd54df: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/3e/2fe2f8226faab789f70d6d8a7231e4f2bd54df -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/40/f4e79926a85134d4c905d04e70573b6616f3bc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/40/f4e79926a85134d4c905d04e70573b6616f3bc -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/50/b89367d8f0acd312ef5aa012eac20a75c91351: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/50/b89367d8f0acd312ef5aa012eac20a75c91351 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/54/3b9bebdc6bd5c4b22136034a95dd097a57d3dd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/54/3b9bebdc6bd5c4b22136034a95dd097a57d3dd -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/d2/b0ad9cbc6f6c4372e8956e5cc5af771b2342e5: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/d2/b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/d3/e073baf592c56614c68ead9e2cd0a3880140cd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/d3/e073baf592c56614c68ead9e2cd0a3880140cd -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-context-menu/menus/menu.json: -------------------------------------------------------------------------------- 1 | { 2 | "context-menu": { 3 | "<>": [ 4 | { 5 | "label": "Hello", 6 | "command:": "world" 7 | } 8 | ] 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-consumed-services/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | 4 | deactivate: -> 5 | 6 | consumeFirstServiceV3: -> 7 | 8 | consumeFirstServiceV4: -> 9 | 10 | consumeSecondService: -> 11 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-rb-filetype/grammars/rb.cson: -------------------------------------------------------------------------------- 1 | 'name': 'Test Ruby' 2 | 'scopeName': 'test.rb' 3 | 'fileTypes': [ 4 | 'rb' 5 | ] 6 | 'patterns': [ 7 | { 8 | 'match': 'ruby' 9 | 'name': 'meta.class.ruby' 10 | } 11 | ] 12 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 9f0218b7652b622afea799a4723490c43e1af1fe joshaber 1452186187 -0500 clone: from https://github.com/loverajoel/jstips 2 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-invalid-activation-commands/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-invalid-activation-commands", 3 | "version": "1.0.0", 4 | "activationCommands": { 5 | "<>": [ 6 | "foo:bar" 7 | ] 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "jstips"] 2 | path = jstips 3 | url = https://github.com/loverajoel/jstips 4 | [submodule "You-Dont-Need-jQuery"] 5 | path = You-Dont-Need-jQuery 6 | url = https://github.com/oneuijs/You-Dont-Need-jQuery 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/logs/refs/remotes/origin/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 9f0218b7652b622afea799a4723490c43e1af1fe joshaber 1452186187 -0500 clone: from https://github.com/loverajoel/jstips 2 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/05/25ef667328cb1f86b1ddf523db4a064e1590fa: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/05/25ef667328cb1f86b1ddf523db4a064e1590fa -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/1a/dd860234dad4a8bf59340363e9c88bb0457cb7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/1a/dd860234dad4a8bf59340363e9c88bb0457cb7 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/5b/35953562dbb4f2debe88fcc9ac1805064e1e5a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/5b/35953562dbb4f2debe88fcc9ac1805064e1e5a -------------------------------------------------------------------------------- /src/safe-clipboard.coffee: -------------------------------------------------------------------------------- 1 | # Using clipboard in renderer process is not safe on Linux. 2 | module.exports = 3 | if process.platform is 'linux' and process.type is 'renderer' 4 | require('electron').remote.clipboard 5 | else 6 | require('electron').clipboard 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "5" 4 | - "4" 5 | before_script: 6 | - export DISPLAY=:99.0 7 | - sh -e /etc/init.d/xvfb start 8 | script: 9 | - npm run lint 10 | - npm test 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.swp 2 | *~ 3 | .DS_Store 4 | Thumbs.db 5 | .project 6 | .svn 7 | .nvm-version 8 | node_modules 9 | npm-debug.log 10 | debug.log 11 | /tags 12 | /atom-shell/ 13 | /electron/ 14 | /out/ 15 | docs/output 16 | docs/includes 17 | spec/fixtures/evil-files/ 18 | out/ 19 | -------------------------------------------------------------------------------- /spec/fixtures/sample-with-tabs-and-initial-comment.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Look, this is a comment. Don't go making assumtions that I want soft tabs 3 | * because this block comment has leading spaces, Geez. 4 | */ 5 | 6 | if (beNice) { 7 | console.log('Thank you for being nice.'); 8 | } 9 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/test/README.md: -------------------------------------------------------------------------------- 1 | # Test cases for all the tips 2 | 3 | ## Usage 4 | 5 | run all tests once 6 | ``` 7 | npm run test 8 | ``` 9 | 10 | run tests on TDD(Test Driven Development) mode 11 | ``` 12 | npm run tdd 13 | ``` 14 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /static/icons.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | .icon::before { 4 | margin-right: @component-icon-padding; 5 | } 6 | 7 | a.icon, 8 | button.icon { 9 | text-decoration: none; 10 | color: @text-color; 11 | &:hover{ 12 | color: @text-color-highlight; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /apm/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "atom-bundled-apm", 3 | "description": "Atom's bundled apm", 4 | "repository": { 5 | "type": "git", 6 | "url": "https://github.com/atom/atom.git" 7 | }, 8 | "dependencies": { 9 | "atom-package-manager": "1.10.0" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/logs/refs/remotes/origin/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a joshaber 1452186236 -0500 clone: from https://github.com/oneuijs/You-Dont-Need-jQuery 2 | -------------------------------------------------------------------------------- /static/markdown.less: -------------------------------------------------------------------------------- 1 | .source.gfm { 2 | .markup.heading { 3 | font-weight: bold; 4 | } 5 | 6 | .bold { 7 | font-weight: bold; 8 | } 9 | 10 | .italic { 11 | font-style: italic; 12 | } 13 | 14 | .comment.quote { 15 | font-style: italic; 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/a7/8b35a896b890f0a2a4f1f924c5739776415250: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/a7/8b35a896b890f0a2a4f1f924c5739776415250 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/ae/897dce6e0590f08dddfe9a5152e237e955ca57: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/ae/897dce6e0590f08dddfe9a5152e237e955ca57 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/be/8ed228c0a080145d28ed625a5f487caae6a3f9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/be/8ed228c0a080145d28ed625a5f487caae6a3f9 -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/pack/pack-e568a55e02b6b7b75582924204669e4f3ed5276f.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/pack/pack-e568a55e02b6b7b75582924204669e4f3ed5276f.idx -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/pack/pack-e568a55e02b6b7b75582924204669e4f3ed5276f.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/objects/pack/pack-e568a55e02b6b7b75582924204669e4f3ed5276f.pack -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-ui-variables/styles/editor.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | atom-text-editor { 4 | padding-top: @component-padding; 5 | padding-right: @component-padding; 6 | padding-bottom: @component-padding; 7 | 8 | color: @input-background-color; 9 | } 10 | -------------------------------------------------------------------------------- /static/linux.less: -------------------------------------------------------------------------------- 1 | ::-webkit-scrollbar-corner { 2 | background-color: transparent; 3 | } 4 | 5 | ::-webkit-scrollbar { 6 | width: 8px; 7 | height: 8px; 8 | } 9 | 10 | ::-webkit-scrollbar-thumb { 11 | -webkit-border-radius: 2px; 12 | background: rgba(150, 150, 150, .33); 13 | } 14 | -------------------------------------------------------------------------------- /static/popover-list.less: -------------------------------------------------------------------------------- 1 | .select-list.popover-list { 2 | width: 200px; 3 | min-width: 200px; 4 | margin-left: 0; 5 | position: relative; 6 | } 7 | 8 | .select-list.popover-list ol.list-group { 9 | position: relative; 10 | overflow-y: scroll; 11 | max-height: 200px; 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-deserializers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-deserializers", 3 | "version": "1.0.0", 4 | "main": "./index", 5 | "deserializers": { 6 | "Deserializer1": "deserializeMethod1", 7 | "Deserializer2": "deserializeMethod2" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-grammars/grammars/alot.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': ['alot', 'foobizbang'] 2 | 'name': 'Alot' 3 | 'scopeName': 'source.alot' 4 | 5 | 'patterns': [ 6 | { 7 | 'captures': 8 | '0': 9 | 'name': 'keyword.alot' 10 | 'match': 'alot' 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-grammars/grammars/alittle.cson: -------------------------------------------------------------------------------- 1 | 'fileTypes': ['alittle'] 2 | 'name': 'Alittle' 3 | 'scopeName': 'source.alittle' 4 | 5 | 'patterns': [ 6 | { 7 | 'captures': 8 | '0': 9 | 'name': 'keyword.alittle' 10 | 'match': 'alittle' 11 | } 12 | ] 13 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-missing-consumed-services/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-missing-consumed-services", 3 | 4 | "consumedServices": { 5 | "service-1": { 6 | "versions": { 7 | ">=0.1": "consumeMissingService" 8 | } 9 | } 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/pack/pack-d38b3bc339acd655e8dae9c0dcea8bb2ec174d16.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/pack/pack-d38b3bc339acd655e8dae9c0dcea8bb2ec174d16.idx -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/pack/pack-d38b3bc339acd655e8dae9c0dcea8bb2ec174d16.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/samus-aran/atom/HEAD/spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/objects/pack/pack-d38b3bc339acd655e8dae9c0dcea8bb2ec174d16.pack -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | whitespace is nicespace 2 | # Please enter the commit message for your changes. Lines starting 3 | # with '#' will be ignored, and an empty message aborts the commit. 4 | # On branch test 5 | # Changes to be committed: 6 | # modified: README.md 7 | # 8 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-json-config-schema/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-json-config-schema", 3 | "configSchema": { 4 | "a": { 5 | "type": "number", 6 | "default": 5 7 | }, 8 | "b": { 9 | "type": "string", 10 | "default": "five" 11 | } 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-config-schema/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | config: 3 | numbers: 4 | type: 'object' 5 | properties: 6 | one: 7 | type: 'integer' 8 | default: 1 9 | two: 10 | type: 'integer' 11 | default: 2 12 | 13 | activate: -> # no-op 14 | -------------------------------------------------------------------------------- /resources/linux/atom.desktop.in: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Name=<%= appName %> 3 | Comment=<%= description %> 4 | GenericName=Text Editor 5 | Exec=<%= installDir %>/share/<%= appFileName %>/atom %U 6 | Icon=<%= iconPath %> 7 | Type=Application 8 | StartupNotify=true 9 | Categories=GNOME;GTK;Utility;TextEditor;Development; 10 | MimeType=text/plain; 11 | -------------------------------------------------------------------------------- /script/copy-folder.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | set USAGE=Usage: %0 source destination 4 | 5 | if [%1] == [] ( 6 | echo %USAGE% 7 | exit 1 8 | ) 9 | if [%2] == [] ( 10 | echo %USAGE% 11 | exit 2 12 | ) 13 | 14 | :: rm -rf %2 15 | if exist %2 rmdir %2 /s /q 16 | 17 | :: cp -rf %1 %2 18 | (robocopy %1 %2 /e) ^& IF %ERRORLEVEL% LEQ 1 exit 0 19 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-missing-provided-services/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-missing-provided-services", 3 | 4 | "providedServices": { 5 | "service-1": { 6 | "description": "The first service", 7 | "versions": { 8 | "0.2.9": "provideMissingService" 9 | } 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /resources/linux/debian/lintian-overrides: -------------------------------------------------------------------------------- 1 | atom: arch-dependent-file-in-usr-share 2 | atom: changelog-file-missing-in-native-package 3 | atom: copyright-file-contains-full-apache-2-license 4 | atom: copyright-should-refer-to-common-license-file-for-apache-2 5 | atom: embedded-library 6 | atom: package-installs-python-bytecode 7 | atom: unstripped-binary-or-object 8 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 d3e073baf592c56614c68ead9e2cd0a3880140cd joshaber 1452185922 -0500 commit (initial): first 2 | d3e073baf592c56614c68ead9e2cd0a3880140cd d2b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 joshaber 1452186239 -0500 commit: submodules 3 | -------------------------------------------------------------------------------- /script/utils/fix-author: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | usage() { 4 | echo "usage: $0 sha name email" 5 | exit 1 6 | } 7 | 8 | if [ ! $3 ]; then 9 | usage 10 | fi 11 | 12 | git filter-branch -f --env-filter " 13 | export GIT_AUTHOR_NAME='$2' 14 | export GIT_AUTHOR_EMAIL='$3' 15 | export GIT_COMMITTER_NAME='$2' 16 | export GIT_COMMITTER_EMAIL='$3' 17 | " -- $1..HEAD -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 d3e073baf592c56614c68ead9e2cd0a3880140cd joshaber 1452185922 -0500 commit (initial): first 2 | d3e073baf592c56614c68ead9e2cd0a3880140cd d2b0ad9cbc6f6c4372e8956e5cc5af771b2342e5 joshaber 1452186239 -0500 commit: submodules 3 | -------------------------------------------------------------------------------- /script/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var safeExec = require('./utils/child-process-wrapper.js').safeExec; 3 | var runGrunt = require('./utils/run-grunt.js'); 4 | var path = require('path'); 5 | 6 | process.chdir(path.dirname(__dirname)); 7 | 8 | safeExec('node script/bootstrap', function() { 9 | runGrunt(["ci", "--stack", "--no-color"], process.exit); 10 | }); 11 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | submodules 2 | # Please enter the commit message for your changes. Lines starting 3 | # with '#' will be ignored, and an empty message aborts the commit. 4 | # On branch master 5 | # Changes to be committed: 6 | # new file: .gitmodules 7 | # new file: You-Dont-Need-jQuery 8 | # new file: jstips 9 | # 10 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-view-providers/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-view-providers", 3 | "main": "./index", 4 | "version": "1.0.0", 5 | "deserializers": { 6 | "DeserializerFromPackageWithViewProviders": "theDeserializerMethod" 7 | }, 8 | "viewProviders": [ 9 | "viewProviderMethod1", 10 | "viewProviderMethod2" 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-cached-incompatible-native-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-cached-incompatible-native-module", 3 | "version": "1.0.0", 4 | "main": "./main.js", 5 | "_atomModuleCache": { 6 | "extensions": { 7 | ".node": [ 8 | "node_modules/native-module/build/Release/native.node" 9 | ] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-provided-services/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activate: -> 3 | 4 | deactivate: -> 5 | 6 | provideFirstServiceV2: -> 7 | 'first-service-v2' 8 | 9 | provideFirstServiceV3: -> 10 | 'first-service-v3' 11 | 12 | provideFirstServiceV4: -> 13 | 'first-service-v4' 14 | 15 | provideSecondService: -> 16 | 'second-service' 17 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/logs/refs/heads/test: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 9f0218b7652b622afea799a4723490c43e1af1fe joshaber 1452201852 -0500 branch: Created from HEAD 2 | 9f0218b7652b622afea799a4723490c43e1af1fe 0525ef667328cb1f86b1ddf523db4a064e1590fa joshaber 1452201881 -0500 commit: whitespace is nicespace 3 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-ignored-incompatible-native-module/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-ignored-incompatible-native-module", 3 | "version": "1.0.0", 4 | "main": "./main.js", 5 | "_atomModuleCache": { 6 | "extensions": { 7 | ".node": [ 8 | "node_modules/compatible-native-module/build/Release/native.node" 9 | ] 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-prefixed-and-suffixed-repo-url/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-a-git-prefixed-git-repo-url", 3 | "repository": { 4 | "type": "git", 5 | "url": "git+https://github.com/example/repo.git" 6 | }, 7 | "_id": "this is here to simulate the URL being already normalized by npm. we still need to stript git+ from the beginning and .git from the end." 8 | } 9 | -------------------------------------------------------------------------------- /spec/fixtures/packages/theme-with-incomplete-ui-variables/styles/editor.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | atom-text-editor { 4 | padding-top: @component-padding; 5 | padding-right: @component-padding; 6 | padding-bottom: @component-padding; 7 | 8 | color: @input-background-color; 9 | background-color: @background-color-info; // From the fallback variables, not overridden 10 | } 11 | -------------------------------------------------------------------------------- /resources/win/atom.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var spawn = require('child_process').spawn; 3 | 4 | var atomCommandPath = path.resolve(__dirname, '..', '..', 'atom.exe'); 5 | var arguments = process.argv.slice(2); 6 | arguments.unshift('--executed-from', process.cwd()); 7 | var options = {detached: true, stdio: 'ignore'}; 8 | spawn(atomCommandPath, arguments, options); 9 | process.exit(0); 10 | -------------------------------------------------------------------------------- /src/marker-observation-window.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | class MarkerObservationWindow 3 | constructor: (@decorationManager, @bufferWindow) -> 4 | 5 | setScreenRange: (range) -> 6 | @bufferWindow.setRange(@decorationManager.bufferRangeForScreenRange(range)) 7 | 8 | setBufferRange: (range) -> 9 | @bufferWindow.setRange(range) 10 | 11 | destroy: -> 12 | @bufferWindow.destroy() 13 | -------------------------------------------------------------------------------- /spec/atom-protocol-handler-spec.coffee: -------------------------------------------------------------------------------- 1 | describe '"atom" protocol URL', -> 2 | it 'sends the file relative in the package as response', -> 3 | called = false 4 | request = new XMLHttpRequest() 5 | request.addEventListener('load', -> called = true) 6 | request.open('GET', 'atom://async/package.json', true) 7 | request.send() 8 | 9 | waitsFor 'request to be done', -> called is true 10 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | whitespace is nicespace 2 | # Please enter the commit message for your changes. Lines starting 3 | # with '#' will be ignored, and an empty message aborts the commit. 4 | # On branch master 5 | # Your branch is up-to-date with 'origin/master'. 6 | # 7 | # Changes to be committed: 8 | # modified: README.md 9 | # 10 | -------------------------------------------------------------------------------- /src/item-registry.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | class ItemRegistry 3 | constructor: -> 4 | @items = new WeakSet 5 | 6 | addItem: (item) -> 7 | if @hasItem(item) 8 | throw new Error("The workspace can only contain one instance of item #{item}") 9 | @items.add(item) 10 | 11 | removeItem: (item) -> 12 | @items.delete(item) 13 | 14 | hasItem: (item) -> 15 | @items.has(item) 16 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-deserializers/index.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | activate () {}, 3 | 4 | deserializeMethod1 (state) { 5 | return { 6 | wasDeserializedBy: 'deserializeMethod1', 7 | state: state 8 | } 9 | }, 10 | 11 | deserializeMethod2 (state) { 12 | return { 13 | wasDeserializedBy: 'deserializeMethod2', 14 | state: state 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a joshaber 1452186236 -0500 clone: from https://github.com/oneuijs/You-Dont-Need-jQuery 2 | 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a a78b35a896b890f0a2a4f1f924c5739776415250 joshaber 1452202510 -0500 commit: whitespace is nicespace 3 | -------------------------------------------------------------------------------- /spec/typescript-spec.coffee: -------------------------------------------------------------------------------- 1 | describe "TypeScript transpiler support", -> 2 | describe "when there is a .ts file", -> 3 | it "transpiles it using typescript", -> 4 | transpiled = require('./fixtures/typescript/valid.ts') 5 | expect(transpiled(3)).toBe 4 6 | 7 | describe "when the .ts file is invalid", -> 8 | it "does not transpile", -> 9 | expect(-> require('./fixtures/typescript/invalid.ts')).toThrow() 10 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a joshaber 1452186236 -0500 clone: from https://github.com/oneuijs/You-Dont-Need-jQuery 2 | 2e9bbc77d60f20eb462ead5b2ac7405b62b9b90a a78b35a896b890f0a2a4f1f924c5739776415250 joshaber 1452202510 -0500 commit: whitespace is nicespace 3 | -------------------------------------------------------------------------------- /src/window-load-settings-helpers.coffee: -------------------------------------------------------------------------------- 1 | {remote} = require 'electron' 2 | _ = require 'underscore-plus' 3 | 4 | windowLoadSettings = null 5 | 6 | exports.getWindowLoadSettings = -> 7 | windowLoadSettings ?= JSON.parse(window.decodeURIComponent(window.location.hash.substr(1))) 8 | 9 | exports.setWindowLoadSettings = (settings) -> 10 | windowLoadSettings = settings 11 | location.hash = encodeURIComponent(JSON.stringify(settings)) 12 | -------------------------------------------------------------------------------- /dot-atom/init.coffee: -------------------------------------------------------------------------------- 1 | # Your init script 2 | # 3 | # Atom will evaluate this file each time a new window is opened. It is run 4 | # after packages are loaded/activated and after the previous editor state 5 | # has been restored. 6 | # 7 | # An example hack to log to the console when each text editor is saved. 8 | # 9 | # atom.workspace.observeTextEditors (editor) -> 10 | # editor.onDidSave -> 11 | # console.log "Saved! #{editor.getPath()}" 12 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | worktree = ../../../jstips 7 | ignorecase = true 8 | precomposeunicode = true 9 | [remote "origin"] 10 | url = https://github.com/loverajoel/jstips 11 | fetch = +refs/heads/*:refs/remotes/origin/* 12 | [branch "master"] 13 | remote = origin 14 | merge = refs/heads/master 15 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "eslint-config-airbnb", 3 | "env": { 4 | "browser": true, 5 | "mocha": true, 6 | "node": true 7 | }, 8 | "rules": { 9 | "valid-jsdoc": 2, 10 | "no-param-reassign": 0, 11 | "comma-dangle": 0, 12 | "one-var": 0, 13 | "no-else-return": 1, 14 | "no-unused-expressions": 0, 15 | "indent": 1, 16 | "eol-last": 0 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-consumed-services/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-consumed-services", 3 | 4 | "consumedServices": { 5 | "service-1": { 6 | "versions": { 7 | ">=0.2 <=0.3.6": "consumeFirstServiceV3", 8 | "^0.4.1": "consumeFirstServiceV4" 9 | } 10 | }, 11 | "service-2": { 12 | "versions": { 13 | "0.2.1 || 0.2.2": "consumeSecondService" 14 | } 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /spec/fixtures/sample.js: -------------------------------------------------------------------------------- 1 | var quicksort = function () { 2 | var sort = function(items) { 3 | if (items.length <= 1) return items; 4 | var pivot = items.shift(), current, left = [], right = []; 5 | while(items.length > 0) { 6 | current = items.shift(); 7 | current < pivot ? left.push(current) : right.push(current); 8 | } 9 | return sort(left).concat(pivot).concat(sort(right)); 10 | }; 11 | 12 | return sort(Array.apply(this, arguments)); 13 | }; -------------------------------------------------------------------------------- /.pairs: -------------------------------------------------------------------------------- 1 | pairs: 2 | ns: Nathan Sobo; nathan 3 | cj: Corey Johnson; cj 4 | dg: David Graham; dgraham 5 | ks: Kevin Sawicki; kevin 6 | jc: Jerry Cheung; jerry 7 | bl: Brian Lopez; brian 8 | jp: Justin Palmer; justin 9 | gt: Garen Torikian; garen 10 | mc: Matt Colyer; mcolyer 11 | bo: Ben Ogle; benogle 12 | jr: Jason Rudolph; jasonrudolph 13 | jl: Jessica Lord; jlord 14 | dh: Daniel Hengeveld; danielh 15 | email: 16 | domain: github.com 17 | #global: true 18 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | # VERSION: 0.1 2 | # DESCRIPTION: Image to build Atom and create a .rpm file 3 | 4 | # Base docker image 5 | FROM fedora:21 6 | 7 | # Install dependencies 8 | RUN yum install -y \ 9 | make \ 10 | gcc \ 11 | gcc-c++ \ 12 | glibc-devel \ 13 | git-core \ 14 | libgnome-keyring-devel \ 15 | rpmdevtools \ 16 | nodejs \ 17 | npm 18 | 19 | RUN npm install -g npm@1.4.28 --loglevel error 20 | 21 | ADD . /atom 22 | WORKDIR /atom 23 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | worktree = ../../../You-Dont-Need-jQuery 7 | ignorecase = true 8 | precomposeunicode = true 9 | [remote "origin"] 10 | url = https://github.com/oneuijs/You-Dont-Need-jQuery 11 | fetch = +refs/heads/*:refs/remotes/origin/* 12 | [branch "master"] 13 | remote = origin 14 | merge = refs/heads/master 15 | -------------------------------------------------------------------------------- /src/model.coffee: -------------------------------------------------------------------------------- 1 | nextInstanceId = 1 2 | 3 | module.exports = 4 | class Model 5 | @resetNextInstanceId: -> nextInstanceId = 1 6 | 7 | alive: true 8 | 9 | constructor: (params) -> 10 | @assignId(params?.id) 11 | 12 | assignId: (id) -> 13 | @id ?= id ? nextInstanceId++ 14 | nextInstanceId = id + 1 if id >= nextInstanceId 15 | 16 | destroy: -> 17 | return unless @isAlive() 18 | @alive = false 19 | @destroyed?() 20 | 21 | isAlive: -> @alive 22 | 23 | isDestroyed: -> not @isAlive() 24 | -------------------------------------------------------------------------------- /spec/fixtures/coffee.coffee: -------------------------------------------------------------------------------- 1 | class quicksort 2 | sort: (items) -> 3 | return items if items.length <= 1 4 | 5 | pivot = items.shift() 6 | left = [] 7 | right = [] 8 | 9 | # Comment in the middle 10 | 11 | while items.length > 0 12 | current = items.shift() 13 | if current < pivot 14 | left.push(current) 15 | else 16 | right.push(current); 17 | 18 | sort(left).concat(pivot).concat(sort(right)) 19 | 20 | noop: -> 21 | # just a noop 22 | 23 | exports.modules = quicksort 24 | -------------------------------------------------------------------------------- /script/cibuild-atom-rpm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | docker build -t atom-rpm . 6 | docker run \ 7 | --rm \ 8 | --env JANKY_SHA1="$JANKY_SHA1" \ 9 | --env JANKY_BRANCH="$JANKY_BRANCH" \ 10 | --env ATOM_ACCESS_TOKEN="$BUILD_ATOM_RPM_ACCESS_TOKEN" \ 11 | --env BUILD_ATOM_RELEASES_S3_KEY="$BUILD_ATOM_RPM_RELEASES_S3_KEY" \ 12 | --env BUILD_ATOM_RELEASES_S3_SECRET="$BUILD_ATOM_RPM_RELEASES_S3_SECRET" \ 13 | --env BUILD_ATOM_RELEASES_S3_BUCKET="$BUILD_ATOM_RPM_RELEASES_S3_BUCKET" \ 14 | atom-rpm /atom/script/rpmbuild 15 | docker rmi atom-rpm 16 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/repository-status-handler.coffee: -------------------------------------------------------------------------------- 1 | Git = require 'git-utils' 2 | path = require 'path' 3 | 4 | module.exports = (repoPath, paths = []) -> 5 | repo = Git.open(repoPath) 6 | 7 | upstream = {} 8 | submodules = {} 9 | 10 | if repo? 11 | for submodulePath, submoduleRepo of repo.submodules 12 | submodules[submodulePath] = 13 | branch: submoduleRepo.getHead() 14 | upstream: submoduleRepo.getAheadBehindCount() 15 | 16 | upstream = repo.getAheadBehindCount() 17 | repo.release() 18 | 19 | {upstream, submodules} 20 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-activation-commands/index.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | activateCallCount: 0 3 | activationCommandCallCount: 0 4 | legacyActivationCommandCallCount: 0 5 | 6 | activate: -> 7 | @activateCallCount++ 8 | 9 | atom.commands.add 'atom-workspace', 'activation-command', => 10 | @activationCommandCallCount++ 11 | 12 | editorView = atom.views.getView(atom.workspace.getActiveTextEditor())?.__spacePenView 13 | editorView?.command 'activation-command', => 14 | @legacyActivationCommandCallCount++ 15 | -------------------------------------------------------------------------------- /resources/win/atom.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Get current path in Windows format 3 | if command -v "cygpath" > /dev/null; then 4 | # We have cygpath to do the conversion 5 | ATOMCMD=$(cygpath "$(dirname "$0")/atom.cmd" -a -w) 6 | else 7 | # We don't have cygpath so try pwd -W 8 | pushd "$(dirname "$0")" > /dev/null 9 | ATOMCMD="$(pwd -W)/atom.cmd" 10 | popd > /dev/null 11 | fi 12 | if [ "$(uname -o)" == "Msys" ]; then 13 | cmd.exe //C "$ATOMCMD" "$@" # Msys thinks /C is a Windows path... 14 | else 15 | cmd.exe /C "$ATOMCMD" "$@" # Cygwin does not 16 | fi 17 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 9f0218b7652b622afea799a4723490c43e1af1fe joshaber 1452186187 -0500 clone: from https://github.com/loverajoel/jstips 2 | 9f0218b7652b622afea799a4723490c43e1af1fe 9f0218b7652b622afea799a4723490c43e1af1fe joshaber 1452201852 -0500 checkout: moving from master to test 3 | 9f0218b7652b622afea799a4723490c43e1af1fe 0525ef667328cb1f86b1ddf523db4a064e1590fa joshaber 1452201881 -0500 commit: whitespace is nicespace 4 | -------------------------------------------------------------------------------- /src/replace-handler.coffee: -------------------------------------------------------------------------------- 1 | {PathReplacer} = require 'scandal' 2 | 3 | module.exports = (filePaths, regexSource, regexFlags, replacementText) -> 4 | callback = @async() 5 | 6 | replacer = new PathReplacer() 7 | regex = new RegExp(regexSource, regexFlags) 8 | 9 | replacer.on 'file-error', ({code, path, message}) -> 10 | emit('replace:file-error', {code, path, message}) 11 | 12 | replacer.on 'path-replaced', (result) -> 13 | emit('replace:path-replaced', result) 14 | 15 | replacer.replacePaths(regex, replacementText, filePaths, -> callback()) 16 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-provided-services/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "package-with-provided-services", 3 | 4 | "providedServices": { 5 | "service-1": { 6 | "description": "The first service", 7 | "versions": { 8 | "0.2.9": "provideFirstServiceV2", 9 | "0.3.1": "provideFirstServiceV3", 10 | "0.4.1": "provideFirstServiceV4" 11 | } 12 | }, 13 | "service-2": { 14 | "description": "The second service", 15 | "versions": { 16 | "0.2.1": "provideSecondService" 17 | } 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | [branch "master"] 9 | remote = origin 10 | merge = refs/heads/master 11 | [remote "origin"] 12 | url = git@github.com:atom/some-repo-i-guess.git 13 | fetch = +refs/heads/*:refs/remotes/origin/* 14 | [submodule "jstips"] 15 | url = https://github.com/loverajoel/jstips 16 | [submodule "You-Dont-Need-jQuery"] 17 | url = https://github.com/oneuijs/You-Dont-Need-jQuery 18 | -------------------------------------------------------------------------------- /script/cibuild-atom-linux: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export ATOM_ACCESS_TOKEN=$BUILD_ATOM_LINUX_ACCESS_TOKEN 6 | export BUILD_ATOM_RELEASES_S3_KEY=$BUILD_ATOM_LINUX_RELEASES_S3_KEY 7 | export BUILD_ATOM_RELEASES_S3_SECRET=$BUILD_ATOM_LINUX_RELEASES_S3_SECRET 8 | export BUILD_ATOM_RELEASES_S3_BUCKET=$BUILD_ATOM_LINUX_RELEASES_S3_BUCKET 9 | 10 | if [ -d /usr/local/share/nodenv ]; then 11 | export NODENV_ROOT=/usr/local/share/nodenv 12 | export PATH=/usr/local/share/nodenv/bin:/usr/local/share/nodenv/shims:$PATH 13 | export NODENV_VERSION="v0.10.21" 14 | fi 15 | 16 | script/cibuild 17 | -------------------------------------------------------------------------------- /script/set-version: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | SHELL_APP_DIR=$1 6 | VERSION=$2 7 | 8 | PLIST_PATH="$SHELL_APP_DIR/Contents/Info.plist" 9 | HELPER_PLIST_PATH="$SHELL_APP_DIR/Contents/Frameworks/Atom Helper.app/Contents/Info.plist" 10 | 11 | # Update version 12 | /usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$PLIST_PATH" 13 | /usr/libexec/PlistBuddy -c "Set CFBundleVersion $VERSION" "$PLIST_PATH" 14 | /usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString $VERSION" "$HELPER_PLIST_PATH" 15 | /usr/libexec/PlistBuddy -c "Set CFBundleVersion $VERSION" "$HELPER_PLIST_PATH" 16 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/custom-event-mixin.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | CustomEventMixin = 3 | componentWillMount: -> 4 | @customEventListeners = {} 5 | 6 | componentWillUnmount: -> 7 | for name, listeners in @customEventListeners 8 | for listener in listeners 9 | @getDOMNode().removeEventListener(name, listener) 10 | return 11 | 12 | addCustomEventListeners: (customEventListeners) -> 13 | for name, listener of customEventListeners 14 | @customEventListeners[name] ?= [] 15 | @customEventListeners[name].push(listener) 16 | @getDOMNode().addEventListener(name, listener) 17 | return 18 | -------------------------------------------------------------------------------- /resources/linux/debian/control.in: -------------------------------------------------------------------------------- 1 | Package: <%= appFileName %> 2 | Version: <%= version %> 3 | Depends: git, gconf2, gconf-service, libgtk2.0-0, libudev0 | libudev1, libgcrypt11 | libgcrypt20, libnotify4, libxtst6, libnss3, python, gvfs-bin, xdg-utils, libcap2 4 | Recommends: lsb-release 5 | Suggests: libgnome-keyring0, gir1.2-gnomekeyring-1.0 6 | Section: devel 7 | Priority: optional 8 | Architecture: <%= arch %> 9 | Installed-Size: <%= installedSize %> 10 | Maintainer: GitHub 11 | Description: <%= description %> 12 | Atom is a free and open source text editor that is modern, approachable, and hackable to the core. 13 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /script/mkrpm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | APP_NAME="$1" 6 | APP_FILE_NAME="$2" 7 | SPEC_FILE="$3" 8 | DESKTOP_FILE="$4" 9 | BUILD_DIRECTORY="$5" 10 | 11 | RPM_BUILD_ROOT=~/rpmbuild 12 | ARCH=`uname -m` 13 | 14 | rpmdev-setuptree 15 | 16 | cp -r "$BUILD_DIRECTORY/$APP_NAME" "$RPM_BUILD_ROOT/BUILD" 17 | cp -r "$BUILD_DIRECTORY/icons" "$RPM_BUILD_ROOT/BUILD" 18 | cp "$SPEC_FILE" "$RPM_BUILD_ROOT/SPECS" 19 | cp ./atom.sh "$RPM_BUILD_ROOT/BUILD" 20 | cp "$DESKTOP_FILE" "$RPM_BUILD_ROOT/BUILD" 21 | 22 | rpmbuild -ba "$SPEC_FILE" 23 | cp $RPM_BUILD_ROOT/RPMS/$ARCH/$APP_FILE_NAME-*.rpm "$BUILD_DIRECTORY/rpm" 24 | 25 | rm -rf "$RPM_BUILD_ROOT" 26 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Specs depend on character counts, if we don't specify the line endings the 2 | # fixtures will vary depending on platform 3 | spec/fixtures/**/*.js text eol=lf 4 | spec/fixtures/**/*.coffee text eol=lf 5 | spec/fixtures/**/*.less text eol=lf 6 | spec/fixtures/**/*.css text eol=lf 7 | spec/fixtures/**/*.txt text eol=lf 8 | spec/fixtures/dir/**/* text eol=lf 9 | 10 | # Git 1.7 does not support **/* patterns 11 | spec/fixtures/css.css text eol=lf 12 | spec/fixtures/sample.js text eol=lf 13 | spec/fixtures/sample.less text eol=lf 14 | spec/fixtures/sample.txt text eol=lf 15 | 16 | # Windows bash scripts are also Unix LF endings 17 | *.sh eol=lf 18 | -------------------------------------------------------------------------------- /keymaps/emacs.cson: -------------------------------------------------------------------------------- 1 | 'atom-text-editor': 2 | 'alt-f': 'editor:move-to-end-of-word' 3 | 'alt-ctrl-f': 'editor:move-to-next-subword-boundary' 4 | 'alt-F': 'editor:select-to-end-of-word' 5 | 'alt-ctrl-F': 'editor:select-to-next-subword-boundary' 6 | 'alt-b': 'editor:move-to-beginning-of-word' 7 | 'alt-ctrl-b': 'editor:move-to-previous-subword-boundary' 8 | 'alt-B': 'editor:select-to-beginning-of-word' 9 | 'alt-ctrl-B': 'editor:select-to-previous-subword-boundary' 10 | 'alt-h': 'editor:delete-to-beginning-of-word' 11 | 'alt-ctrl-h': 'editor:delete-to-beginning-of-subword' 12 | 'alt-d': 'editor:delete-to-end-of-word' 13 | 'alt-ctrl-d': 'editor:delete-to-end-of-subword' 14 | -------------------------------------------------------------------------------- /spec/clipboard-spec.coffee: -------------------------------------------------------------------------------- 1 | describe "Clipboard", -> 2 | describe "write(text, metadata) and read()", -> 3 | it "writes and reads text to/from the native clipboard", -> 4 | expect(atom.clipboard.read()).toBe 'initial clipboard content' 5 | atom.clipboard.write('next') 6 | expect(atom.clipboard.read()).toBe 'next' 7 | 8 | it "returns metadata if the item on the native clipboard matches the last written item", -> 9 | atom.clipboard.write('next', {meta: 'data'}) 10 | expect(atom.clipboard.read()).toBe 'next' 11 | expect(atom.clipboard.readWithMetadata().text).toBe 'next' 12 | expect(atom.clipboard.readWithMetadata().metadata).toEqual {meta: 'data'} 13 | -------------------------------------------------------------------------------- /spec/fixtures/packages/package-with-view-providers/index.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | module.exports = { 4 | activate () {}, 5 | 6 | theDeserializerMethod (state) { 7 | return {state: state} 8 | }, 9 | 10 | viewProviderMethod1 (model) { 11 | if (model.worksWithViewProvider1) { 12 | let element = document.createElement('div') 13 | element.dataset['createdBy'] = 'view-provider-1' 14 | return element 15 | } 16 | }, 17 | 18 | viewProviderMethod2 (model) { 19 | if (model.worksWithViewProvider2) { 20 | let element = document.createElement('div') 21 | element.dataset['createdBy'] = 'view-provider-2' 22 | return element 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /script/utils/run-grunt.js: -------------------------------------------------------------------------------- 1 | var cp = require('./child-process-wrapper.js'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | 5 | module.exports = function(additionalArgs, callback) { 6 | var gruntPath = path.join('build', 'node_modules', '.bin', 'grunt') + (process.platform === 'win32' ? '.cmd' : ''); 7 | 8 | if (!fs.existsSync(gruntPath)) { 9 | console.error('Grunt command does not exist at: ' + gruntPath); 10 | console.error('Run script/bootstrap to install Grunt'); 11 | process.exit(1); 12 | } 13 | 14 | var args = ['--gruntfile', path.resolve('build', 'Gruntfile.coffee')]; 15 | args = args.concat(additionalArgs); 16 | cp.safeSpawn(gruntPath, args, callback); 17 | }; 18 | -------------------------------------------------------------------------------- /static/messages.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | .info-messages, 4 | .error-messages { 5 | margin: 0; 6 | padding: 0; 7 | list-style: none; 8 | } 9 | 10 | .error-messages { 11 | color: @text-color-error; 12 | } 13 | 14 | ul.background-message { 15 | font-size: @font-size * 3; 16 | 17 | margin: 0; 18 | padding: 0; 19 | 20 | li { 21 | margin: 0; 22 | padding: 0; 23 | list-style: none; 24 | } 25 | 26 | &.centered { 27 | display: -webkit-flex; 28 | position: absolute; 29 | top: 0; 30 | left: 0; 31 | right: 0; 32 | bottom: 0; 33 | 34 | -webkit-align-items: center; 35 | text-align: center; 36 | 37 | li { 38 | width: 100%; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /static/text.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | .text-bits (@type) { 4 | @text-color-name: "text-color-@{type}"; 5 | @bg-color-name: "background-color-@{type}"; 6 | 7 | @text-color: @@text-color-name; 8 | @bg-color: @@bg-color-name; 9 | 10 | code { 11 | color: @text-color; 12 | background: fadeout(@bg-color, 80%); 13 | } 14 | 15 | a, a code { 16 | text-decoration: underline; 17 | color: darken(@text-color, 10%); 18 | 19 | &:hover { 20 | color: darken(@text-color, 15%); 21 | } 22 | } 23 | } 24 | 25 | .text-info { 26 | .text-bits(info); 27 | } 28 | 29 | .text-success { 30 | .text-bits(success); 31 | } 32 | 33 | .text-warning { 34 | .text-bits(warning); 35 | } 36 | 37 | .text-error { 38 | .text-bits(error); 39 | } 40 | -------------------------------------------------------------------------------- /coffeelint.json: -------------------------------------------------------------------------------- 1 | { 2 | "max_line_length": { 3 | "level": "ignore" 4 | }, 5 | "no_empty_param_list": { 6 | "level": "error" 7 | }, 8 | "arrow_spacing": { 9 | "level": "error" 10 | }, 11 | "no_interpolation_in_single_quotes": { 12 | "level": "error" 13 | }, 14 | "no_debugger": { 15 | "level": "error" 16 | }, 17 | "prefer_english_operator": { 18 | "level": "error" 19 | }, 20 | "colon_assignment_spacing": { 21 | "spacing": { 22 | "left": 0, 23 | "right": 1 24 | }, 25 | "level": "error" 26 | }, 27 | "braces_spacing": { 28 | "spaces": 0, 29 | "level": "error" 30 | }, 31 | "spacing_after_comma": { 32 | "level": "error" 33 | }, 34 | "no_stand_alone_at": { 35 | "level": "error" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /spec/main-process/mocha-test-runner.js: -------------------------------------------------------------------------------- 1 | "use babel" 2 | 3 | import Mocha from 'mocha' 4 | import fs from 'fs-plus' 5 | import {assert} from 'chai' 6 | 7 | export default function (testPaths) { 8 | global.assert = assert 9 | 10 | const mocha = new Mocha({reporter: 'dot'}) 11 | for (let testPath of testPaths) { 12 | if (fs.isDirectorySync(testPath)) { 13 | for (let testFilePath of fs.listTreeSync(testPath)) { 14 | if (/\.spec\.(coffee|js)$/.test(testFilePath)) { 15 | mocha.addFile(testFilePath) 16 | } 17 | } 18 | } else { 19 | mocha.addFile(testPath) 20 | } 21 | } 22 | 23 | mocha.run(function (failures) { 24 | if (failures === 0) { 25 | process.exit(0) 26 | } else { 27 | process.exit(1) 28 | } 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /dot-atom/snippets.cson: -------------------------------------------------------------------------------- 1 | # Your snippets 2 | # 3 | # Atom snippets allow you to enter a simple prefix in the editor and hit tab to 4 | # expand the prefix into a larger code block with templated values. 5 | # 6 | # You can create a new snippet in this file by typing "snip" and then hitting 7 | # tab. 8 | # 9 | # An example CoffeeScript snippet to expand log to console.log: 10 | # 11 | # '.source.coffee': 12 | # 'Console log': 13 | # 'prefix': 'log' 14 | # 'body': 'console.log $1' 15 | # 16 | # Each scope (e.g. '.source.coffee' above) can only be declared once. 17 | # 18 | # This file uses CoffeeScript Object Notation (CSON). 19 | # If you are unfamiliar with CSON, you can read more about it in the 20 | # Atom Flight Manual: 21 | # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson 22 | -------------------------------------------------------------------------------- /spec/panel-spec.coffee: -------------------------------------------------------------------------------- 1 | Panel = require '../src/panel' 2 | 3 | describe "Panel", -> 4 | [panel] = [] 5 | 6 | class TestPanelItem 7 | constructior: -> 8 | 9 | beforeEach -> 10 | panel = new Panel(item: new TestPanelItem()) 11 | 12 | describe "changing panel visibility", -> 13 | it 'emits an event when visibility changes', -> 14 | panel.onDidChangeVisible spy = jasmine.createSpy() 15 | 16 | panel.hide() 17 | expect(panel.isVisible()).toBe false 18 | expect(spy).toHaveBeenCalledWith(false) 19 | spy.reset() 20 | 21 | panel.show() 22 | expect(panel.isVisible()).toBe true 23 | expect(spy).toHaveBeenCalledWith(true) 24 | 25 | panel.destroy() 26 | expect(panel.isVisible()).toBe false 27 | expect(spy).toHaveBeenCalledWith(false) 28 | -------------------------------------------------------------------------------- /src/scoped-properties.coffee: -------------------------------------------------------------------------------- 1 | CSON = require 'season' 2 | {CompositeDisposable} = require 'event-kit' 3 | 4 | module.exports = 5 | class ScopedProperties 6 | @load: (scopedPropertiesPath, config, callback) -> 7 | CSON.readFile scopedPropertiesPath, (error, scopedProperties={}) -> 8 | if error? 9 | callback(error) 10 | else 11 | callback(null, new ScopedProperties(scopedPropertiesPath, scopedProperties, config)) 12 | 13 | constructor: (@path, @scopedProperties, @config) -> 14 | 15 | activate: -> 16 | for selector, properties of @scopedProperties 17 | @config.set(null, properties, scopeSelector: selector, source: @path) 18 | return 19 | 20 | deactivate: -> 21 | for selector of @scopedProperties 22 | @config.unset(null, scopeSelector: selector, source: @path) 23 | return 24 | -------------------------------------------------------------------------------- /src/token.coffee: -------------------------------------------------------------------------------- 1 | _ = require 'underscore-plus' 2 | 3 | StartDotRegex = /^\.?/ 4 | WhitespaceRegex = /\S/ 5 | 6 | # Represents a single unit of text as selected by a grammar. 7 | module.exports = 8 | class Token 9 | value: null 10 | scopes: null 11 | 12 | constructor: (properties) -> 13 | {@value, @scopes} = properties 14 | 15 | isEqual: (other) -> 16 | # TODO: scopes is deprecated. This is here for the sake of lang package tests 17 | @value is other.value and _.isEqual(@scopes, other.scopes) 18 | 19 | isBracket: -> 20 | /^meta\.brace\b/.test(_.last(@scopes)) 21 | 22 | matchesScopeSelector: (selector) -> 23 | targetClasses = selector.replace(StartDotRegex, '').split('.') 24 | _.any @scopes, (scope) -> 25 | scopeClasses = scope.split('.') 26 | _.isSubset(targetClasses, scopeClasses) 27 | -------------------------------------------------------------------------------- /static/select-list.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | @import "octicon-mixins"; 3 | 4 | .select-list { 5 | .loading { 6 | .loading-message { 7 | .octicon(hourglass); 8 | 9 | &:before { 10 | font-size: 1.1em; 11 | width: 1.1em; 12 | height: 1.1em; 13 | margin-right: 5px; 14 | } 15 | } 16 | 17 | .badge { 18 | margin-left: 10px; 19 | } 20 | } 21 | 22 | ol.list-group { 23 | position: relative; 24 | overflow-y: auto; 25 | max-height: 312px; 26 | margin: @component-padding 0 0 0; 27 | padding: 0; 28 | 29 | li { 30 | display: block; 31 | 32 | .primary-line, 33 | .secondary-line { 34 | text-overflow: ellipsis; 35 | white-space: nowrap; 36 | overflow: hidden; 37 | } 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /script/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | var cp = require('./utils/child-process-wrapper.js'); 3 | var runGrunt = require('./utils/run-grunt.js'); 4 | var path = require('path'); 5 | var fs = require('fs'); 6 | 7 | process.chdir(path.dirname(__dirname)); 8 | 9 | if (process.platform === 'win32') { 10 | process.env['PATH'] = process.env['PATH'] 11 | .split(';') 12 | .filter(function(p) { 13 | if (fs.existsSync(path.resolve(p, 'msbuild.exe'))) { 14 | console.log('Excluding "' + p + '" from PATH to avoid msbuild.exe mismatch') 15 | return false; 16 | } else { 17 | return true; 18 | } 19 | }) 20 | .join(';'); 21 | } 22 | 23 | cp.safeExec('node script/bootstrap', function() { 24 | // build/node_modules/.bin/grunt "$@" 25 | var args = process.argv.slice(2); 26 | runGrunt(args, process.exit); 27 | }); 28 | -------------------------------------------------------------------------------- /src/theme-package.coffee: -------------------------------------------------------------------------------- 1 | Package = require './package' 2 | 3 | module.exports = 4 | class ThemePackage extends Package 5 | getType: -> 'theme' 6 | 7 | getStyleSheetPriority: -> 1 8 | 9 | enable: -> 10 | @config.unshiftAtKeyPath('core.themes', @name) 11 | 12 | disable: -> 13 | @config.removeAtKeyPath('core.themes', @name) 14 | 15 | load: -> 16 | @loadTime = 0 17 | @configSchemaRegisteredOnLoad = @registerConfigSchemaFromMetadata() 18 | this 19 | 20 | activate: -> 21 | @activationPromise ?= new Promise (resolve, reject) => 22 | @resolveActivationPromise = resolve 23 | @rejectActivationPromise = reject 24 | @measure 'activateTime', => 25 | try 26 | @loadStylesheets() 27 | @activateNow() 28 | catch error 29 | @handleError("Failed to activate the #{@name} theme", error) 30 | -------------------------------------------------------------------------------- /docs/README.md: -------------------------------------------------------------------------------- 1 | # Atom Docs 2 | 3 | ![Atom](https://cloud.githubusercontent.com/assets/72919/2874231/3af1db48-d3dd-11e3-98dc-6066f8bc766f.png) 4 | 5 | Most of the Atom user and developer documentation is contained in the [Atom Docs](https://github.com/atom/docs) repository. 6 | 7 | In this directory you can only find very specific build and API level documentation. Some of this may eventually move to the docs repository as well. 8 | 9 | ## Build documentation 10 | 11 | Instructions for building Atom on various platforms from source. 12 | 13 | * [macOS](build-instructions/macos.md) 14 | * [Windows](build-instructions/windows.md) 15 | * [Linux](build-instructions/linux.md) 16 | * [FreeBSD](build-instructions/freebsd.md) 17 | 18 | ## Other documentation here 19 | 20 | * [apm REST API](apm-rest-api.md) 21 | * [Tips for contributing to packages](contributing-to-packages.md) 22 | -------------------------------------------------------------------------------- /docs/build-instructions/freebsd.md: -------------------------------------------------------------------------------- 1 | # FreeBSD 2 | 3 | FreeBSD -RELEASE 64-bit is the recommended platform. 4 | 5 | ## Requirements 6 | 7 | * FreeBSD 8 | * `pkg install node` 9 | * `pkg install npm` 10 | * `pkg install libgnome-keyring` 11 | * `npm config set python /usr/local/bin/python2 -g` to ensure that gyp uses Python 2 12 | 13 | ## Instructions 14 | 15 | ```sh 16 | git clone https://github.com/atom/atom 17 | cd atom 18 | script/build # Creates application at $TMPDIR/atom-build/Atom 19 | sudo script/grunt install # Installs command to /usr/local/bin/atom 20 | ``` 21 | 22 | ## Advanced Options 23 | 24 | ### Custom install directory 25 | 26 | ```sh 27 | sudo script/grunt install --install-dir /install/atom/here 28 | ``` 29 | 30 | ### Custom build directory 31 | 32 | ```sh 33 | script/build --build-dir /build/atom/here 34 | ``` 35 | 36 | ## Troubleshooting 37 | -------------------------------------------------------------------------------- /static/workspace-view.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | @import "octicon-mixins"; 3 | 4 | @font-face { .octicon-font(); } 5 | 6 | html { 7 | font-family: @font-family; 8 | font-size: @font-size; 9 | } 10 | 11 | html, 12 | body { 13 | width: 100%; 14 | height: 100%; 15 | overflow: hidden; 16 | } 17 | 18 | atom-workspace { 19 | display: flex; 20 | flex-direction: column; 21 | height: 100%; 22 | overflow: hidden; 23 | position: relative; 24 | color: @text-color; 25 | background-color: @app-background-color; 26 | font-family: @font-family; 27 | 28 | atom-workspace-axis { 29 | position: relative; 30 | } 31 | 32 | atom-workspace-axis.horizontal { 33 | display: flex; 34 | flex: 1; 35 | } 36 | 37 | atom-workspace-axis.vertical { 38 | display: flex; 39 | flex: 1; 40 | flex-direction: column; 41 | min-width: 0; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /static/sections.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | section, .section { 4 | position: relative; 5 | margin-top: 0; 6 | &:last-child { margin-bottom: 0; } 7 | 8 | &.bordered { 9 | margin: 0; 10 | padding: @component-padding*2 0; 11 | border-top: 1px solid @background-color-highlight; 12 | border-bottom: 1px solid @tool-panel-border-color; 13 | } 14 | 15 | .section-heading:first-child { 16 | margin-top: 0; 17 | font-weight: bold; 18 | color: @text-color-highlight; 19 | } 20 | } 21 | 22 | div > section:first-child, 23 | form > section:first-child, 24 | div > .section:first-child, 25 | form > .section:first-child { 26 | border-top: none; 27 | padding-top: 0; 28 | } 29 | div > section:last-child, 30 | form > section:last-child, 31 | div > .section:last-child, 32 | form > .section:last-child { 33 | border-bottom: none; 34 | padding-bottom: 0; 35 | } 36 | -------------------------------------------------------------------------------- /dot-atom/styles.less: -------------------------------------------------------------------------------- 1 | /* 2 | * Your Stylesheet 3 | * 4 | * This stylesheet is loaded when Atom starts up and is reloaded automatically 5 | * when it is changed and saved. 6 | * 7 | * Add your own CSS or Less to fully customize Atom. 8 | * If you are unfamiliar with Less, you can read more about it here: 9 | * http://lesscss.org 10 | */ 11 | 12 | 13 | /* 14 | * Examples 15 | * (To see them, uncomment and save) 16 | */ 17 | 18 | // style the background color of the tree view 19 | .tree-view { 20 | // background-color: whitesmoke; 21 | } 22 | 23 | // style the background and foreground colors on the atom-text-editor-element itself 24 | atom-text-editor { 25 | // color: white; 26 | // background-color: hsl(180, 24%, 12%); 27 | } 28 | 29 | // To style other content in the text editor's shadow DOM, use the ::shadow expression 30 | atom-text-editor::shadow .cursor { 31 | // border-color: red; 32 | } 33 | -------------------------------------------------------------------------------- /static/bootstrap-overrides.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | .nav { 4 | > li > a { 5 | border-radius: @component-border-radius; 6 | } 7 | > li > a:hover { 8 | background-color: @background-color-highlight; 9 | } 10 | 11 | &.nav-pills > li.active > a { 12 | background-color: @background-color-selected; 13 | } 14 | } 15 | 16 | h1, 17 | h2, 18 | h3, 19 | h4, 20 | h5, 21 | h6 { 22 | font-family: inherit; // inherit from themes 23 | } 24 | 25 | body { 26 | font-family: inherit; // inherit from html 27 | font-size: inherit; // inherit from html 28 | } 29 | 30 | // Latest Bootstrap specifies the font properties again instead of inheriting 31 | .tooltip { 32 | font-family: @font-family; 33 | font-size: @font-size; 34 | } 35 | 36 | // disable some styling, will be styled in themes 37 | kbd { 38 | color: inherit; 39 | background-color: none; 40 | box-shadow: none; 41 | } 42 | -------------------------------------------------------------------------------- /static/atom.less: -------------------------------------------------------------------------------- 1 | // Import from the syntax theme's variables with a fallback to ./variables/syntax-variables.less 2 | @import "./variables/syntax-variables"; 3 | @import "syntax-variables"; 4 | 5 | // Import from the ui theme's variables with a fallback to ./variables/ui-variables.less 6 | @import "./variables/ui-variables"; 7 | @import "ui-variables"; 8 | 9 | @import "octicon-utf-codes"; 10 | @import "octicon-mixins"; 11 | 12 | @import "workspace-view"; 13 | @import "bootstrap-overrides"; 14 | @import "badges"; 15 | @import "buttons"; 16 | @import "icons"; 17 | @import "links"; 18 | @import "panes"; 19 | @import "panels"; 20 | @import "sections"; 21 | @import "lists"; 22 | @import "popover-list"; 23 | @import "messages"; 24 | @import "markdown"; 25 | @import "text-editor-light"; 26 | @import "select-list"; 27 | @import "syntax"; 28 | @import "text"; 29 | @import "utilities"; 30 | @import "octicons"; 31 | @import "cursors"; 32 | -------------------------------------------------------------------------------- /static/syntax.less: -------------------------------------------------------------------------------- 1 | @import "syntax-variables"; 2 | 3 | atom-text-editor { 4 | .lines { 5 | .markup { 6 | &.git-commit { 7 | &.changed { 8 | color: @syntax-color-modified; 9 | } 10 | 11 | &.deleted { 12 | color: @syntax-color-removed; 13 | } 14 | 15 | &.inserted { 16 | color: @syntax-color-added; 17 | } 18 | } 19 | } 20 | } 21 | } 22 | 23 | .define-selection-flash-color-if-not-defined() { @syntax-selection-flash-color: rgba(100, 255, 100, 0.7); } 24 | .define-selection-flash-color-if-not-defined(); 25 | 26 | @-webkit-keyframes flash { 27 | from { background-color: @syntax-selection-flash-color; } 28 | to { background-color: null; } 29 | } 30 | 31 | atom-text-editor .flash.selection .region { 32 | -webkit-animation-name: flash; 33 | -webkit-animation-duration: .5s; 34 | -webkit-animation-iteration-count: 1; 35 | } 36 | -------------------------------------------------------------------------------- /static/variables/octicon-mixins.less: -------------------------------------------------------------------------------- 1 | .icon-size(@size) { 2 | font-size: @size; 3 | width: @size; 4 | height: @size; 5 | } 6 | 7 | .icon(@size, @display: inline-block) { 8 | font-family: 'Octicons Regular'; 9 | font-weight: normal; 10 | font-style: normal; 11 | display: @display; 12 | line-height: 1; 13 | -webkit-font-smoothing: antialiased; 14 | text-decoration: none; 15 | 16 | .icon-size(@size); 17 | } 18 | 19 | .octicon(@name, @size: 16px) { 20 | @import "octicon-utf-codes.less"; 21 | &::before { 22 | .icon(@size); 23 | content: @@name 24 | } 25 | } 26 | 27 | .mega-octicon(@name, @size: 32px) { 28 | @import "octicon-utf-codes.less"; 29 | &::before { 30 | .icon(@size); 31 | content: @@name 32 | } 33 | } 34 | 35 | .octicon-font() { 36 | font-family: 'Octicons Regular'; 37 | src: url("octicons.woff") format("woff"); 38 | font-weight: normal; 39 | font-style: normal; 40 | } 41 | 42 | -------------------------------------------------------------------------------- /script/mktar: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # mktar name version arch icon-path build-root-path 3 | 4 | set -e 5 | 6 | SCRIPT=`readlink -f "$0"` 7 | ROOT=`readlink -f $(dirname $SCRIPT)/..` 8 | cd $ROOT 9 | 10 | NAME="$1" 11 | VERSION="$2" 12 | ARCH="$3" 13 | ICON_FILE="$4" 14 | BUILD_ROOT_PATH="$5" 15 | FILE_MODE=755 16 | 17 | TAR_PATH=$BUILD_ROOT_PATH 18 | ATOM_PATH="$BUILD_ROOT_PATH/Atom" 19 | 20 | TARGET_ROOT="`mktemp -d`" 21 | chmod $FILE_MODE "$TARGET_ROOT" 22 | NAME_IN_TAR="$NAME-$VERSION-$ARCH" 23 | TARGET="$TARGET_ROOT/$NAME_IN_TAR" 24 | 25 | # Copy executable and resources 26 | cp -a "$ATOM_PATH" "$TARGET" 27 | 28 | # Copy icon file 29 | cp "$ICON_FILE" "$TARGET/$NAME.png" 30 | 31 | # Remove executable bit from .node files 32 | find "$TARGET" -type f -name "*.node" -exec chmod a-x {} \; 33 | 34 | # Create the archive 35 | pushd "$TARGET_ROOT" 36 | tar caf "$TAR_PATH/$NAME_IN_TAR.tar.gz" "$NAME_IN_TAR" 37 | popd 38 | 39 | rm -rf "$TARGET_ROOT" 40 | -------------------------------------------------------------------------------- /spec/default-directory-searcher-spec.coffee: -------------------------------------------------------------------------------- 1 | DefaultDirectorySearcher = require '../src/default-directory-searcher' 2 | Task = require '../src/task' 3 | path = require 'path' 4 | 5 | describe "DefaultDirectorySearcher", -> 6 | [searcher, dirPath] = [] 7 | 8 | beforeEach -> 9 | dirPath = path.resolve(__dirname, 'fixtures', 'dir') 10 | searcher = new DefaultDirectorySearcher 11 | 12 | it "terminates the task after running a search", -> 13 | options = 14 | ignoreCase: false 15 | includeHidden: false 16 | excludeVcsIgnores: true 17 | inclusions: [] 18 | globalExclusions: ['a-dir'] 19 | didMatch: -> 20 | didError: -> 21 | didSearchPaths: -> 22 | searchPromise = searcher.search([{getPath: -> dirPath}], /abcdefg/, options) 23 | spyOn(Task::, 'terminate').andCallThrough() 24 | 25 | waitsForPromise -> searchPromise 26 | 27 | runs -> 28 | expect(Task::terminate).toHaveBeenCalled() 29 | -------------------------------------------------------------------------------- /spec/fixtures/sample-with-comments.js: -------------------------------------------------------------------------------- 1 | var quicksort = function () { 2 | /* 3 | this is a multiline comment 4 | it is, I promise 5 | */ 6 | var sort = function(items) { 7 | // This is a collection of 8 | // single line comments. 9 | // Wowza 10 | if (items.length <= 1) return items; 11 | var pivot = items.shift(), current, left = [], right = []; 12 | /* 13 | This is a multiline comment block with 14 | an empty line inside of it. 15 | 16 | Awesome. 17 | */ 18 | while(items.length > 0) { 19 | current = items.shift(); 20 | current < pivot ? left.push(current) : right.push(current); 21 | } 22 | // This is a collection of 23 | // single line comments 24 | 25 | // ...with an empty line 26 | // among it, geez! 27 | return sort(left).concat(pivot).concat(sort(right)); 28 | }; 29 | // this is a single-line comment 30 | return sort(Array.apply(this, arguments)); 31 | }; 32 | -------------------------------------------------------------------------------- /src/window.coffee: -------------------------------------------------------------------------------- 1 | # Public: Measure how long a function takes to run. 2 | # 3 | # description - A {String} description that will be logged to the console when 4 | # the function completes. 5 | # fn - A {Function} to measure the duration of. 6 | # 7 | # Returns the value returned by the given function. 8 | window.measure = (description, fn) -> 9 | start = Date.now() 10 | value = fn() 11 | result = Date.now() - start 12 | console.log description, result 13 | value 14 | 15 | # Public: Create a dev tools profile for a function. 16 | # 17 | # description - A {String} description that will be available in the Profiles 18 | # tab of the dev tools. 19 | # fn - A {Function} to profile. 20 | # 21 | # Returns the value returned by the given function. 22 | window.profile = (description, fn) -> 23 | measure description, -> 24 | console.profile(description) 25 | value = fn() 26 | console.profileEnd(description) 27 | value 28 | -------------------------------------------------------------------------------- /src/main-process/context-menu.coffee: -------------------------------------------------------------------------------- 1 | {Menu} = require 'electron' 2 | 3 | module.exports = 4 | class ContextMenu 5 | constructor: (template, @atomWindow) -> 6 | template = @createClickHandlers(template) 7 | menu = Menu.buildFromTemplate(template) 8 | menu.popup(@atomWindow.browserWindow) 9 | 10 | # It's necessary to build the event handlers in this process, otherwise 11 | # closures are dragged across processes and failed to be garbage collected 12 | # appropriately. 13 | createClickHandlers: (template) -> 14 | for item in template 15 | if item.command 16 | item.commandDetail ?= {} 17 | item.commandDetail.contextCommand = true 18 | item.commandDetail.atomWindow = @atomWindow 19 | do (item) => 20 | item.click = => 21 | global.atomApplication.sendCommandToWindow(item.command, @atomWindow, item.commandDetail) 22 | else if item.submenu 23 | @createClickHandlers(item.submenu) 24 | item 25 | -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: "{build}" 2 | 3 | branches: 4 | only: 5 | - master 6 | 7 | skip_tags: true 8 | clone_folder: c:\projects\atom 9 | clone_depth: 10 10 | 11 | platform: 12 | - x86 13 | 14 | environment: 15 | global: 16 | ATOM_DEV_RESOURCE_PATH: c:\projects\atom 17 | ATOM_ACCESS_TOKEN: 18 | secure: Q7vxmSq0bVCLTTRPzXw5ZhPTe7XYhWxX0tQV6neEkddTH6pZkOYNmSCG6VnMX2f+ 19 | 20 | matrix: 21 | - NODE_VERSION: 0.10.35 22 | 23 | install: 24 | - SET PATH=C:\Program Files\Atom\resources\cli;%PATH% 25 | - ps: Install-Product node $env:NODE_VERSION $env:PLATFORM 26 | 27 | build_script: 28 | - cd %APPVEYOR_BUILD_FOLDER% 29 | - C:\projects\atom\script\cibuild.cmd 30 | 31 | test: off 32 | deploy: off 33 | artifacts: 34 | - path: out\**\AtomSetup.exe 35 | name: AtomSetup.exe 36 | - path: out\**\AtomSetup.msi 37 | name: AtomSetup.msi 38 | 39 | cache: 40 | - '%USERPROFILE%\.atom\.apm' 41 | - '%USERPROFILE%\.atom\.node-gyp\.atom' 42 | - '%USERPROFILE%\.atom\.npm' 43 | -------------------------------------------------------------------------------- /spec/async-spec-helpers.coffee: -------------------------------------------------------------------------------- 1 | exports.beforeEach = (fn) -> 2 | global.beforeEach -> 3 | result = fn() 4 | if result instanceof Promise 5 | waitsForPromise(-> result) 6 | 7 | exports.afterEach = (fn) -> 8 | global.afterEach -> 9 | result = fn() 10 | if result instanceof Promise 11 | waitsForPromise(-> result) 12 | 13 | ['it', 'fit', 'ffit', 'fffit'].forEach (name) -> 14 | exports[name] = (description, fn) -> 15 | global[name] description, -> 16 | result = fn() 17 | if result instanceof Promise 18 | waitsForPromise(-> result) 19 | 20 | waitsForPromise = (fn) -> 21 | promise = fn() 22 | # This timeout is 3 minutes. We need to bump it back down once we fix backgrounding 23 | # of the renderer process on CI. See https://github.com/atom/electron/issues/4317 24 | waitsFor 'spec promise to resolve', 3 * 60 * 1000, (done) -> 25 | promise.then( 26 | done, 27 | (error) -> 28 | jasmine.getEnv().currentSpec.fail(error) 29 | done() 30 | ) 31 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /docs/build-instructions/macos.md: -------------------------------------------------------------------------------- 1 | # macOS 2 | 3 | ## Requirements 4 | 5 | * macOS 10.8 or later 6 | * [Node.js](https://nodejs.org/en/download/) (0.10.x or above) 7 | * Command Line Tools for [Xcode](https://developer.apple.com/xcode/downloads/) (run `xcode-select --install` to install) 8 | 9 | ## Instructions 10 | 11 | ```sh 12 | git clone https://github.com/atom/atom.git 13 | cd atom 14 | script/build # Creates application at /Applications/Atom.app 15 | ``` 16 | 17 | ### `script/build` Options 18 | * `--install-dir` - The full path to the final built application (must include `.app` in the path), e.g. `script/build --install-dir /Users/username/full/path/to/Atom.app` 19 | * `--build-dir` - Build the application in this directory. 20 | * `--verbose` - Verbose mode. A lot more information output. 21 | 22 | ## Troubleshooting 23 | 24 | ### macOS build error reports in atom/atom 25 | * Use [this search](https://github.com/atom/atom/search?q=label%3Abuild-error+label%3Aos-x&type=Issues) to get a list of reports about build errors on macOS. 26 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /resources/mac/helper-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | Atom Helper 9 | CFBundleExecutable 10 | Atom Helper 11 | CFBundleIdentifier 12 | com.github.atom.helper 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | Atom Helper 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | ${VERSION} 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | ${VERSION} 25 | LSMinimumSystemVersion 26 | 10.7.0 27 | LSUIElement 28 | 1 29 | NSSupportsAutomaticGraphicsSwitching 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | git: 2 | depth: 10 3 | 4 | branches: 5 | only: 6 | - master 7 | 8 | env: 9 | global: 10 | - ATOM_ACCESS_TOKEN=da809a6077bb1b0aa7c5623f7b2d5f1fec2faae4 11 | 12 | compiler: clang 13 | 14 | matrix: 15 | include: 16 | - os: linux 17 | env: NODE_VERSION=0.12 18 | - os: linux 19 | env: NODE_VERSION=4 20 | - os: osx 21 | env: ATOM_SPECS_TASK=core NODE_VERSION=0.12 22 | - os: osx 23 | env: ATOM_SPECS_TASK=packages NODE_VERSION=0.12 24 | 25 | sudo: false 26 | 27 | install: 28 | - git clone https://github.com/creationix/nvm.git /tmp/.nvm 29 | - source /tmp/.nvm/nvm.sh 30 | - nvm install $NODE_VERSION 31 | - nvm use $NODE_VERSION 32 | 33 | script: script/cibuild 34 | 35 | cache: 36 | directories: 37 | - node_modules 38 | - build/node_modules 39 | - apm/node_modules 40 | - $HOME/.atom/compile-cache 41 | 42 | notifications: 43 | email: 44 | on_success: never 45 | on_failure: change 46 | 47 | addons: 48 | apt: 49 | packages: 50 | - build-essential 51 | - git 52 | - libgnome-keyring-dev 53 | - fakeroot 54 | -------------------------------------------------------------------------------- /spec/spec-helper-platform.coffee: -------------------------------------------------------------------------------- 1 | path = require 'path' 2 | fs = require 'fs-plus' 3 | 4 | ## Platform specific helpers 5 | module.exports = 6 | # Public: Returns true if being run from within Windows 7 | isWindows: -> 8 | !!process.platform.match /^win/ 9 | 10 | # Public: Some files can not exist on Windows filesystems, so we have to 11 | # selectively generate our fixtures. 12 | # 13 | # Returns nothing. 14 | generateEvilFiles: -> 15 | evilFilesPath = path.join(__dirname, 'fixtures', 'evil-files') 16 | fs.removeSync(evilFilesPath) if fs.existsSync(evilFilesPath) 17 | fs.mkdirSync(evilFilesPath) 18 | 19 | if @isWindows() 20 | filenames = [ 21 | "a_file_with_utf8.txt" 22 | "file with spaces.txt" 23 | "utfa\u0306.md" 24 | ] 25 | else 26 | filenames = [ 27 | "a_file_with_utf8.txt" 28 | "file with spaces.txt" 29 | "goddam\nnewlines" 30 | "quote\".txt" 31 | "utfa\u0306.md" 32 | ] 33 | 34 | for filename in filenames 35 | fs.writeFileSync(path.join(evilFilesPath, filename), 'evil file!', flag: 'w') 36 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016 GitHub Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /script/utils/clean-merged-branches: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | #/ Usage: clean-merged-branches [-f] 3 | #/ Delete merged branches from the origin remote. 4 | #/ 5 | #/ Options: 6 | #/ -f Really delete the branches. Without this branches are shown 7 | #/ but nothing is deleted. 8 | 9 | set -e 10 | 11 | # show usage maybe 12 | [ "$1" = "--help" ] && { 13 | grep '^#/' <"$0"| cut -c4- 14 | exit 0 15 | } 16 | 17 | # fetch and prune remote branches 18 | git fetch origin --prune 19 | 20 | # grab list of merged branches 21 | branches=$( 22 | git branch -a --merged origin/master | 23 | grep remotes/origin/ | 24 | grep -v /master | 25 | sed 's@remotes/origin/@@' 26 | ) 27 | 28 | # bail out with no branches 29 | [ -z "$branches" ] && { 30 | echo "no merged branches detected" 1>&2 31 | exit 0 32 | } 33 | 34 | # delete the branches or just show what would be done without -f 35 | if [ "$1" = -f ]; then 36 | git push origin $(echo "$branches" | sed 's/^ */:/') 37 | else 38 | echo "These branches will be deleted:" 1>&2 39 | echo "$branches" 40 | echo "Run \`$0 -f' if you're sure." 41 | fi 42 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/jstips/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to submit your tip 2 | To submit a tip to the list, fork the repository and add your tip to the top of the list of tips in the `README.md` file. You may want to use a [topic branch](https://github.com/dchelimsky/rspec/wiki/Topic-Branches) for each tip. 3 | 4 | Use the format below when writing your tip. Your tip should be readable in less than two minutes. You may add links to other sites or videos that give more insight if you wish. 5 | 6 | Once your tip is ready, [issue a pull request](https://help.github.com/articles/using-pull-requests/) and your tip will be reviewed. Every day one tip will be merged from the available pull requests. 7 | 8 | # Tip format 9 | 10 | ## #01(number) - Title 11 | 12 | > yyyy-mm-dd(date) by @username 13 | 14 | This is my awesome tip! 15 | 16 | # Notes 17 | 18 | Leave the date and the tip number empty. When we decide merge the pull request you will add them and squash your commits. 19 | 20 | Remember: New tips must be added to the *top* of the list of [tips](https://github.com/loverajoel/jstips#tips-list) in the `README.md` file. 21 | -------------------------------------------------------------------------------- /docs/native-profiling.md: -------------------------------------------------------------------------------- 1 | # Profiling the Atom Render Process on macOS with Instruments 2 | 3 | ![Instruments](https://cloud.githubusercontent.com/assets/1789/14193295/d503db7a-f760-11e5-88bf-fe417c0cd913.png) 4 | 5 | * Determine the version of Electron for your version of Atom. 6 | * Open the dev tools with `alt-cmd-i` 7 | * Evaluate `process.versions.electron` in the console. 8 | * Based on this version, download the appropriate Electron symbols from the [releases](https://github.com/atom/electron/releases) page. 9 | * The file name should look like `electron-v0.X.Y-darwin-x64-dsym.zip`. 10 | * Decompress these symbols in your `~/Downloads` directory. 11 | * Now create a time profile in Instruments. 12 | * Open `Instruments.app`. 13 | * Select `Time Profiler` 14 | * In Atom, determine the pid to attach to by evaluating `process.pid` in the dev tools console. 15 | * Attach to this pid via the menu at the upper left corner of the Instruments profiler. 16 | * Click record, do your thing. 17 | * Click stop. 18 | * The symbols should have been automatically located by Instruments (via Spotlight or something?), giving you a readable profile. 19 | -------------------------------------------------------------------------------- /resources/win/atom.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | SET EXPECT_OUTPUT= 4 | SET WAIT= 5 | SET PSARGS=%* 6 | 7 | FOR %%a IN (%*) DO ( 8 | IF /I "%%a"=="-f" SET EXPECT_OUTPUT=YES 9 | IF /I "%%a"=="--foreground" SET EXPECT_OUTPUT=YES 10 | IF /I "%%a"=="-h" SET EXPECT_OUTPUT=YES 11 | IF /I "%%a"=="--help" SET EXPECT_OUTPUT=YES 12 | IF /I "%%a"=="-t" SET EXPECT_OUTPUT=YES 13 | IF /I "%%a"=="--test" SET EXPECT_OUTPUT=YES 14 | IF /I "%%a"=="-v" SET EXPECT_OUTPUT=YES 15 | IF /I "%%a"=="--version" SET EXPECT_OUTPUT=YES 16 | IF /I "%%a"=="-w" ( 17 | SET EXPECT_OUTPUT=YES 18 | SET WAIT=YES 19 | ) 20 | IF /I "%%a"=="--wait" ( 21 | SET EXPECT_OUTPUT=YES 22 | SET WAIT=YES 23 | ) 24 | ) 25 | 26 | IF "%EXPECT_OUTPUT%"=="YES" ( 27 | SET ELECTRON_ENABLE_LOGGING=YES 28 | IF "%WAIT%"=="YES" ( 29 | powershell -noexit "Start-Process -FilePath \"%~dp0\..\..\atom.exe\" -ArgumentList \"--pid=$pid $env:PSARGS\" ; wait-event" 30 | exit 0 31 | ) ELSE ( 32 | "%~dp0\..\..\atom.exe" %* 33 | ) 34 | ) ELSE ( 35 | "%~dp0\..\app\apm\bin\node.exe" "%~dp0\atom.js" %* 36 | ) 37 | -------------------------------------------------------------------------------- /src/less-compile-cache.coffee: -------------------------------------------------------------------------------- 1 | path = require 'path' 2 | LessCache = require 'less-cache' 3 | 4 | # {LessCache} wrapper used by {ThemeManager} to read stylesheets. 5 | module.exports = 6 | class LessCompileCache 7 | @cacheDir: path.join(process.env.ATOM_HOME, 'compile-cache', 'less') 8 | 9 | constructor: ({resourcePath, importPaths}) -> 10 | @lessSearchPaths = [ 11 | path.join(resourcePath, 'static', 'variables') 12 | path.join(resourcePath, 'static') 13 | ] 14 | 15 | if importPaths? 16 | importPaths = importPaths.concat(@lessSearchPaths) 17 | else 18 | importPaths = @lessSearchPaths 19 | 20 | @cache = new LessCache 21 | cacheDir: @constructor.cacheDir 22 | importPaths: importPaths 23 | resourcePath: resourcePath 24 | fallbackDir: path.join(resourcePath, 'less-compile-cache') 25 | 26 | setImportPaths: (importPaths=[]) -> 27 | @cache.setImportPaths(importPaths.concat(@lessSearchPaths)) 28 | 29 | read: (stylesheetPath) -> 30 | @cache.readFileSync(stylesheetPath) 31 | 32 | cssForFile: (stylesheetPath, lessContent) -> 33 | @cache.cssForFile(stylesheetPath, lessContent) 34 | -------------------------------------------------------------------------------- /src/storage-folder.coffee: -------------------------------------------------------------------------------- 1 | path = require "path" 2 | fs = require "fs-plus" 3 | 4 | module.exports = 5 | class StorageFolder 6 | constructor: (containingPath) -> 7 | @path = path.join(containingPath, "storage") if containingPath? 8 | 9 | clear: -> 10 | return unless @path? 11 | 12 | try 13 | fs.removeSync(@path) 14 | catch error 15 | console.warn "Error deleting #{@path}", error.stack, error 16 | 17 | storeSync: (name, object) -> 18 | return unless @path? 19 | 20 | fs.writeFileSync(@pathForKey(name), JSON.stringify(object), 'utf8') 21 | 22 | load: (name) -> 23 | return unless @path? 24 | 25 | statePath = @pathForKey(name) 26 | try 27 | stateString = fs.readFileSync(statePath, 'utf8') 28 | catch error 29 | unless error.code is 'ENOENT' 30 | console.warn "Error reading state file: #{statePath}", error.stack, error 31 | return undefined 32 | 33 | try 34 | JSON.parse(stateString) 35 | catch error 36 | console.warn "Error parsing state file: #{statePath}", error.stack, error 37 | 38 | pathForKey: (name) -> path.join(@getPath(), name) 39 | getPath: -> @path 40 | -------------------------------------------------------------------------------- /src/input-component.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | class InputComponent 3 | constructor: -> 4 | @domNode = document.createElement('input') 5 | @domNode.classList.add('hidden-input') 6 | @domNode.setAttribute('tabindex', -1) 7 | @domNode.setAttribute('data-react-skip-selection-restoration', true) 8 | @domNode.style['-webkit-transform'] = 'translateZ(0)' 9 | @domNode.addEventListener 'paste', (event) -> event.preventDefault() 10 | 11 | getDomNode: -> 12 | @domNode 13 | 14 | updateSync: (state) -> 15 | @oldState ?= {} 16 | newState = state.hiddenInput 17 | 18 | if newState.top isnt @oldState.top 19 | @domNode.style.top = newState.top + 'px' 20 | @oldState.top = newState.top 21 | 22 | if newState.left isnt @oldState.left 23 | @domNode.style.left = newState.left + 'px' 24 | @oldState.left = newState.left 25 | 26 | if newState.width isnt @oldState.width 27 | @domNode.style.width = newState.width + 'px' 28 | @oldState.width = newState.width 29 | 30 | if newState.height isnt @oldState.height 31 | @domNode.style.height = newState.height + 'px' 32 | @oldState.height = newState.height 33 | -------------------------------------------------------------------------------- /src/panel-element.coffee: -------------------------------------------------------------------------------- 1 | {CompositeDisposable} = require 'event-kit' 2 | Panel = require './panel' 3 | 4 | class PanelElement extends HTMLElement 5 | createdCallback: -> 6 | @subscriptions = new CompositeDisposable 7 | 8 | initialize: (@model, {@views}) -> 9 | throw new Error("Must pass a views parameter when initializing PanelElements") unless @views? 10 | 11 | @appendChild(@getItemView()) 12 | 13 | @classList.add(@model.getClassName().split(' ')...) if @model.getClassName()? 14 | @subscriptions.add @model.onDidChangeVisible(@visibleChanged.bind(this)) 15 | @subscriptions.add @model.onDidDestroy(@destroyed.bind(this)) 16 | this 17 | 18 | getModel: -> 19 | @model ?= new Panel 20 | 21 | getItemView: -> 22 | @views.getView(@getModel().getItem()) 23 | 24 | attachedCallback: -> 25 | @visibleChanged(@getModel().isVisible()) 26 | 27 | visibleChanged: (visible) -> 28 | if visible 29 | @style.display = null 30 | else 31 | @style.display = 'none' 32 | 33 | destroyed: -> 34 | @subscriptions.dispose() 35 | @remove() 36 | 37 | module.exports = PanelElement = document.registerElement 'atom-panel', prototype: PanelElement.prototype 38 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/You-Dont-Need-jQuery/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 oneuijs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /src/ipc-helpers.js: -------------------------------------------------------------------------------- 1 | var ipcRenderer = null 2 | var ipcMain = null 3 | var BrowserWindow = null 4 | 5 | exports.call = function (methodName, ...args) { 6 | if (!ipcRenderer) { 7 | ipcRenderer = require('electron').ipcRenderer 8 | } 9 | 10 | var responseChannel = getResponseChannel(methodName) 11 | 12 | return new Promise(function (resolve) { 13 | ipcRenderer.on(responseChannel, function (event, result) { 14 | ipcRenderer.removeAllListeners(responseChannel) 15 | resolve(result) 16 | }) 17 | 18 | ipcRenderer.send(methodName, ...args) 19 | }) 20 | } 21 | 22 | exports.respondTo = function (methodName, callback) { 23 | if (!ipcMain) { 24 | var electron = require('electron') 25 | ipcMain = electron.ipcMain 26 | BrowserWindow = electron.BrowserWindow 27 | } 28 | 29 | var responseChannel = getResponseChannel(methodName) 30 | 31 | ipcMain.on(methodName, function (event, ...args) { 32 | var browserWindow = BrowserWindow.fromWebContents(event.sender) 33 | var result = callback(browserWindow, ...args) 34 | event.sender.send(responseChannel, result) 35 | }) 36 | } 37 | 38 | function getResponseChannel (methodName) { 39 | return 'ipc-helpers-' + methodName + '-response' 40 | } 41 | -------------------------------------------------------------------------------- /static/cursors.less: -------------------------------------------------------------------------------- 1 | @import "./variables/syntax-variables"; 2 | @import "syntax-variables"; 3 | 4 | @import "./variables/ui-variables"; 5 | @import "ui-variables"; 6 | 7 | @ibeam-1x: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAAAL0lEQVQoz2NgCD3x//9/BhBYBWdhgFVAiVW4JBFKGIa4AqD0//9D3pt4I4tAdAMAHTQ/j5Zom30AAAAASUVORK5CYII='); 8 | @ibeam-2x: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAQAAADZc7J/AAAAz0lEQVRIx2NgYGBY/R8I/vx5eelX3n82IJ9FxGf6tksvf/8FiTMQAcAGQMDvSwu09abffY8QYSAScNk45G198eX//yev73/4///701eh//kZSARckrNBRvz//+8+6ZohwCzjGNjdgQxkAg7B9WADeBjIBqtJCbhRA0YNoIkBSNmaPEMoNmA0FkYNoFKhapJ6FGyAH3nauaSmPfwI0v/3OukVi0CIZ+F25KrtYcx/CTIy0e+rC7R1Z4KMICVTQQ14feVXIbR695u14+Ir4gwAAD49E54wc1kWAAAAAElFTkSuQmCC'); 9 | 10 | .cursor-white() { 11 | cursor: -webkit-image-set(@ibeam-1x 1x, @ibeam-2x 2x) 5 8, text; 12 | } 13 | 14 | // Editors 15 | & when ( lightness(@syntax-background-color) < 50% ) { 16 | .platform-darwin atom-text-editor:not([mini])::shadow .editor-contents--private { 17 | .cursor-white(); 18 | } 19 | } 20 | 21 | // Mini Editors 22 | & when ( lightness(@input-background-color) < 50% ) { 23 | .platform-darwin atom-text-editor[mini]::shadow .editor-contents--private { 24 | .cursor-white(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /resources/mac/speakeasy.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN PUBLIC KEY----- 2 | MIIDOjCCAi0GByqGSM44BAEwggIgAoIBAQCEh+j0nKWTw7soK6w3uk9PzPGVBksk 3 | wDIaA+d+1CHJY9qhjp7OjAlSOl6nrUlGHzU87DRmBlwYZONAzDZnYpLi7zmPVASg 4 | Xk+AmuqzqahTKtwodJp7R/Aq/lCbB2tXTXOxVo+Jya1BQbfd0wWXJFUlD/xTvrgu 5 | zrtw6VYBvaRu8jCjHAJNZn0CO80igj1ZNxRqmmz1Rkt1tT0KBBfGBTNzXeBmGKHN 6 | bVIKW7zImgfm+UQky+WFei1dqcfWOyfrHIYa3Qn1Nes48SBdrolvfvrChlSpqgEN 7 | wxFW9aoognS1UJTu350AQb2NwOOSQRsR++y3iJp+60nBSDZu7sjNN9etAhUAvqki 8 | JOjBjooRd2odMh7imICHQ3kCggEATwa6W0s2xrolPRpwWZS8ORUNDgEI4eOIvonq 9 | O2qZgwD21zUQOsFjLMbWn0cCtrORr7iM8pFg8Yn8dSccpqs+2cM4uFZAycKXf6w3 10 | jIvV6M3IPQuUSqVFZtqUVuteGTEuAHZKIrXE05P4aJXHLjqSC9JuaXNRm9q7OW7m 11 | rwsoAFyfkKqbtl5Ch+WZ21CE4J+ByTfVwVU4XLiOtce6NABSDWNJsF9fIoFCZCDc 12 | uumLllDJysD8S6aBNhOjNMHPmeIpZBXT23zHH5du/blcEyBbVF3a2ntgudfJmyln 13 | T178CIEUSSjcbz9JyAhhK7OfNlzKhRiO1c4Y3XaZIniLGjF5DwOCAQUAAoIBABGZ 14 | mfuHBW89ub19iICE//VbB91m2f0nUvHk8vE4vvAK8AdD91GODPJr4DU0kJM6ne8r 15 | ohvZgokgDRkGAEceX/nVoG0RLq9T15Xr2qedWVwAffpU10iV9mYwbhHqUKPtG8cj 16 | GW0cDdSI+0oG6UEyn8aQ5p93YEm5N6lq4rWKpxXb/gkrIla4sJJP8VHOOKmo6l1H 17 | AKVIfofiaNAQShu72WVCCurWaoVTUEliEBhy3WlcjuKXEuoL1lpNxyqkt7mf6w71 18 | 6y2+Nh+XUTiFoTIVhk/CH0z+BQTneWEALvfTFzDae+a42rPAisKlt+Gbe7zopnVA 19 | kcQwM0lLzgwx4T1DV3s= 20 | -----END PUBLIC KEY----- -------------------------------------------------------------------------------- /spec/buffered-node-process-spec.coffee: -------------------------------------------------------------------------------- 1 | path = require 'path' 2 | BufferedNodeProcess = require '../src/buffered-node-process' 3 | 4 | describe "BufferedNodeProcess", -> 5 | it "executes the script in a new process", -> 6 | exit = jasmine.createSpy('exitCallback') 7 | output = '' 8 | stdout = (lines) -> output += lines 9 | error = '' 10 | stderr = (lines) -> error += lines 11 | args = ['hi'] 12 | command = path.join(__dirname, 'fixtures', 'script.js') 13 | 14 | new BufferedNodeProcess({command, args, stdout, stderr, exit}) 15 | 16 | waitsFor -> 17 | exit.callCount is 1 18 | 19 | runs -> 20 | expect(output).toBe 'hi' 21 | expect(error).toBe '' 22 | expect(args).toEqual ['hi'] 23 | 24 | it "suppresses deprecations in the new process", -> 25 | exit = jasmine.createSpy('exitCallback') 26 | output = '' 27 | stdout = (lines) -> output += lines 28 | error = '' 29 | stderr = (lines) -> error += lines 30 | command = path.join(__dirname, 'fixtures', 'script-with-deprecations.js') 31 | 32 | new BufferedNodeProcess({command, stdout, stderr, exit}) 33 | 34 | waitsFor -> 35 | exit.callCount is 1 36 | 37 | runs -> 38 | expect(output).toBe 'hi' 39 | expect(error).toBe '' 40 | -------------------------------------------------------------------------------- /spec/token-iterator-spec.coffee: -------------------------------------------------------------------------------- 1 | TextBuffer = require 'text-buffer' 2 | TokenizedBuffer = require '../src/tokenized-buffer' 3 | 4 | describe "TokenIterator", -> 5 | it "correctly terminates scopes at the beginning of the line (regression)", -> 6 | grammar = atom.grammars.createGrammar('test', { 7 | 'scopeName': 'text.broken' 8 | 'name': 'Broken grammar' 9 | 'patterns': [ 10 | { 11 | 'begin': 'start' 12 | 'end': '(?=end)' 13 | 'name': 'blue.broken' 14 | } 15 | { 16 | 'match': '.' 17 | 'name': 'yellow.broken' 18 | } 19 | ] 20 | }) 21 | 22 | buffer = new TextBuffer(text: """ 23 | start x 24 | end x 25 | x 26 | """) 27 | tokenizedBuffer = new TokenizedBuffer({ 28 | buffer, config: atom.config, grammarRegistry: atom.grammars, packageManager: atom.packages, assert: atom.assert 29 | }) 30 | tokenizedBuffer.setGrammar(grammar) 31 | 32 | tokenIterator = tokenizedBuffer.tokenizedLineForRow(1).getTokenIterator() 33 | tokenIterator.next() 34 | 35 | expect(tokenIterator.getBufferStart()).toBe 0 36 | expect(tokenIterator.getScopeEnds()).toEqual [] 37 | expect(tokenIterator.getScopeStarts()).toEqual ['text.broken', 'yellow.broken'] 38 | -------------------------------------------------------------------------------- /src/delegated-listener.js: -------------------------------------------------------------------------------- 1 | const EventKit = require('event-kit') 2 | 3 | module.exports = 4 | function listen (element, eventName, selector, handler) { 5 | var innerHandler = function (event) { 6 | if (selector) { 7 | var currentTarget = event.target 8 | while (currentTarget) { 9 | if (currentTarget.matches && currentTarget.matches(selector)) { 10 | handler({ 11 | type: event.type, 12 | currentTarget: currentTarget, 13 | target: event.target, 14 | preventDefault: function () { 15 | event.preventDefault() 16 | }, 17 | originalEvent: event 18 | }) 19 | } 20 | if (currentTarget === element) break 21 | currentTarget = currentTarget.parentNode 22 | } 23 | } else { 24 | handler({ 25 | type: event.type, 26 | currentTarget: event.currentTarget, 27 | target: event.target, 28 | preventDefault: function () { 29 | event.preventDefault() 30 | }, 31 | originalEvent: event 32 | }) 33 | } 34 | } 35 | 36 | element.addEventListener(eventName, innerHandler) 37 | 38 | return new EventKit.Disposable(function () { 39 | element.removeEventListener(eventName, innerHandler) 40 | }) 41 | } 42 | -------------------------------------------------------------------------------- /src/gutter-component-helpers.coffee: -------------------------------------------------------------------------------- 1 | # Helper methods shared among GutterComponent classes. 2 | 3 | module.exports = 4 | createGutterView: (gutterModel) -> 5 | domNode = document.createElement('div') 6 | domNode.classList.add('gutter') 7 | domNode.setAttribute('gutter-name', gutterModel.name) 8 | childNode = document.createElement('div') 9 | if gutterModel.name is 'line-number' 10 | childNode.classList.add('line-numbers') 11 | else 12 | childNode.classList.add('custom-decorations') 13 | domNode.appendChild(childNode) 14 | domNode 15 | 16 | # Sets scrollHeight, scrollTop, and backgroundColor on the given domNode. 17 | setDimensionsAndBackground: (oldState, newState, domNode) -> 18 | if newState.scrollHeight isnt oldState.scrollHeight 19 | domNode.style.height = newState.scrollHeight + 'px' 20 | oldState.scrollHeight = newState.scrollHeight 21 | 22 | if newState.scrollTop isnt oldState.scrollTop 23 | domNode.style['-webkit-transform'] = "translate3d(0px, #{-newState.scrollTop}px, 0px)" 24 | oldState.scrollTop = newState.scrollTop 25 | 26 | if newState.backgroundColor isnt oldState.backgroundColor 27 | domNode.style.backgroundColor = newState.backgroundColor 28 | oldState.backgroundColor = newState.backgroundColor 29 | -------------------------------------------------------------------------------- /script/utils/fingerprint.js: -------------------------------------------------------------------------------- 1 | var crypto = require('crypto') 2 | var fs = require('fs') 3 | var path = require('path') 4 | 5 | var fingerprintPath = path.resolve(__dirname, '..', '..', 'node_modules', '.atom-ci-fingerprint') 6 | 7 | module.exports = { 8 | fingerprint: function () { 9 | var packageJson = fs.readFileSync(path.resolve(__dirname, '..', '..', 'package.json')) 10 | 11 | //Include the electron minor version in the fingerprint since that changing requires a re-install 12 | var electronVersion = JSON.parse(packageJson).electronVersion.replace(/\.\d+$/, '') 13 | 14 | var body = electronVersion + process.platform + process.version 15 | return crypto.createHash('sha1').update(body).digest('hex') 16 | }, 17 | 18 | writeFingerprint: function () { 19 | var fingerprint = this.fingerprint() 20 | fs.writeFileSync(fingerprintPath, fingerprint) 21 | console.log('Wrote ci fingerprint:', fingerprintPath, fingerprint) 22 | }, 23 | 24 | readFingerprint: function() { 25 | if (fs.existsSync(fingerprintPath)) { 26 | return fs.readFileSync(fingerprintPath).toString() 27 | } else { 28 | return null 29 | } 30 | }, 31 | 32 | fingerprintMatches: function () { 33 | return this.readFingerprint() && this.readFingerprint() === this.fingerprint() 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /spec/pane-axis-element-spec.coffee: -------------------------------------------------------------------------------- 1 | PaneAxis = require '../src/pane-axis' 2 | PaneContainer = require '../src/pane-container' 3 | Pane = require '../src/pane' 4 | 5 | buildPane = -> 6 | new Pane({ 7 | applicationDelegate: atom.applicationDelegate, 8 | config: atom.config, 9 | deserializerManager: atom.deserializers, 10 | notificationManager: atom.notifications 11 | }) 12 | 13 | describe "PaneAxisElement", -> 14 | it "correctly subscribes and unsubscribes to the underlying model events on attach/detach", -> 15 | container = new PaneContainer(config: atom.config, applicationDelegate: atom.applicationDelegate) 16 | axis = new PaneAxis 17 | axis.setContainer(container) 18 | axisElement = atom.views.getView(axis) 19 | 20 | panes = [buildPane(), buildPane(), buildPane()] 21 | 22 | jasmine.attachToDOM(axisElement) 23 | axis.addChild(panes[0]) 24 | expect(axisElement.children[0]).toBe(atom.views.getView(panes[0])) 25 | 26 | axisElement.remove() 27 | axis.addChild(panes[1]) 28 | expect(axisElement.children[2]).toBeUndefined() 29 | 30 | jasmine.attachToDOM(axisElement) 31 | expect(axisElement.children[2]).toBe(atom.views.getView(panes[1])) 32 | 33 | axis.addChild(panes[2]) 34 | expect(axisElement.children[4]).toBe(atom.views.getView(panes[2])) 35 | -------------------------------------------------------------------------------- /static/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "../node_modules/bootstrap/less/variables.less"; 3 | @import "../node_modules/bootstrap/less/mixins.less"; 4 | 5 | // Reset 6 | @import "../node_modules/bootstrap/less/normalize.less"; 7 | 8 | // Core CSS 9 | @import "../node_modules/bootstrap/less/scaffolding.less"; 10 | @import "../node_modules/bootstrap/less/type.less"; 11 | @import "../node_modules/bootstrap/less/code.less"; 12 | @import "../node_modules/bootstrap/less/grid.less"; 13 | @import "../node_modules/bootstrap/less/tables.less"; 14 | @import "../node_modules/bootstrap/less/forms.less"; 15 | @import "../node_modules/bootstrap/less/buttons.less"; 16 | 17 | // Components 18 | @import "../node_modules/bootstrap/less/button-groups.less"; 19 | @import "../node_modules/bootstrap/less/input-groups.less"; 20 | @import "../node_modules/bootstrap/less/navs.less"; 21 | @import "../node_modules/bootstrap/less/labels.less"; 22 | @import "../node_modules/bootstrap/less/alerts.less"; 23 | @import "../node_modules/bootstrap/less/list-group.less"; 24 | @import "../node_modules/bootstrap/less/thumbnails.less"; 25 | @import "../node_modules/bootstrap/less/close.less"; 26 | 27 | // Components w/ JavaScript 28 | @import "../node_modules/bootstrap/less/tooltip.less"; 29 | 30 | // Utility classes 31 | @import "../node_modules/bootstrap/less/utilities.less"; 32 | -------------------------------------------------------------------------------- /src/coffee-script.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var crypto = require('crypto') 4 | var path = require('path') 5 | var CoffeeScript = null 6 | 7 | exports.shouldCompile = function () { 8 | return true 9 | } 10 | 11 | exports.getCachePath = function (sourceCode) { 12 | return path.join( 13 | 'coffee', 14 | crypto 15 | .createHash('sha1') 16 | .update(sourceCode, 'utf8') 17 | .digest('hex') + '.js' 18 | ) 19 | } 20 | 21 | exports.compile = function (sourceCode, filePath) { 22 | if (!CoffeeScript) { 23 | var previousPrepareStackTrace = Error.prepareStackTrace 24 | CoffeeScript = require('coffee-script') 25 | 26 | // When it loads, coffee-script reassigns Error.prepareStackTrace. We have 27 | // already reassigned it via the 'source-map-support' module, so we need 28 | // to set it back. 29 | Error.prepareStackTrace = previousPrepareStackTrace 30 | } 31 | 32 | if (process.platform === 'win32') { 33 | filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/') 34 | } 35 | 36 | var output = CoffeeScript.compile(sourceCode, { 37 | filename: filePath, 38 | sourceFiles: [filePath], 39 | sourceMap: true 40 | }) 41 | 42 | var js = output.js 43 | js += '\n' 44 | js += '//# sourceMappingURL=data:application/json;base64,' 45 | js += new Buffer(output.v3SourceMap).toString('base64') 46 | js += '\n' 47 | return js 48 | } 49 | -------------------------------------------------------------------------------- /src/scrollbar-corner-component.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | class ScrollbarCornerComponent 3 | constructor: -> 4 | @domNode = document.createElement('div') 5 | @domNode.classList.add('scrollbar-corner') 6 | 7 | @contentNode = document.createElement('div') 8 | @domNode.appendChild(@contentNode) 9 | 10 | getDomNode: -> 11 | @domNode 12 | 13 | updateSync: (state) -> 14 | @oldState ?= {} 15 | @newState ?= {} 16 | 17 | newHorizontalState = state.horizontalScrollbar 18 | newVerticalState = state.verticalScrollbar 19 | @newState.visible = newHorizontalState.visible and newVerticalState.visible 20 | @newState.height = newHorizontalState.height 21 | @newState.width = newVerticalState.width 22 | 23 | if @newState.visible isnt @oldState.visible 24 | if @newState.visible 25 | @domNode.style.display = '' 26 | else 27 | @domNode.style.display = 'none' 28 | @oldState.visible = @newState.visible 29 | 30 | if @newState.height isnt @oldState.height 31 | @domNode.style.height = @newState.height + 'px' 32 | @contentNode.style.height = @newState.height + 1 + 'px' 33 | @oldState.height = @newState.height 34 | 35 | if @newState.width isnt @oldState.width 36 | @domNode.style.width = @newState.width + 'px' 37 | @contentNode.style.width = @newState.width + 1 + 'px' 38 | @oldState.width = @newState.width 39 | -------------------------------------------------------------------------------- /src/deprecated-packages.coffee: -------------------------------------------------------------------------------- 1 | semver = require 'semver' 2 | 3 | deprecatedPackages = require('../package.json')?._deprecatedPackages ? {} 4 | ranges = {} 5 | 6 | exports.getDeprecatedPackageMetadata = (name) -> 7 | metadata = null 8 | if deprecatedPackages.hasOwnProperty(name) 9 | metadata = deprecatedPackages[name] 10 | Object.freeze(metadata) if metadata 11 | metadata 12 | 13 | exports.isDeprecatedPackage = (name, version) -> 14 | return false unless deprecatedPackages.hasOwnProperty(name) 15 | 16 | deprecatedVersionRange = deprecatedPackages[name].version 17 | return true unless deprecatedVersionRange 18 | 19 | semver.valid(version) and satisfies(version, deprecatedVersionRange) 20 | 21 | satisfies = (version, rawRange) -> 22 | unless parsedRange = ranges[rawRange] 23 | parsedRange = new Range(rawRange) 24 | ranges[rawRange] = parsedRange 25 | parsedRange.test(version) 26 | 27 | # Extend semver.Range to memoize matched versions for speed 28 | class Range extends semver.Range 29 | constructor: -> 30 | super 31 | @matchedVersions = new Set() 32 | @unmatchedVersions = new Set() 33 | 34 | test: (version) -> 35 | return true if @matchedVersions.has(version) 36 | return false if @unmatchedVersions.has(version) 37 | 38 | matches = super 39 | if matches 40 | @matchedVersions.add(version) 41 | else 42 | @unmatchedVersions.add(version) 43 | matches 44 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/hooks/prepare-commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare the commit log message. 4 | # Called by "git commit" with the name of the file that has the 5 | # commit message, followed by the description of the commit 6 | # message's source. The hook's purpose is to edit the commit 7 | # message file. If the hook fails with a non-zero status, 8 | # the commit is aborted. 9 | # 10 | # To enable this hook, rename this file to "prepare-commit-msg". 11 | 12 | # This hook includes three examples. The first comments out the 13 | # "Conflicts:" part of a merge commit. 14 | # 15 | # The second includes the output of "git diff --name-status -r" 16 | # into the message, just before the "git status" output. It is 17 | # commented because it doesn't cope with --amend or with squashed 18 | # commits. 19 | # 20 | # The third example adds a Signed-off-by line to the message, that can 21 | # still be edited. This is rarely a good idea. 22 | 23 | case "$2,$3" in 24 | merge,) 25 | /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; 26 | 27 | # ,|template,) 28 | # /usr/bin/perl -i.bak -pe ' 29 | # print "\n" . `git diff --cached --name-status -r` 30 | # if /^#/ && $first++ == 0' "$1" ;; 31 | 32 | *) ;; 33 | esac 34 | 35 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 36 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 37 | -------------------------------------------------------------------------------- /dot-atom/keymap.cson: -------------------------------------------------------------------------------- 1 | # Your keymap 2 | # 3 | # Atom keymaps work similarly to style sheets. Just as style sheets use 4 | # selectors to apply styles to elements, Atom keymaps use selectors to associate 5 | # keystrokes with events in specific contexts. Unlike style sheets however, 6 | # each selector can only be declared once. 7 | # 8 | # You can create a new keybinding in this file by typing "key" and then hitting 9 | # tab. 10 | # 11 | # Here's an example taken from Atom's built-in keymap: 12 | # 13 | # 'atom-text-editor': 14 | # 'enter': 'editor:newline' 15 | # 16 | # 'atom-workspace': 17 | # 'ctrl-shift-p': 'core:move-up' 18 | # 'ctrl-p': 'core:move-down' 19 | # 20 | # You can find more information about keymaps in these guides: 21 | # * http://flight-manual.atom.io/using-atom/sections/basic-customization/#_customizing_keybindings 22 | # * http://flight-manual.atom.io/behind-atom/sections/keymaps-in-depth/ 23 | # 24 | # If you're having trouble with your keybindings not working, try the 25 | # Keybinding Resolver: `Cmd+.` on macOS and `Ctrl+.` on other platforms. See the 26 | # Debugging Guide for more information: 27 | # * http://flight-manual.atom.io/hacking-atom/sections/debugging/#check-the-keybindings 28 | # 29 | # This file uses CoffeeScript Object Notation (CSON). 30 | # If you are unfamiliar with CSON, you can read more about it in the 31 | # Atom Flight Manual: 32 | # http://flight-manual.atom.io/using-atom/sections/basic-customization/#_cson 33 | -------------------------------------------------------------------------------- /static/utilities.less: -------------------------------------------------------------------------------- 1 | @import "ui-variables"; 2 | 3 | :focus { 4 | outline: none; 5 | } 6 | 7 | .pull-center { 8 | margin-left: auto; 9 | margin-right: auto; 10 | } 11 | 12 | .padded { 13 | padding: @component-padding; 14 | } 15 | 16 | // Blocks 17 | 18 | // Must be div.block so as not to affect syntax highlighting. 19 | ul.block, 20 | div.block { 21 | margin-bottom: @component-padding; 22 | } 23 | div > ul.block:last-child, 24 | div > div.block:last-child { 25 | margin-bottom: 0; 26 | } 27 | 28 | // Inline Blocks 29 | 30 | .inline-block, 31 | .inline-block-tight { 32 | display: inline-block; 33 | vertical-align: middle; 34 | } 35 | .inline-block { 36 | margin-right: @component-padding; 37 | } 38 | .inline-block-tight { 39 | margin-right: @component-padding/2; 40 | } 41 | div > .inline-block:last-child, 42 | div > .inline-block-tight:last-child { 43 | margin-right: 0; 44 | } 45 | 46 | .inline-block .inline-block { 47 | vertical-align: top; 48 | } 49 | 50 | // Use left margin when it's in a float: right element. 51 | // Sets the margin correctly when inline blocks are hidden and shown. 52 | .pull-right { 53 | .inline-block { 54 | margin-right: 0; 55 | margin-left: @component-padding; 56 | } 57 | .inline-block-tight { 58 | margin-right: 0; 59 | margin-left: @component-padding/2; 60 | } 61 | 62 | > .inline-block:first-child, 63 | > .inline-block-tight:first-child { 64 | margin-left: 0; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/jstips/hooks/prepare-commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare the commit log message. 4 | # Called by "git commit" with the name of the file that has the 5 | # commit message, followed by the description of the commit 6 | # message's source. The hook's purpose is to edit the commit 7 | # message file. If the hook fails with a non-zero status, 8 | # the commit is aborted. 9 | # 10 | # To enable this hook, rename this file to "prepare-commit-msg". 11 | 12 | # This hook includes three examples. The first comments out the 13 | # "Conflicts:" part of a merge commit. 14 | # 15 | # The second includes the output of "git diff --name-status -r" 16 | # into the message, just before the "git status" output. It is 17 | # commented because it doesn't cope with --amend or with squashed 18 | # commits. 19 | # 20 | # The third example adds a Signed-off-by line to the message, that can 21 | # still be edited. This is rarely a good idea. 22 | 23 | case "$2,$3" in 24 | merge,) 25 | /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; 26 | 27 | # ,|template,) 28 | # /usr/bin/perl -i.bak -pe ' 29 | # print "\n" . `git diff --cached --name-status -r` 30 | # if /^#/ && $first++ == 0' "$1" ;; 31 | 32 | *) ;; 33 | esac 34 | 35 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 36 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 37 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/modules/You-Dont-Need-jQuery/hooks/prepare-commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare the commit log message. 4 | # Called by "git commit" with the name of the file that has the 5 | # commit message, followed by the description of the commit 6 | # message's source. The hook's purpose is to edit the commit 7 | # message file. If the hook fails with a non-zero status, 8 | # the commit is aborted. 9 | # 10 | # To enable this hook, rename this file to "prepare-commit-msg". 11 | 12 | # This hook includes three examples. The first comments out the 13 | # "Conflicts:" part of a merge commit. 14 | # 15 | # The second includes the output of "git diff --name-status -r" 16 | # into the message, just before the "git status" output. It is 17 | # commented because it doesn't cope with --amend or with squashed 18 | # commits. 19 | # 20 | # The third example adds a Signed-off-by line to the message, that can 21 | # still be edited. This is rarely a good idea. 22 | 23 | case "$2,$3" in 24 | merge,) 25 | /usr/bin/perl -i.bak -ne 's/^/# /, s/^# #/#/ if /^Conflicts/ .. /#/; print' "$1" ;; 26 | 27 | # ,|template,) 28 | # /usr/bin/perl -i.bak -pe ' 29 | # print "\n" . `git diff --cached --name-status -r` 30 | # if /^#/ && $first++ == 0' "$1" ;; 31 | 32 | *) ;; 33 | esac 34 | 35 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 36 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 37 | -------------------------------------------------------------------------------- /src/token-iterator.coffee: -------------------------------------------------------------------------------- 1 | module.exports = 2 | class TokenIterator 3 | constructor: ({@grammarRegistry}, line) -> 4 | @reset(line) if line? 5 | 6 | reset: (@line) -> 7 | @index = null 8 | @startColumn = 0 9 | @endColumn = 0 10 | @scopes = @line.openScopes.map (id) => @grammarRegistry.scopeForId(id) 11 | @scopeStarts = @scopes.slice() 12 | @scopeEnds = [] 13 | this 14 | 15 | next: -> 16 | {tags} = @line 17 | 18 | if @index? 19 | @startColumn = @endColumn 20 | @scopeEnds.length = 0 21 | @scopeStarts.length = 0 22 | @index++ 23 | else 24 | @index = 0 25 | 26 | while @index < tags.length 27 | tag = tags[@index] 28 | if tag < 0 29 | scope = @grammarRegistry.scopeForId(tag) 30 | if tag % 2 is 0 31 | if @scopeStarts[@scopeStarts.length - 1] is scope 32 | @scopeStarts.pop() 33 | else 34 | @scopeEnds.push(scope) 35 | @scopes.pop() 36 | else 37 | @scopeStarts.push(scope) 38 | @scopes.push(scope) 39 | @index++ 40 | else 41 | @endColumn += tag 42 | @text = @line.text.substring(@startColumn, @endColumn) 43 | return true 44 | 45 | false 46 | 47 | getScopes: -> @scopes 48 | 49 | getScopeStarts: -> @scopeStarts 50 | 51 | getScopeEnds: -> @scopeEnds 52 | 53 | getText: -> @text 54 | 55 | getBufferStart: -> @startColumn 56 | 57 | getBufferEnd: -> @endColumn 58 | -------------------------------------------------------------------------------- /spec/integration/helpers/atom-launcher.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This script wraps the `Atom` binary, allowing the `chromedriver` server to 4 | # execute it with positional arguments and environment variables. `chromedriver` 5 | # only allows 'switches' to be specified when starting a browser, not positional 6 | # arguments, so this script accepts the following special switches: 7 | # 8 | # * `atom-path`: The path to the `Atom` binary. 9 | # * `atom-args`: A space-separated list of positional arguments to pass to Atom. 10 | # * `atom-env`: A space-separated list of key=value pairs representing environment 11 | # variables to set for Atom. 12 | # 13 | # Any other switches will be passed through to `Atom`. 14 | 15 | atom_path="" 16 | atom_switches=() 17 | atom_args=() 18 | 19 | for arg in "$@"; do 20 | case $arg in 21 | --atom-path=*) 22 | atom_path="${arg#*=}" 23 | ;; 24 | 25 | --atom-args=*) 26 | atom_arg_string="${arg#*=}" 27 | for atom_arg in $atom_arg_string; do 28 | atom_args+=($atom_arg) 29 | done 30 | ;; 31 | 32 | --atom-env=*) 33 | atom_env_string="${arg#*=}" 34 | for atom_env_pair in $atom_env_string; do 35 | export $atom_env_pair 36 | done 37 | ;; 38 | 39 | *) 40 | atom_switches+=($arg) 41 | ;; 42 | esac 43 | done 44 | 45 | echo "Launching Atom" >&2 46 | echo "${atom_path}" ${atom_args[@]} ${atom_switches[@]} >&2 47 | exec "${atom_path}" ${atom_args[@]} ${atom_switches[@]} 48 | -------------------------------------------------------------------------------- /src/typescript.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var _ = require('underscore-plus') 4 | var crypto = require('crypto') 5 | var path = require('path') 6 | 7 | var defaultOptions = { 8 | target: 1, 9 | module: 'commonjs', 10 | sourceMap: true 11 | } 12 | 13 | var TypeScriptSimple = null 14 | var typescriptVersionDir = null 15 | 16 | exports.shouldCompile = function () { 17 | return true 18 | } 19 | 20 | exports.getCachePath = function (sourceCode) { 21 | if (typescriptVersionDir == null) { 22 | var version = require('typescript-simple/package.json').version 23 | typescriptVersionDir = path.join('ts', createVersionAndOptionsDigest(version, defaultOptions)) 24 | } 25 | 26 | return path.join( 27 | typescriptVersionDir, 28 | crypto 29 | .createHash('sha1') 30 | .update(sourceCode, 'utf8') 31 | .digest('hex') + '.js' 32 | ) 33 | } 34 | 35 | exports.compile = function (sourceCode, filePath) { 36 | if (!TypeScriptSimple) { 37 | TypeScriptSimple = require('typescript-simple').TypeScriptSimple 38 | } 39 | 40 | var options = _.defaults({filename: filePath}, defaultOptions) 41 | return new TypeScriptSimple(options, false).compile(sourceCode, filePath) 42 | } 43 | 44 | function createVersionAndOptionsDigest (version, options) { 45 | return crypto 46 | .createHash('sha1') 47 | .update('typescript', 'utf8') 48 | .update('\0', 'utf8') 49 | .update(version, 'utf8') 50 | .update('\0', 'utf8') 51 | .update(JSON.stringify(options), 'utf8') 52 | .digest('hex') 53 | } 54 | -------------------------------------------------------------------------------- /script/utils/child-process-wrapper.js: -------------------------------------------------------------------------------- 1 | var childProcess = require('child_process'); 2 | 3 | // Exit the process if the command failed and only call the callback if the 4 | // command succeed, output of the command would also be piped. 5 | exports.safeExec = function(command, options, callback) { 6 | if (!callback) { 7 | callback = options; 8 | options = {}; 9 | } 10 | if (!options) 11 | options = {}; 12 | 13 | // This needed to be increased for `apm test` runs that generate many failures 14 | // The default is 200KB. 15 | options.maxBuffer = 1024 * 1024; 16 | 17 | var child = childProcess.exec(command, options, function(error, stdout, stderr) { 18 | if (error) 19 | process.exit(error.code || 1); 20 | else if (callback) 21 | callback(null); 22 | }); 23 | child.stderr.pipe(process.stderr); 24 | if (!options.ignoreStdout) 25 | child.stdout.pipe(process.stdout); 26 | } 27 | 28 | // Same with safeExec but call child_process.spawn instead. 29 | exports.safeSpawn = function(command, args, options, callback) { 30 | if (!callback) { 31 | callback = options; 32 | options = {}; 33 | } 34 | var child = childProcess.spawn(command, args, options); 35 | child.stderr.pipe(process.stderr); 36 | child.stdout.pipe(process.stdout); 37 | child.on('error', function(error) { 38 | console.error('Command \'' + command + '\' failed: ' + error.message); 39 | }); 40 | child.on('exit', function(code) { 41 | if (code != 0) 42 | process.exit(code); 43 | else 44 | callback(null); 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /exports/atom.coffee: -------------------------------------------------------------------------------- 1 | TextBuffer = require 'text-buffer' 2 | {Point, Range} = TextBuffer 3 | {File, Directory} = require 'pathwatcher' 4 | {Emitter, Disposable, CompositeDisposable} = require 'event-kit' 5 | Grim = require 'grim' 6 | 7 | module.exports = 8 | BufferedNodeProcess: require '../src/buffered-node-process' 9 | BufferedProcess: require '../src/buffered-process' 10 | GitRepository: require '../src/git-repository' 11 | GitRepositoryAsync: require '../src/git-repository-async' 12 | Notification: require '../src/notification' 13 | TextBuffer: TextBuffer 14 | Point: Point 15 | Range: Range 16 | File: File 17 | Directory: Directory 18 | Emitter: Emitter 19 | Disposable: Disposable 20 | CompositeDisposable: CompositeDisposable 21 | 22 | # The following classes can't be used from a Task handler and should therefore 23 | # only be exported when not running as a child node process 24 | unless process.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE 25 | module.exports.Task = require '../src/task' 26 | 27 | TextEditor = (params) -> 28 | atom.workspace.buildTextEditor(params) 29 | 30 | TextEditor.prototype = require('../src/text-editor').prototype 31 | 32 | Object.defineProperty module.exports, 'TextEditor', 33 | enumerable: true 34 | get: -> 35 | Grim.deprecate """ 36 | The `TextEditor` constructor is no longer public. 37 | 38 | To construct a text editor, use `atom.workspace.buildTextEditor()`. 39 | To check if an object is a text editor, use `atom.workspace.isTextEditor(object)`. 40 | """ 41 | TextEditor 42 | -------------------------------------------------------------------------------- /src/main-process/atom-protocol-handler.coffee: -------------------------------------------------------------------------------- 1 | {app, protocol} = require 'electron' 2 | fs = require 'fs' 3 | path = require 'path' 4 | 5 | # Handles requests with 'atom' protocol. 6 | # 7 | # It's created by {AtomApplication} upon instantiation and is used to create a 8 | # custom resource loader for 'atom://' URLs. 9 | # 10 | # The following directories are searched in order: 11 | # * ~/.atom/assets 12 | # * ~/.atom/dev/packages (unless in safe mode) 13 | # * ~/.atom/packages 14 | # * RESOURCE_PATH/node_modules 15 | # 16 | module.exports = 17 | class AtomProtocolHandler 18 | constructor: (resourcePath, safeMode) -> 19 | @loadPaths = [] 20 | 21 | unless safeMode 22 | @loadPaths.push(path.join(process.env.ATOM_HOME, 'dev', 'packages')) 23 | 24 | @loadPaths.push(path.join(process.env.ATOM_HOME, 'packages')) 25 | @loadPaths.push(path.join(resourcePath, 'node_modules')) 26 | 27 | @registerAtomProtocol() 28 | 29 | # Creates the 'atom' custom protocol handler. 30 | registerAtomProtocol: -> 31 | protocol.registerFileProtocol 'atom', (request, callback) => 32 | relativePath = path.normalize(request.url.substr(7)) 33 | 34 | if relativePath.indexOf('assets/') is 0 35 | assetsPath = path.join(process.env.ATOM_HOME, relativePath) 36 | filePath = assetsPath if fs.statSyncNoException(assetsPath).isFile?() 37 | 38 | unless filePath 39 | for loadPath in @loadPaths 40 | filePath = path.join(loadPath, relativePath) 41 | break if fs.statSyncNoException(filePath).isFile?() 42 | 43 | callback(filePath) 44 | -------------------------------------------------------------------------------- /static/variables/syntax-variables.less: -------------------------------------------------------------------------------- 1 | // This file has fallback variables. It specifies all syntax variables that 2 | // themes must implement if they include a syntax-variables.less file. 3 | 4 | // General colors 5 | @syntax-text-color: #333; 6 | @syntax-cursor-color: #333; 7 | @syntax-selection-color: #69c; 8 | @syntax-selection-flash-color: #00f; // Color the selection is 'flashed' when you run find next 9 | @syntax-background-color: #fff; 10 | 11 | // Guide colors 12 | @syntax-wrap-guide-color: #ccc; 13 | @syntax-indent-guide-color: #ccc; 14 | @syntax-invisible-character-color: #ccc; 15 | 16 | // For find and replace markers 17 | @syntax-result-marker-color: #444; 18 | @syntax-result-marker-color-selected: #000; 19 | 20 | // Gutter colors 21 | @syntax-gutter-text-color: #333; 22 | @syntax-gutter-text-color-selected: #000; 23 | @syntax-gutter-background-color: #ccc; 24 | @syntax-gutter-background-color-selected: #eee; 25 | 26 | // For git diff info. i.e. in the gutter 27 | @syntax-color-added: green; 28 | @syntax-color-modified: orange; 29 | @syntax-color-removed: red; 30 | @syntax-color-renamed: blue; 31 | 32 | // For language entity colors 33 | @syntax-color-variable: #DF6A73; 34 | @syntax-color-constant: #DF6A73; 35 | @syntax-color-property: #DF6A73; 36 | @syntax-color-value: #D29B67; 37 | @syntax-color-function: #61AEEF; 38 | @syntax-color-method: @syntax-color-function; 39 | @syntax-color-class: #E5C17C; 40 | @syntax-color-keyword: #a431c4; 41 | @syntax-color-tag: #b72424; 42 | @syntax-color-attribute: #87400d; 43 | @syntax-color-import: #97C378; 44 | @syntax-color-snippet: #97C378; 45 | -------------------------------------------------------------------------------- /resources/linux/redhat/atom.spec.in: -------------------------------------------------------------------------------- 1 | Name: <%= appFileName %> 2 | Version: <%= version %> 3 | Release: 0.1%{?dist} 4 | Summary: <%= description %> 5 | License: MIT 6 | URL: https://atom.io/ 7 | AutoReqProv: no # Avoid libchromiumcontent.so missing dependency 8 | Prefix: <%= installDir %> 9 | 10 | Requires: lsb-core-noarch 11 | 12 | %description 13 | <%= description %> 14 | 15 | %install 16 | mkdir -p "%{buildroot}/<%= installDir %>/share/<%= appFileName %>/" 17 | cp -r "<%= appName %>"/* "%{buildroot}/<%= installDir %>/share/<%= appFileName %>/" 18 | mkdir -p "%{buildroot}/<%= installDir %>/bin/" 19 | ln -sf "../share/<%= appFileName %>/resources/app/apm/node_modules/.bin/apm" "%{buildroot}/<%= installDir %>/bin/<%= apmFileName %>" 20 | cp atom.sh "%{buildroot}/<%= installDir %>/bin/<%= appFileName %>" 21 | chmod 755 "%{buildroot}/<%= installDir %>/bin/<%= appFileName %>" 22 | mkdir -p "%{buildroot}/<%= installDir %>/share/applications/" 23 | cp "<%= appFileName %>.desktop" "%{buildroot}/<%= installDir %>/share/applications/" 24 | 25 | for i in 1024 512 256 128 64 48 32 24 16; do 26 | mkdir -p "%{buildroot}/<%= installDir %>/share/icons/hicolor/${i}x${i}/apps" 27 | cp "icons/${i}.png" "%{buildroot}/<%= installDir %>/share/icons/hicolor/${i}x${i}/apps/<%= appFileName %>.png" 28 | done 29 | 30 | %files 31 | <%= installDir %>/bin/<%= appFileName %> 32 | <%= installDir %>/bin/<%= apmFileName %> 33 | <%= installDir %>/share/<%= appFileName %>/ 34 | <%= installDir %>/share/applications/<%= appFileName %>.desktop 35 | <%= installDir %>/share/icons/hicolor/ 36 | -------------------------------------------------------------------------------- /src/main-process/atom-portable.coffee: -------------------------------------------------------------------------------- 1 | fs = require 'fs-plus' 2 | path = require 'path' 3 | {ipcMain} = require 'electron' 4 | 5 | module.exports = 6 | class AtomPortable 7 | @getPortableAtomHomePath: -> 8 | execDirectoryPath = path.dirname(process.execPath) 9 | path.join(execDirectoryPath, '..', '.atom') 10 | 11 | @setPortable: (existingAtomHome) -> 12 | fs.copySync(existingAtomHome, @getPortableAtomHomePath()) 13 | 14 | @isPortableInstall: (platform, environmentAtomHome, defaultHome) -> 15 | return false unless platform in ['linux', 'win32'] 16 | return false if environmentAtomHome 17 | return false if not fs.existsSync(@getPortableAtomHomePath()) 18 | # currently checking only that the directory exists and is writable, 19 | # probably want to do some integrity checks on contents in future 20 | @isPortableAtomHomePathWritable(defaultHome) 21 | 22 | @isPortableAtomHomePathWritable: (defaultHome) -> 23 | writable = false 24 | message = "" 25 | try 26 | writePermissionTestFile = path.join(@getPortableAtomHomePath(), "write.test") 27 | fs.writeFileSync(writePermissionTestFile, "test") if not fs.existsSync(writePermissionTestFile) 28 | fs.removeSync(writePermissionTestFile) 29 | writable = true 30 | catch error 31 | message = "Failed to use portable Atom home directory (#{@getPortableAtomHomePath()}). Using the default instead (#{defaultHome}). #{error.message}" 32 | 33 | ipcMain.on 'check-portable-home-writable', (event) -> 34 | event.sender.send 'check-portable-home-writable-response', {writable, message} 35 | writable 36 | -------------------------------------------------------------------------------- /spec/fixtures/git/repo-with-submodules/git.git/hooks/pre-push.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # An example hook script to verify what is about to be pushed. Called by "git 4 | # push" after it has checked the remote status, but before anything has been 5 | # pushed. If this script exits with a non-zero status nothing will be pushed. 6 | # 7 | # This hook is called with the following parameters: 8 | # 9 | # $1 -- Name of the remote to which the push is being done 10 | # $2 -- URL to which the push is being done 11 | # 12 | # If pushing without using a named remote those arguments will be equal. 13 | # 14 | # Information about the commits which are being pushed is supplied as lines to 15 | # the standard input in the form: 16 | # 17 | # 18 | # 19 | # This sample shows how to prevent push of commits where the log message starts 20 | # with "WIP" (work in progress). 21 | 22 | remote="$1" 23 | url="$2" 24 | 25 | z40=0000000000000000000000000000000000000000 26 | 27 | while read local_ref local_sha remote_ref remote_sha 28 | do 29 | if [ "$local_sha" = $z40 ] 30 | then 31 | # Handle delete 32 | : 33 | else 34 | if [ "$remote_sha" = $z40 ] 35 | then 36 | # New branch, examine all commits 37 | range="$local_sha" 38 | else 39 | # Update to existing branch, examine new commits 40 | range="$remote_sha..$local_sha" 41 | fi 42 | 43 | # Check for WIP commit 44 | commit=`git rev-list -n 1 --grep '^WIP' "$range"` 45 | if [ -n "$commit" ] 46 | then 47 | echo >&2 "Found WIP commit in $local_ref, not pushing" 48 | exit 1 49 | fi 50 | fi 51 | done 52 | 53 | exit 0 54 | -------------------------------------------------------------------------------- /script/mkdeb: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # mkdeb name version channel arch control-file-path desktop-file-path icon-path deb-file-path 3 | 4 | set -e 5 | 6 | SCRIPT=`readlink -f "$0"` 7 | ROOT=`readlink -f $(dirname $SCRIPT)/..` 8 | cd $ROOT 9 | 10 | NAME="$1" 11 | VERSION="$2" 12 | CHANNEL="$3" 13 | ARCH="$4" 14 | CONTROL_FILE="$5" 15 | DESKTOP_FILE="$6" 16 | ICON_FILE="$7" 17 | DEB_PATH="$8" 18 | FILE_MODE=755 19 | 20 | TARGET_ROOT="`mktemp -d`" 21 | chmod $FILE_MODE "$TARGET_ROOT" 22 | TARGET="$TARGET_ROOT/$NAME-$VERSION-$ARCH" 23 | 24 | mkdir -m $FILE_MODE -p "$TARGET/usr" 25 | env INSTALL_PREFIX="$TARGET/usr" script/grunt install --channel $CHANNEL 26 | 27 | mkdir -m $FILE_MODE -p "$TARGET/DEBIAN" 28 | cp "$CONTROL_FILE" "$TARGET/DEBIAN/control" 29 | 30 | mkdir -m $FILE_MODE -p "$TARGET/usr/share/applications" 31 | cp "$DESKTOP_FILE" "$TARGET/usr/share/applications" 32 | 33 | mkdir -m $FILE_MODE -p "$TARGET/usr/share/pixmaps" 34 | cp "$ICON_FILE" "$TARGET/usr/share/pixmaps/$NAME.png" 35 | 36 | # Copy generated LICENSE.md to /usr/share/doc/atom/copyright 37 | mkdir -m $FILE_MODE -p "$TARGET/usr/share/doc/$NAME" 38 | cp "$TARGET/usr/share/$NAME/resources/LICENSE.md" "$TARGET/usr/share/doc/$NAME/copyright" 39 | 40 | # Add lintian overrides 41 | mkdir -m $FILE_MODE -p "$TARGET/usr/share/lintian/overrides" 42 | cp "$ROOT/resources/linux/debian/lintian-overrides" "$TARGET/usr/share/lintian/overrides/$NAME" 43 | 44 | # Remove executable bit from .node files 45 | find "$TARGET" -type f -name "*.node" -exec chmod a-x {} \; 46 | 47 | fakeroot dpkg-deb -b "$TARGET" 48 | mv "$TARGET_ROOT/$NAME-$VERSION-$ARCH.deb" "$DEB_PATH" 49 | rm -rf "$TARGET_ROOT" 50 | -------------------------------------------------------------------------------- /ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Prerequisites 2 | 3 | * [ ] Can you reproduce the problem in [safe mode](http://flight-manual.atom.io/hacking-atom/sections/debugging/#check-if-the-problem-shows-up-in-safe-mode)? 4 | * [ ] Are you running the [latest version of Atom](http://flight-manual.atom.io/hacking-atom/sections/debugging/#update-to-the-latest-version)? 5 | * [ ] Did you check the [debugging guide](http://flight-manual.atom.io/hacking-atom/sections/debugging/)? 6 | * [ ] Did you check the [FAQs on Discuss](https://discuss.atom.io/c/faq)? 7 | * [ ] Are you reporting to the [correct repository](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#atom-and-packages)? 8 | * [ ] Did you [perform a cursory search](https://github.com/issues?q=is%3Aissue+user%3Aatom+-repo%3Aatom%2Felectron) to see if your bug or enhancement is already reported? 9 | 10 | For more information on how to write a good [bug report](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report) or [enhancement request](https://github.com/atom/atom/blob/master/CONTRIBUTING.md#how-do-i-submit-a-good-enhancement-suggestion), see the `CONTRIBUTING` guide. 11 | 12 | ### Description 13 | 14 | [Description of the bug or feature] 15 | 16 | ### Steps to Reproduce 17 | 18 | 1. [First Step] 19 | 2. [Second Step] 20 | 3. [and so on...] 21 | 22 | **Expected behavior:** [What you expected to happen] 23 | 24 | **Actual behavior:** [What actually happened] 25 | 26 | ### Versions 27 | 28 | You can get this information from executing `atom --version` and `apm --version` at the command line. Also, please include the OS and what version of the OS you're running. 29 | -------------------------------------------------------------------------------- /src/main-process/spawner.coffee: -------------------------------------------------------------------------------- 1 | ChildProcess = require 'child_process' 2 | 3 | # Spawn a command and invoke the callback when it completes with an error 4 | # and the output from standard out. 5 | # 6 | # * `command` The underlying OS command {String} to execute. 7 | # * `args` (optional) The {Array} with arguments to be passed to command. 8 | # * `callback` (optional) The {Function} to call after the command has run. It will be invoked with arguments: 9 | # * `error` (optional) An {Error} object returned by the command, `null` if no error was thrown. 10 | # * `code` Error code returned by the command. 11 | # * `stdout` The {String} output text generated by the command. 12 | # * `stdout` The {String} output text generated by the command. 13 | # 14 | # Returns `undefined`. 15 | exports.spawn = (command, args, callback) -> 16 | stdout = '' 17 | 18 | try 19 | spawnedProcess = ChildProcess.spawn(command, args) 20 | catch error 21 | # Spawn can throw an error 22 | process.nextTick -> callback?(error, stdout) 23 | return 24 | 25 | spawnedProcess.stdout.on 'data', (data) -> stdout += data 26 | 27 | error = null 28 | spawnedProcess.on 'error', (processError) -> error ?= processError 29 | spawnedProcess.on 'close', (code, signal) -> 30 | error ?= new Error("Command failed: #{signal ? code}") if code isnt 0 31 | error?.code ?= code 32 | error?.stdout ?= stdout 33 | callback?(error, stdout) 34 | # This is necessary if using Powershell 2 on Windows 7 to get the events to raise 35 | # http://stackoverflow.com/questions/9155289/calling-powershell-from-nodejs 36 | spawnedProcess.stdin.end() 37 | --------------------------------------------------------------------------------