mirror of
https://github.com/atom/atom.git
synced 2026-01-25 14:59:03 -05:00
Merge remote-tracking branch 'origin/master' into aw/custom-line-number-gutter
This commit is contained in:
@@ -27,7 +27,7 @@ install:
|
||||
- source /tmp/.nvm/nvm.sh
|
||||
- nvm install $NODE_VERSION
|
||||
- nvm use --delete-prefix $NODE_VERSION
|
||||
- npm install -g npm@6.1.0
|
||||
- npm install --global npm@6.2.0
|
||||
- script/build --create-debian-package --create-rpm-package --compress-artifacts
|
||||
|
||||
script:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||

|
||||
|
||||
[](https://circleci.com/gh/atom/atom) [](https://travis-ci.org/atom/atom) [](https://ci.appveyor.com/project/Atom/atom)
|
||||
[](https://github.visualstudio.com/Atom/_build/latest?definitionId=32&branch=master) [](https://travis-ci.org/atom/atom) [](https://ci.appveyor.com/project/Atom/atom)
|
||||
[](https://david-dm.org/atom/atom)
|
||||
[](https://atom-slack.herokuapp.com)
|
||||
|
||||
|
||||
8025
apm/package-lock.json
generated
8025
apm/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,6 @@
|
||||
"url": "https://github.com/atom/atom.git"
|
||||
},
|
||||
"dependencies": {
|
||||
"atom-package-manager": "2.0.0"
|
||||
"atom-package-manager": "2.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ install:
|
||||
- IF NOT EXIST %TEST_JUNIT_XML_ROOT% MKDIR %TEST_JUNIT_XML_ROOT%
|
||||
- SET PATH=C:\Program Files\Atom\resources\cli;%PATH%
|
||||
- ps: Install-Product node $env:NODE_VERSION $env:PLATFORM
|
||||
- npm install --global npm@6.2.0
|
||||
|
||||
build_script:
|
||||
- CD %APPVEYOR_BUILD_FOLDER%
|
||||
|
||||
44
circle.yml
44
circle.yml
@@ -1,44 +0,0 @@
|
||||
machine:
|
||||
environment:
|
||||
XCODE_SCHEME: test
|
||||
XCODE_WORKSPACE: test
|
||||
XCODE_PROJECT: test
|
||||
TEST_JUNIT_XML_ROOT: ${CIRCLE_TEST_REPORTS}
|
||||
|
||||
xcode:
|
||||
version: 7.3
|
||||
|
||||
general:
|
||||
artifacts:
|
||||
- out/atom-mac.zip
|
||||
- out/atom-mac-symbols.zip
|
||||
- docs/output/atom-api.json
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.3/install.sh | bash
|
||||
- nvm install 8.9.3
|
||||
- nvm use 8.9.3
|
||||
|
||||
override:
|
||||
- script/build --code-sign --compress-artifacts
|
||||
|
||||
cache_directories:
|
||||
- electron
|
||||
- apm/node_modules
|
||||
- script/node_modules
|
||||
- node_modules
|
||||
- ~/.atom/compile-cache
|
||||
- ~/.atom/snapshot-cache
|
||||
|
||||
test:
|
||||
override:
|
||||
- script/lint
|
||||
- osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
|
||||
- caffeinate -s script/test # Run with caffeinate to prevent screen saver
|
||||
|
||||
experimental:
|
||||
notify:
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
@@ -1,8 +1,8 @@
|
||||
# Atom build status
|
||||
|
||||
| System | Travis | AppVeyor/Win | Circle/Mac | Dependencies |
|
||||
| System | Travis | AppVeyor/Win | VSTS | Dependencies |
|
||||
|--------|--------|--------------|------------|--------------|
|
||||
| [Atom](https://github.com/atom/atom) | [](https://travis-ci.org/atom/atom) | [](https://ci.appveyor.com/project/Atom/atom) | [](https://circleci.com/gh/atom/atom) | [](https://david-dm.org/atom/atom) |
|
||||
| [Atom](https://github.com/atom/atom) | [](https://travis-ci.org/atom/atom) | [](https://ci.appveyor.com/project/Atom/atom) | [](https://github.visualstudio.com/Atom/_build/latest?definitionId=32&branch=master) | [](https://david-dm.org/atom/atom) |
|
||||
| [APM](https://github.com/atom/apm) | [](https://travis-ci.org/atom/apm) | [](https://ci.appveyor.com/project/Atom/apm/branch/master) | | [](https://david-dm.org/atom/apm) |
|
||||
| [Electron](https://github.com/electron/electron) | [](https://travis-ci.org/electron/electron) | [](https://ci.appveyor.com/project/Atom/electron) | | [](https://david-dm.org/electron/electron)
|
||||
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
Want to know what the Atom team is working on and what has our focus over the next few months? You've come to the right place. 🎯
|
||||
|
||||
The sections below represent our **near-term roadmap**:
|
||||
|
||||
* [Atom Core](#atom-core)
|
||||
* [Tree-sitter](#tree-sitter)
|
||||
|
||||
This roadmap is a [living document](https://en.wikipedia.org/wiki/Living_document): it represents our current plans, but we expect these plans to change from time to time. Follow [this link](https://github.com/atom/atom/blob/4fbad81a7cd2f2e3925d7e920086bc1ebf2fe210/docs/focus/README.md) to see the previous major version of this roadmap.
|
||||
|
||||
@@ -13,43 +9,20 @@ You can find our bi-weekly iteration plans by searching for issues with the [`it
|
||||
|
||||
---
|
||||
|
||||
## Atom Core
|
||||
### Core package development is streamlined
|
||||
Everything in Atom is a package. While this adds to its hackability, it is not always the best path forward. Consolidating packages as well as thinking about other ways to decrease friction for contributors will help pay down some of our tech debt in this area. More information regarding planning was provided in [this RFC](https://github.com/atom/atom/blob/master/docs/rfcs/003-consolidate-core-packages.md)
|
||||
|
||||
### Enable improvements to built-in packages to be delivered more frequently
|
||||
- [ ] Merge at least 22 packages in to atom/atom
|
||||
|
||||
- [ ] Investigate options for enabling more frequent updates to built-in packages either by shipping Atom more frequently or enabling out-of-band package updates
|
||||
- [ ] Write and publish an RFC describing the proposed alternatives
|
||||
- [ ] Implement the approved solution such that updates can start being delivered more frequently in the next few months
|
||||
|
||||
### Clarify issue and PR processes to streamline triage and contribution
|
||||
### Improve Communication and Process
|
||||
|
||||
- [ ] Refine process for triaging issues and PRs across Atom org repositories
|
||||
- [ ] Publish a document that outlines merge requirements for PRs
|
||||
- [ ] Triage existing/old issues and PRs across our repos weekly to clear out the backlog and get our open issues back to a manageable state
|
||||
- [ ] Publish a document that outlines merge requirements for community PRs
|
||||
- [ ] Reactive tickets are incorporated in to 80% of all sprints
|
||||
- [ ] Automate some aspects of Atom issue and PR triage with Probot, especially around ensuring PRs follow our contribution guidelines
|
||||
|
||||
### Streamline the Atom Core release process
|
||||
### Establish and Measure
|
||||
|
||||
- [ ] Implement "Publish" action to publish releases using Atom Release Publisher
|
||||
- [ ] Complete automation of Linux package publishing
|
||||
- [ ] Automate generation of draft release notes for new releases
|
||||
- [ ] Investigate scheduled automation of Atom releases
|
||||
- [ ] Update Atom release process documentation to reflect new release steps
|
||||
- [ ] Move to VSTS CI to centralize all OS platform builds on a single service
|
||||
- [ ] Prototype the use of Electron's new update service to see if it works for our needs
|
||||
|
||||
### [Stretch] Enable pre-transpilation of built-in packages to remove compiler dependencies from Atom
|
||||
|
||||
- [ ] Investigate approaches for pre-transpilation of Babel and TypeScript code in built-in packages
|
||||
- [ ] Write an RFC that covers both on-demand transpilation and pre-transpilation for Atom builds
|
||||
|
||||
## Tree-sitter
|
||||
|
||||
### Finish work on Tree-sitter syntax highlighting, enable it by default
|
||||
|
||||
- [ ] Implement parsing on a background thread to ensure responsiveness
|
||||
- [ ] Add a system for highlighting built-in functions and other things not distinguished in the AST.
|
||||
- [ ] Add a system for parsing things like escape sequences in regexes, which are not identified in the AST.
|
||||
- [ ] Document the new grammar format in the flight manual.
|
||||
- [ ] Add a way of disabling Tree-sitter highlighting on a per-language basis.
|
||||
- [ ] Enable Tree-sitter highlighting by default for one or more languages.
|
||||
- [ ] Implement Atom metrics dashboard that can be used to drive future decisions
|
||||
- [ ] Determine what may be helpful to measure in the future building upon work [already in progress](http://blog.atom.io/2018/06/20/atom-metrics.html)
|
||||
|
||||
623
package-lock.json
generated
623
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
74
package.json
74
package.json
@@ -12,7 +12,7 @@
|
||||
"url": "https://github.com/atom/atom/issues"
|
||||
},
|
||||
"license": "MIT",
|
||||
"electronVersion": "2.0.5",
|
||||
"electronVersion": "2.0.7",
|
||||
"dependencies": {
|
||||
"@atom/nsfw": "^1.0.18",
|
||||
"@atom/source-map-support": "^0.3.4",
|
||||
@@ -25,12 +25,12 @@
|
||||
"atom-keymap": "8.2.10",
|
||||
"atom-light-syntax": "https://www.atom.io/api/packages/atom-light-syntax/versions/0.29.0/tarball",
|
||||
"atom-light-ui": "https://www.atom.io/api/packages/atom-light-ui/versions/0.46.2/tarball",
|
||||
"atom-select-list": "^0.7.0",
|
||||
"atom-select-list": "^0.7.2",
|
||||
"atom-ui": "0.4.1",
|
||||
"autocomplete-atom-api": "https://www.atom.io/api/packages/autocomplete-atom-api/versions/0.10.7/tarball",
|
||||
"autocomplete-css": "https://www.atom.io/api/packages/autocomplete-css/versions/0.17.5/tarball",
|
||||
"autocomplete-html": "https://www.atom.io/api/packages/autocomplete-html/versions/0.8.4/tarball",
|
||||
"autocomplete-plus": "https://www.atom.io/api/packages/autocomplete-plus/versions/2.40.6/tarball",
|
||||
"autocomplete-plus": "https://www.atom.io/api/packages/autocomplete-plus/versions/2.40.7/tarball",
|
||||
"autocomplete-snippets": "https://www.atom.io/api/packages/autocomplete-snippets/versions/1.12.0/tarball",
|
||||
"autoflow": "https://www.atom.io/api/packages/autoflow/versions/0.29.4/tarball",
|
||||
"autosave": "https://www.atom.io/api/packages/autosave/versions/0.24.6/tarball",
|
||||
@@ -56,7 +56,7 @@
|
||||
"etch": "^0.12.6",
|
||||
"event-kit": "^2.5.0",
|
||||
"exception-reporting": "https://www.atom.io/api/packages/exception-reporting/versions/0.43.1/tarball",
|
||||
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.215.11/tarball",
|
||||
"find-and-replace": "https://www.atom.io/api/packages/find-and-replace/versions/0.215.12/tarball",
|
||||
"find-parent-dir": "^0.3.0",
|
||||
"first-mate": "7.1.1",
|
||||
"focus-trap": "2.4.5",
|
||||
@@ -66,31 +66,31 @@
|
||||
"fuzzaldrin": "^2.1",
|
||||
"fuzzy-finder": "https://www.atom.io/api/packages/fuzzy-finder/versions/1.8.2/tarball",
|
||||
"git-diff": "https://www.atom.io/api/packages/git-diff/versions/1.3.9/tarball",
|
||||
"git-utils": "5.4.0",
|
||||
"github": "https://www.atom.io/api/packages/github/versions/0.18.2/tarball",
|
||||
"git-utils": "5.2.1",
|
||||
"github": "https://www.atom.io/api/packages/github/versions/0.19.0/tarball",
|
||||
"glob": "^7.1.1",
|
||||
"go-to-line": "https://www.atom.io/api/packages/go-to-line/versions/0.33.0/tarball",
|
||||
"grammar-selector": "https://www.atom.io/api/packages/grammar-selector/versions/0.50.1/tarball",
|
||||
"grim": "1.5.0",
|
||||
"image-view": "https://www.atom.io/api/packages/image-view/versions/0.63.0/tarball",
|
||||
"image-view": "https://www.atom.io/api/packages/image-view/versions/0.63.1/tarball",
|
||||
"incompatible-packages": "https://www.atom.io/api/packages/incompatible-packages/versions/0.27.3/tarball",
|
||||
"jasmine-json": "~0.0",
|
||||
"jasmine-reporters": "1.1.0",
|
||||
"jasmine-tagged": "^1.1.4",
|
||||
"key-path-helpers": "^0.4.0",
|
||||
"keybinding-resolver": "https://www.atom.io/api/packages/keybinding-resolver/versions/0.38.2/tarball",
|
||||
"language-c": "https://www.atom.io/api/packages/language-c/versions/0.60.0/tarball",
|
||||
"language-c": "https://www.atom.io/api/packages/language-c/versions/0.60.3/tarball",
|
||||
"language-clojure": "https://www.atom.io/api/packages/language-clojure/versions/0.22.7/tarball",
|
||||
"language-coffee-script": "https://www.atom.io/api/packages/language-coffee-script/versions/0.49.3/tarball",
|
||||
"language-csharp": "https://www.atom.io/api/packages/language-csharp/versions/1.0.4/tarball",
|
||||
"language-css": "https://www.atom.io/api/packages/language-css/versions/0.42.11/tarball",
|
||||
"language-gfm": "https://www.atom.io/api/packages/language-gfm/versions/0.90.5/tarball",
|
||||
"language-git": "https://www.atom.io/api/packages/language-git/versions/0.19.1/tarball",
|
||||
"language-go": "https://www.atom.io/api/packages/language-go/versions/0.46.0/tarball",
|
||||
"language-html": "https://www.atom.io/api/packages/language-html/versions/0.51.1/tarball",
|
||||
"language-go": "https://www.atom.io/api/packages/language-go/versions/0.46.2/tarball",
|
||||
"language-html": "https://www.atom.io/api/packages/language-html/versions/0.51.2/tarball",
|
||||
"language-hyperlink": "https://www.atom.io/api/packages/language-hyperlink/versions/0.16.3/tarball",
|
||||
"language-java": "https://www.atom.io/api/packages/language-java/versions/0.30.0/tarball",
|
||||
"language-javascript": "https://www.atom.io/api/packages/language-javascript/versions/0.129.1/tarball",
|
||||
"language-javascript": "https://www.atom.io/api/packages/language-javascript/versions/0.129.7/tarball",
|
||||
"language-json": "https://www.atom.io/api/packages/language-json/versions/0.19.2/tarball",
|
||||
"language-less": "https://www.atom.io/api/packages/language-less/versions/0.34.2/tarball",
|
||||
"language-make": "https://www.atom.io/api/packages/language-make/versions/0.22.3/tarball",
|
||||
@@ -99,26 +99,26 @@
|
||||
"language-perl": "https://www.atom.io/api/packages/language-perl/versions/0.38.1/tarball",
|
||||
"language-php": "https://www.atom.io/api/packages/language-php/versions/0.44.0/tarball",
|
||||
"language-property-list": "https://www.atom.io/api/packages/language-property-list/versions/0.9.1/tarball",
|
||||
"language-python": "https://www.atom.io/api/packages/language-python/versions/0.51.0/tarball",
|
||||
"language-ruby": "https://www.atom.io/api/packages/language-ruby/versions/0.72.2/tarball",
|
||||
"language-python": "https://www.atom.io/api/packages/language-python/versions/0.51.4/tarball",
|
||||
"language-ruby": "https://www.atom.io/api/packages/language-ruby/versions/0.72.4/tarball",
|
||||
"language-ruby-on-rails": "https://www.atom.io/api/packages/language-ruby-on-rails/versions/0.25.3/tarball",
|
||||
"language-sass": "https://www.atom.io/api/packages/language-sass/versions/0.62.0/tarball",
|
||||
"language-shellscript": "https://www.atom.io/api/packages/language-shellscript/versions/0.27.0/tarball",
|
||||
"language-shellscript": "https://www.atom.io/api/packages/language-shellscript/versions/0.27.4/tarball",
|
||||
"language-source": "https://www.atom.io/api/packages/language-source/versions/0.9.0/tarball",
|
||||
"language-sql": "https://www.atom.io/api/packages/language-sql/versions/0.25.10/tarball",
|
||||
"language-text": "https://www.atom.io/api/packages/language-text/versions/0.7.4/tarball",
|
||||
"language-todo": "https://www.atom.io/api/packages/language-todo/versions/0.29.4/tarball",
|
||||
"language-toml": "https://www.atom.io/api/packages/language-toml/versions/0.18.2/tarball",
|
||||
"language-typescript": "https://www.atom.io/api/packages/language-typescript/versions/0.4.0/tarball",
|
||||
"language-typescript": "https://www.atom.io/api/packages/language-typescript/versions/0.4.6/tarball",
|
||||
"language-xml": "https://www.atom.io/api/packages/language-xml/versions/0.35.2/tarball",
|
||||
"language-yaml": "https://www.atom.io/api/packages/language-yaml/versions/0.32.0/tarball",
|
||||
"less-cache": "1.1.0",
|
||||
"line-ending-selector": "https://www.atom.io/api/packages/line-ending-selector/versions/0.7.7/tarball",
|
||||
"line-top-index": "0.3.1",
|
||||
"link": "https://www.atom.io/api/packages/link/versions/0.31.4/tarball",
|
||||
"markdown-preview": "https://www.atom.io/api/packages/markdown-preview/versions/0.159.20/tarball",
|
||||
"markdown-preview": "https://www.atom.io/api/packages/markdown-preview/versions/0.159.21/tarball",
|
||||
"marked": "^0.3.12",
|
||||
"metrics": "https://www.atom.io/api/packages/metrics/versions/1.6.0/tarball",
|
||||
"metrics": "https://www.atom.io/api/packages/metrics/versions/1.6.1/tarball",
|
||||
"minimatch": "^3.0.3",
|
||||
"mocha": "2.5.1",
|
||||
"mocha-junit-reporter": "^1.13.0",
|
||||
@@ -148,19 +148,19 @@
|
||||
"service-hub": "^0.7.4",
|
||||
"settings-view": "https://www.atom.io/api/packages/settings-view/versions/0.255.0/tarball",
|
||||
"sinon": "1.17.4",
|
||||
"snippets": "https://www.atom.io/api/packages/snippets/versions/1.3.3/tarball",
|
||||
"snippets": "https://www.atom.io/api/packages/snippets/versions/1.3.5/tarball",
|
||||
"solarized-dark-syntax": "https://www.atom.io/api/packages/solarized-dark-syntax/versions/1.1.5/tarball",
|
||||
"solarized-light-syntax": "https://www.atom.io/api/packages/solarized-light-syntax/versions/1.1.5/tarball",
|
||||
"spell-check": "https://www.atom.io/api/packages/spell-check/versions/0.74.0/tarball",
|
||||
"status-bar": "https://www.atom.io/api/packages/status-bar/versions/1.8.15/tarball",
|
||||
"styleguide": "https://www.atom.io/api/packages/styleguide/versions/0.49.11/tarball",
|
||||
"styleguide": "https://www.atom.io/api/packages/styleguide/versions/0.49.12/tarball",
|
||||
"symbols-view": "https://www.atom.io/api/packages/symbols-view/versions/0.118.2/tarball",
|
||||
"tabs": "https://www.atom.io/api/packages/tabs/versions/0.109.2/tarball",
|
||||
"temp": "^0.8.3",
|
||||
"text-buffer": "13.14.5",
|
||||
"text-buffer": "13.14.6",
|
||||
"timecop": "https://www.atom.io/api/packages/timecop/versions/0.36.2/tarball",
|
||||
"tree-sitter": "0.13.2",
|
||||
"tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.222.0/tarball",
|
||||
"tree-sitter": "0.13.6",
|
||||
"tree-view": "https://www.atom.io/api/packages/tree-view/versions/0.224.2/tarball",
|
||||
"typescript-simple": "1.0.0",
|
||||
"underscore-plus": "^1.6.8",
|
||||
"update-package-dependencies": "https://www.atom.io/api/packages/update-package-dependencies/versions/0.13.1/tarball",
|
||||
@@ -203,45 +203,45 @@
|
||||
"exception-reporting": "0.43.1",
|
||||
"find-and-replace": "0.215.12",
|
||||
"fuzzy-finder": "1.8.2",
|
||||
"github": "0.18.2",
|
||||
"github": "0.19.0",
|
||||
"git-diff": "1.3.9",
|
||||
"go-to-line": "0.33.0",
|
||||
"grammar-selector": "0.50.1",
|
||||
"image-view": "0.63.0",
|
||||
"image-view": "0.63.1",
|
||||
"incompatible-packages": "0.27.3",
|
||||
"keybinding-resolver": "0.38.2",
|
||||
"line-ending-selector": "0.7.7",
|
||||
"link": "0.31.4",
|
||||
"markdown-preview": "0.159.20",
|
||||
"metrics": "1.6.0",
|
||||
"markdown-preview": "0.159.21",
|
||||
"metrics": "1.6.1",
|
||||
"notifications": "0.70.5",
|
||||
"open-on-github": "1.3.1",
|
||||
"package-generator": "1.3.0",
|
||||
"settings-view": "0.255.0",
|
||||
"snippets": "1.3.3",
|
||||
"snippets": "1.3.5",
|
||||
"spell-check": "0.74.0",
|
||||
"status-bar": "1.8.15",
|
||||
"styleguide": "0.49.11",
|
||||
"styleguide": "0.49.12",
|
||||
"symbols-view": "0.118.2",
|
||||
"tabs": "0.109.2",
|
||||
"timecop": "0.36.2",
|
||||
"tree-view": "0.222.0",
|
||||
"tree-view": "0.224.2",
|
||||
"update-package-dependencies": "0.13.1",
|
||||
"welcome": "0.36.6",
|
||||
"whitespace": "0.37.6",
|
||||
"wrap-guide": "0.40.3",
|
||||
"language-c": "0.60.0",
|
||||
"language-c": "0.60.3",
|
||||
"language-clojure": "0.22.7",
|
||||
"language-coffee-script": "0.49.3",
|
||||
"language-csharp": "1.0.4",
|
||||
"language-css": "0.42.11",
|
||||
"language-gfm": "0.90.5",
|
||||
"language-git": "0.19.1",
|
||||
"language-go": "0.46.0",
|
||||
"language-html": "0.51.1",
|
||||
"language-go": "0.46.2",
|
||||
"language-html": "0.51.2",
|
||||
"language-hyperlink": "0.16.3",
|
||||
"language-java": "0.30.0",
|
||||
"language-javascript": "0.129.1",
|
||||
"language-javascript": "0.129.7",
|
||||
"language-json": "0.19.2",
|
||||
"language-less": "0.34.2",
|
||||
"language-make": "0.22.3",
|
||||
@@ -250,17 +250,17 @@
|
||||
"language-perl": "0.38.1",
|
||||
"language-php": "0.44.0",
|
||||
"language-property-list": "0.9.1",
|
||||
"language-python": "0.51.1",
|
||||
"language-ruby": "0.72.2",
|
||||
"language-python": "0.51.4",
|
||||
"language-ruby": "0.72.4",
|
||||
"language-ruby-on-rails": "0.25.3",
|
||||
"language-sass": "0.62.0",
|
||||
"language-shellscript": "0.27.0",
|
||||
"language-shellscript": "0.27.4",
|
||||
"language-source": "0.9.0",
|
||||
"language-sql": "0.25.10",
|
||||
"language-text": "0.7.4",
|
||||
"language-todo": "0.29.4",
|
||||
"language-toml": "0.18.2",
|
||||
"language-typescript": "0.4.0",
|
||||
"language-typescript": "0.4.6",
|
||||
"language-xml": "0.35.2",
|
||||
"language-yaml": "0.32.0"
|
||||
},
|
||||
|
||||
@@ -17,6 +17,14 @@ process.on('unhandledRejection', function (e) {
|
||||
process.exit(1)
|
||||
})
|
||||
|
||||
// We can't use yargs until installScriptDependencies() is executed, so...
|
||||
let ci = process.argv.indexOf('--ci') !== -1
|
||||
|
||||
if (!ci && process.env.CI === 'true' && process.argv.indexOf('--no-ci') === -1) {
|
||||
console.log('Automatically enabling --ci because CI is set in the environment')
|
||||
ci = true
|
||||
}
|
||||
|
||||
verifyMachineRequirements()
|
||||
|
||||
if (dependenciesFingerprint.isOutdated()) {
|
||||
@@ -25,13 +33,13 @@ if (dependenciesFingerprint.isOutdated()) {
|
||||
|
||||
if (process.platform === 'win32') deleteMsbuildFromPath()
|
||||
|
||||
installScriptDependencies()
|
||||
installApm()
|
||||
installScriptDependencies(ci)
|
||||
installApm(ci)
|
||||
childProcess.execFileSync(
|
||||
CONFIG.getApmBinPath(),
|
||||
['--version'],
|
||||
{stdio: 'inherit'}
|
||||
)
|
||||
runApmInstall(CONFIG.repositoryRootPath)
|
||||
runApmInstall(CONFIG.repositoryRootPath, ci)
|
||||
|
||||
dependenciesFingerprint.write()
|
||||
|
||||
@@ -24,6 +24,7 @@ const argv = yargs
|
||||
.describe('generate-api-docs', 'Only build the API documentation')
|
||||
.describe('install', 'Install Atom')
|
||||
.string('install')
|
||||
.describe('ci', 'Install dependencies quickly (package-lock.json files must be up to date)')
|
||||
.wrap(yargs.terminalWidth())
|
||||
.argv
|
||||
|
||||
|
||||
@@ -76,8 +76,8 @@ function getApmBinPath () {
|
||||
return path.join(apmRootPath, 'node_modules', 'atom-package-manager', 'bin', apmBinName)
|
||||
}
|
||||
|
||||
function getNpmBinPath () {
|
||||
function getNpmBinPath (external = false) {
|
||||
const npmBinName = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
||||
const localNpmBinPath = path.resolve(repositoryRootPath, 'script', 'node_modules', '.bin', npmBinName)
|
||||
return fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName
|
||||
return !external && fs.existsSync(localNpmBinPath) ? localNpmBinPath : npmBinName
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ const EXCLUDE_REGEXPS_SOURCES = [
|
||||
escapeRegExp('.pairs'),
|
||||
escapeRegExp('.travis.yml'),
|
||||
escapeRegExp('appveyor.yml'),
|
||||
escapeRegExp('circle.yml'),
|
||||
escapeRegExp('.idea'),
|
||||
escapeRegExp('.editorconfig'),
|
||||
escapeRegExp('.lint'),
|
||||
@@ -69,7 +68,6 @@ const EXCLUDE_REGEXPS_SOURCES = [
|
||||
// Ignore node_module files we won't need at runtime
|
||||
'node_modules' + escapeRegExp(path.sep) + '.*' + escapeRegExp(path.sep) + '_*te?sts?_*' + escapeRegExp(path.sep),
|
||||
'node_modules' + escapeRegExp(path.sep) + '.*' + escapeRegExp(path.sep) + 'examples?' + escapeRegExp(path.sep),
|
||||
'node_modules' + escapeRegExp(path.sep) + '.*' + '\\.md$',
|
||||
'node_modules' + escapeRegExp(path.sep) + '.*' + '\\.d\\.ts$',
|
||||
'node_modules' + escapeRegExp(path.sep) + '.*' + '\\.js\\.map$',
|
||||
'.*' + escapeRegExp(path.sep) + 'test.*\\.html$'
|
||||
|
||||
@@ -4,8 +4,9 @@ const childProcess = require('child_process')
|
||||
|
||||
const CONFIG = require('../config')
|
||||
|
||||
module.exports = function () {
|
||||
module.exports = function (ci) {
|
||||
console.log('Installing apm')
|
||||
// npm ci leaves apm with a bunch of unmet dependencies
|
||||
childProcess.execFileSync(
|
||||
CONFIG.getNpmBinPath(),
|
||||
['--global-style', '--loglevel=error', 'install'],
|
||||
|
||||
@@ -4,11 +4,11 @@ const childProcess = require('child_process')
|
||||
|
||||
const CONFIG = require('../config')
|
||||
|
||||
module.exports = function () {
|
||||
module.exports = function (ci) {
|
||||
console.log('Installing script dependencies')
|
||||
childProcess.execFileSync(
|
||||
CONFIG.getNpmBinPath(),
|
||||
['--loglevel=error', 'install'],
|
||||
CONFIG.getNpmBinPath(ci),
|
||||
['--loglevel=error', ci ? 'ci' : 'install'],
|
||||
{env: process.env, cwd: CONFIG.scriptRootPath}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ const childProcess = require('child_process')
|
||||
|
||||
const CONFIG = require('../config')
|
||||
|
||||
module.exports = function (packagePath) {
|
||||
module.exports = function (packagePath, ci) {
|
||||
const installEnv = Object.assign({}, process.env)
|
||||
// Set resource path so that apm can load metadata related to Atom.
|
||||
installEnv.ATOM_RESOURCE_PATH = CONFIG.repositoryRootPath
|
||||
@@ -13,7 +13,7 @@ module.exports = function (packagePath) {
|
||||
installEnv.npm_config_target = CONFIG.appMetadata.electronVersion
|
||||
childProcess.execFileSync(
|
||||
CONFIG.getApmBinPath(),
|
||||
['--loglevel=error', 'install'],
|
||||
['--loglevel=error', ci ? 'ci' : 'install'],
|
||||
{env: installEnv, cwd: packagePath, stdio: 'inherit'}
|
||||
)
|
||||
}
|
||||
|
||||
8258
script/package-lock.json
generated
8258
script/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@
|
||||
"minidump": "0.9.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"normalize-package-data": "2.3.5",
|
||||
"npm": "6.1.0",
|
||||
"npm": "6.2.0",
|
||||
"passwd-user": "2.1.0",
|
||||
"pegjs": "0.9.0",
|
||||
"publish-release": "^1.6.0",
|
||||
|
||||
@@ -13,40 +13,53 @@ const argv = yargs
|
||||
.usage('Usage: $0 [options]')
|
||||
.help('help')
|
||||
.describe('assets-path', 'Path to the folder where all release assets are stored')
|
||||
.describe('s3-path', 'Indicates the S3 path in which the assets should be uploaded')
|
||||
.describe('create-github-release', 'Creates a GitHub release for this build, draft if release branch or public if Nightly')
|
||||
.wrap(yargs.terminalWidth())
|
||||
.argv
|
||||
|
||||
let assetsPath = argv.assetsPath || path.join(CONFIG.repositoryRootPath, 'out')
|
||||
let assets = glob.sync(path.join(assetsPath, '*(*.exe|*.zip|*.nupkg|*.tar.gz|*.rpm|*.deb|RELEASES*)'))
|
||||
const assetsPath = argv.assetsPath || path.join(CONFIG.repositoryRootPath, 'out')
|
||||
const assetsPattern = '/**/*(*.exe|*.zip|*.nupkg|*.tar.gz|*.rpm|*.deb|RELEASES*|atom-api.json)'
|
||||
const assets = glob.sync(assetsPattern, { root: assetsPath, nodir: true })
|
||||
const bucketPath = argv.s3Path || `releases/v${CONFIG.computedAppVersion}/`
|
||||
|
||||
console.log(`Uploading release assets for ${CONFIG.computedAppVersion} to S3`)
|
||||
if (!assets || assets.length === 0) {
|
||||
console.error(`No assets found under specified path: ${assetsPath}`)
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
console.log(`Uploading ${assets.length} release assets for ${CONFIG.computedAppVersion} to S3 under '${bucketPath}'`)
|
||||
|
||||
uploadToS3(
|
||||
process.env.ATOM_RELEASES_S3_KEY,
|
||||
process.env.ATOM_RELEASES_S3_SECRET,
|
||||
process.env.ATOM_RELEASES_S3_BUCKET,
|
||||
`releases/v${CONFIG.computedAppVersion}/`,
|
||||
bucketPath,
|
||||
assets).then(
|
||||
() => {
|
||||
console.log(`Publishing GitHub release ${CONFIG.computedAppVersion}`)
|
||||
publishRelease({
|
||||
token: process.env.GITHUB_TOKEN,
|
||||
owner: 'atom',
|
||||
repo: CONFIG.channel !== 'nightly' ? 'atom' : 'atom-nightly-releases',
|
||||
name: CONFIG.computedAppVersion,
|
||||
tag: `v${CONFIG.computedAppVersion}`,
|
||||
draft: false,
|
||||
prerelease: CONFIG.channel !== 'stable',
|
||||
reuseRelease: true,
|
||||
skipIfPublished: true,
|
||||
assets
|
||||
}, function (err, release) {
|
||||
if (err) {
|
||||
console.error("An error occurred while publishing the release:\n\n", err)
|
||||
} else {
|
||||
console.log("Release published successfully: ", release.html_url)
|
||||
}
|
||||
})
|
||||
if (argv.createGithubRelease) {
|
||||
console.log(`Creating GitHub release v${CONFIG.computedAppVersion}`)
|
||||
publishRelease({
|
||||
token: process.env.GITHUB_TOKEN,
|
||||
owner: 'atom',
|
||||
repo: CONFIG.channel !== 'nightly' ? 'atom' : 'atom-nightly-releases',
|
||||
name: CONFIG.computedAppVersion,
|
||||
tag: `v${CONFIG.computedAppVersion}`,
|
||||
draft: false,
|
||||
prerelease: CONFIG.channel !== 'stable',
|
||||
reuseRelease: true,
|
||||
skipIfPublished: true,
|
||||
assets
|
||||
}, function (err, release) {
|
||||
if (err) {
|
||||
console.error("An error occurred while publishing the release:\n\n", err)
|
||||
} else {
|
||||
console.log("Release published successfully: ", release.html_url)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log("Skipping GitHub release creation")
|
||||
}
|
||||
}).catch((err) => {
|
||||
console.error('An error occurred while uploading the release:', err)
|
||||
})
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
const path = require('path')
|
||||
const request = require('request-promise-native')
|
||||
|
||||
const repositoryRootPath = path.resolve(__dirname, '..', '..')
|
||||
const appMetadata = require(path.join(repositoryRootPath, 'package.json'))
|
||||
const baseVersion = appMetadata.version.split('-')[0]
|
||||
|
||||
async function generateNightlyVersion () {
|
||||
const releases = await request({
|
||||
url: 'https://api.github.com/repos/atom/atom-nightly-releases/releases',
|
||||
headers: {'Accept': 'application/vnd.github.v3+json', 'User-Agent': 'Atom Release Build'},
|
||||
json: true
|
||||
})
|
||||
|
||||
let releaseNumber = 0
|
||||
if (releases && releases.length > 0) {
|
||||
const latestRelease = releases.find(r => !r.draft)
|
||||
const versionMatch = latestRelease.tag_name.match(/^v?(\d+\.\d+\.\d+)-nightly(\d+)$/)
|
||||
|
||||
if (versionMatch && versionMatch[1] === baseVersion) {
|
||||
releaseNumber = parseInt(versionMatch[2]) + 1
|
||||
}
|
||||
}
|
||||
|
||||
// Set our ReleaseVersion build variable and update VSTS' build number to
|
||||
// include the version. Writing these strings to stdout causes VSTS to set
|
||||
// the associated variables.
|
||||
const generatedVersion = `${baseVersion}-nightly${releaseNumber}`
|
||||
console.log(`##vso[task.setvariable variable=ReleaseVersion;isOutput=true]${generatedVersion}`)
|
||||
console.log(`##vso[build.updatebuildnumber]${generatedVersion}+${process.env.BUILD_BUILDNUMBER}`)
|
||||
}
|
||||
|
||||
generateNightlyVersion()
|
||||
59
script/vsts/get-release-version.js
Normal file
59
script/vsts/get-release-version.js
Normal file
@@ -0,0 +1,59 @@
|
||||
const path = require('path')
|
||||
const request = require('request-promise-native')
|
||||
|
||||
const repositoryRootPath = path.resolve(__dirname, '..', '..')
|
||||
const appMetadata = require(path.join(repositoryRootPath, 'package.json'))
|
||||
|
||||
const yargs = require('yargs')
|
||||
const argv = yargs
|
||||
.usage('Usage: $0 [options]')
|
||||
.help('help')
|
||||
.describe('nightly', 'Indicates that a nightly version should be produced')
|
||||
.wrap(yargs.terminalWidth())
|
||||
.argv
|
||||
|
||||
async function getReleaseVersion () {
|
||||
let releaseVersion = appMetadata.version
|
||||
if (argv.nightly) {
|
||||
const releases = await request({
|
||||
url: 'https://api.github.com/repos/atom/atom-nightly-releases/releases',
|
||||
headers: {'Accept': 'application/vnd.github.v3+json', 'User-Agent': 'Atom Release Build'},
|
||||
json: true
|
||||
})
|
||||
|
||||
let releaseNumber = 0
|
||||
const baseVersion = appMetadata.version.split('-')[0]
|
||||
if (releases && releases.length > 0) {
|
||||
const latestRelease = releases.find(r => !r.draft)
|
||||
const versionMatch = latestRelease.tag_name.match(/^v?(\d+\.\d+\.\d+)-nightly(\d+)$/)
|
||||
|
||||
if (versionMatch && versionMatch[1] === baseVersion) {
|
||||
releaseNumber = parseInt(versionMatch[2]) + 1
|
||||
}
|
||||
}
|
||||
|
||||
releaseVersion = `${baseVersion}-nightly${releaseNumber}`
|
||||
}
|
||||
|
||||
// Set our ReleaseVersion build variable and update VSTS' build number to
|
||||
// include the version. Writing these strings to stdout causes VSTS to set
|
||||
// the associated variables.
|
||||
console.log(`##vso[task.setvariable variable=ReleaseVersion;isOutput=true]${releaseVersion}`)
|
||||
if (!process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) {
|
||||
// Only set the build number on non-PR builds as it causes build errors when
|
||||
// non-admins send PRs to the repo
|
||||
console.log(`##vso[build.updatebuildnumber]${releaseVersion}+${process.env.BUILD_BUILDNUMBER}`)
|
||||
}
|
||||
|
||||
// Write out some variables that indicate whether artifacts should be uploaded
|
||||
const buildBranch = process.env.BUILD_SOURCEBRANCHNAME
|
||||
const isReleaseBranch = process.env.IS_RELEASE_BRANCH || argv.nightly || buildBranch.match(/\d\.\d+-releases/) !== null
|
||||
const isSignedZipBranch =
|
||||
process.env.IS_SIGNED_ZIP_BRANCH ||
|
||||
buildBranch.startsWith('electron-') ||
|
||||
buildBranch === 'master' && !process.env.SYSTEM_PULLREQUEST_PULLREQUESTNUMBER
|
||||
console.log(`##vso[task.setvariable variable=IsReleaseBranch;isOutput=true]${isReleaseBranch}`)
|
||||
console.log(`##vso[task.setvariable variable=IsSignedZipBranch;isOutput=true]${isSignedZipBranch}`)
|
||||
}
|
||||
|
||||
getReleaseVersion()
|
||||
@@ -1,55 +0,0 @@
|
||||
phases:
|
||||
- phase: macOS
|
||||
dependsOn: GetReleaseVersion
|
||||
variables:
|
||||
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
||||
queue:
|
||||
name: Hosted macOS Preview
|
||||
timeoutInMinutes: 180
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 8.9.3
|
||||
displayName: Install Node.js 8.9.3
|
||||
|
||||
- script: |
|
||||
script/build --code-sign --compress-artifacts
|
||||
displayName: Build Atom
|
||||
env:
|
||||
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
||||
ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL)
|
||||
ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: $(ATOM_MAC_CODE_SIGNING_CERT_PASSWORD)
|
||||
ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN)
|
||||
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD)
|
||||
|
||||
- script: script/lint
|
||||
displayName: Run linter
|
||||
|
||||
- script: |
|
||||
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
|
||||
caffeinate -s script/test # Run with caffeinate to prevent screen saver
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
displayName: Run tests
|
||||
|
||||
# This step is necessary in the short term due to a bug in the *NIX
|
||||
# implementation of the CopyFiles task which scans the entire file
|
||||
# system structure just to resolve the glob pattern.
|
||||
- script: rm -rf $(Build.SourcesDirectory)/out/*/
|
||||
displayName: Delete Intermediate Output
|
||||
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Build.SourcesDirectory)/out
|
||||
contents: '*.zip'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Stage Artifacts
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||
ArtifactName: Binaries
|
||||
ArtifactType: Container
|
||||
displayName: Upload Artifacts
|
||||
@@ -8,13 +8,13 @@ phases:
|
||||
cd script\vsts
|
||||
npm install
|
||||
displayName: npm install
|
||||
- script: node script\vsts\generate-version.js
|
||||
- script: node script\vsts\get-release-version.js --nightly
|
||||
name: Version
|
||||
|
||||
# Import OS-specific build definitions
|
||||
- template: windows.yml
|
||||
- template: macos.yml
|
||||
- template: linux.yml
|
||||
- template: platforms/windows.yml
|
||||
- template: platforms/macos.yml
|
||||
- template: platforms/linux.yml
|
||||
|
||||
- phase: Release
|
||||
queue: Hosted # Need this for Python 2.7
|
||||
@@ -42,12 +42,13 @@ phases:
|
||||
displayName: npm install
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
displayName: Download Release Artifacts
|
||||
inputs:
|
||||
artifactName: Binaries
|
||||
itemPattern: '**'
|
||||
downloadType: 'specific'
|
||||
displayName: Download Release Artifacts
|
||||
|
||||
- script: |
|
||||
$(Build.SourcesDirectory)\script\publish-release.cmd --assets-path "$(System.ArtifactsDirectory)/Binaries"
|
||||
$(Build.SourcesDirectory)\script\publish-release.cmd --create-github-release --assets-path "$(System.ArtifactsDirectory)"
|
||||
env:
|
||||
GITHUB_TOKEN: $(GITHUB_TOKEN)
|
||||
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
||||
|
||||
347
script/vsts/package-lock.json
generated
347
script/vsts/package-lock.json
generated
@@ -14,6 +14,11 @@
|
||||
"json-schema-traverse": "0.3.1"
|
||||
}
|
||||
},
|
||||
"ansi-regex": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
||||
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8="
|
||||
},
|
||||
"asn1": {
|
||||
"version": "0.2.3",
|
||||
"resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
|
||||
@@ -48,16 +53,41 @@
|
||||
"tweetnacl": "0.14.5"
|
||||
}
|
||||
},
|
||||
"builtin-modules": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
|
||||
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8="
|
||||
},
|
||||
"camelcase": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
|
||||
"integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo="
|
||||
},
|
||||
"caseless": {
|
||||
"version": "0.12.0",
|
||||
"resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
|
||||
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw="
|
||||
},
|
||||
"cliui": {
|
||||
"version": "3.2.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
|
||||
"integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=",
|
||||
"requires": {
|
||||
"string-width": "1.0.2",
|
||||
"strip-ansi": "3.0.1",
|
||||
"wrap-ansi": "2.1.0"
|
||||
}
|
||||
},
|
||||
"co": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
|
||||
"integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ="
|
||||
},
|
||||
"code-point-at": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz",
|
||||
@@ -79,6 +109,11 @@
|
||||
"assert-plus": "1.0.0"
|
||||
}
|
||||
},
|
||||
"decamelize": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
|
||||
"integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
@@ -93,6 +128,14 @@
|
||||
"jsbn": "0.1.1"
|
||||
}
|
||||
},
|
||||
"error-ex": {
|
||||
"version": "1.3.2",
|
||||
"resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
|
||||
"integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
|
||||
"requires": {
|
||||
"is-arrayish": "0.2.1"
|
||||
}
|
||||
},
|
||||
"extend": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz",
|
||||
@@ -113,6 +156,15 @@
|
||||
"resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz",
|
||||
"integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I="
|
||||
},
|
||||
"find-up": {
|
||||
"version": "1.1.2",
|
||||
"resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
|
||||
"integrity": "sha1-ay6YIrGizgpgq2TWEOzK1TyyTQ8=",
|
||||
"requires": {
|
||||
"path-exists": "2.1.0",
|
||||
"pinkie-promise": "2.0.1"
|
||||
}
|
||||
},
|
||||
"forever-agent": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
|
||||
@@ -128,6 +180,11 @@
|
||||
"mime-types": "2.1.18"
|
||||
}
|
||||
},
|
||||
"get-caller-file": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
|
||||
"integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
|
||||
},
|
||||
"getpass": {
|
||||
"version": "0.1.7",
|
||||
"resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
|
||||
@@ -136,6 +193,11 @@
|
||||
"assert-plus": "1.0.0"
|
||||
}
|
||||
},
|
||||
"graceful-fs": {
|
||||
"version": "4.1.11",
|
||||
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz",
|
||||
"integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg="
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
|
||||
@@ -150,6 +212,11 @@
|
||||
"har-schema": "2.0.0"
|
||||
}
|
||||
},
|
||||
"hosted-git-info": {
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
|
||||
"integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w=="
|
||||
},
|
||||
"http-signature": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
|
||||
@@ -160,11 +227,42 @@
|
||||
"sshpk": "1.14.2"
|
||||
}
|
||||
},
|
||||
"invert-kv": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
|
||||
"integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY="
|
||||
},
|
||||
"is-arrayish": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
|
||||
"integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0="
|
||||
},
|
||||
"is-builtin-module": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz",
|
||||
"integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=",
|
||||
"requires": {
|
||||
"builtin-modules": "1.1.1"
|
||||
}
|
||||
},
|
||||
"is-fullwidth-code-point": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
||||
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
|
||||
"requires": {
|
||||
"number-is-nan": "1.0.1"
|
||||
}
|
||||
},
|
||||
"is-typedarray": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
|
||||
"integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo="
|
||||
},
|
||||
"is-utf8": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
|
||||
"integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI="
|
||||
},
|
||||
"isstream": {
|
||||
"version": "0.1.2",
|
||||
"resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
|
||||
@@ -202,11 +300,36 @@
|
||||
"verror": "1.10.0"
|
||||
}
|
||||
},
|
||||
"lcid": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
|
||||
"integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=",
|
||||
"requires": {
|
||||
"invert-kv": "1.0.0"
|
||||
}
|
||||
},
|
||||
"load-json-file": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
|
||||
"integrity": "sha1-lWkFcI1YtLq0wiYbBPWfMcmTdMA=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11",
|
||||
"parse-json": "2.2.0",
|
||||
"pify": "2.3.0",
|
||||
"pinkie-promise": "2.0.1",
|
||||
"strip-bom": "2.0.0"
|
||||
}
|
||||
},
|
||||
"lodash": {
|
||||
"version": "4.17.10",
|
||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz",
|
||||
"integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg=="
|
||||
},
|
||||
"lodash.assign": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz",
|
||||
"integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.33.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz",
|
||||
@@ -220,16 +343,84 @@
|
||||
"mime-db": "1.33.0"
|
||||
}
|
||||
},
|
||||
"normalize-package-data": {
|
||||
"version": "2.4.0",
|
||||
"resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz",
|
||||
"integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==",
|
||||
"requires": {
|
||||
"hosted-git-info": "2.7.1",
|
||||
"is-builtin-module": "1.0.0",
|
||||
"semver": "5.5.0",
|
||||
"validate-npm-package-license": "3.0.3"
|
||||
}
|
||||
},
|
||||
"number-is-nan": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
||||
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0="
|
||||
},
|
||||
"oauth-sign": {
|
||||
"version": "0.8.2",
|
||||
"resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz",
|
||||
"integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM="
|
||||
},
|
||||
"os-locale": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
|
||||
"integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=",
|
||||
"requires": {
|
||||
"lcid": "1.0.0"
|
||||
}
|
||||
},
|
||||
"parse-json": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
|
||||
"integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=",
|
||||
"requires": {
|
||||
"error-ex": "1.3.2"
|
||||
}
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
|
||||
"integrity": "sha1-D+tsZPD8UY2adU3V77YscCJ2H0s=",
|
||||
"requires": {
|
||||
"pinkie-promise": "2.0.1"
|
||||
}
|
||||
},
|
||||
"path-type": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
|
||||
"integrity": "sha1-WcRPfuSR2nBNpBXaWkBwuk+P5EE=",
|
||||
"requires": {
|
||||
"graceful-fs": "4.1.11",
|
||||
"pify": "2.3.0",
|
||||
"pinkie-promise": "2.0.1"
|
||||
}
|
||||
},
|
||||
"performance-now": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
|
||||
"integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns="
|
||||
},
|
||||
"pify": {
|
||||
"version": "2.3.0",
|
||||
"resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
|
||||
"integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw="
|
||||
},
|
||||
"pinkie": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
|
||||
"integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA="
|
||||
},
|
||||
"pinkie-promise": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
|
||||
"integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=",
|
||||
"requires": {
|
||||
"pinkie": "2.0.4"
|
||||
}
|
||||
},
|
||||
"punycode": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
|
||||
@@ -240,6 +431,25 @@
|
||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
|
||||
"integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
|
||||
},
|
||||
"read-pkg": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
|
||||
"integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=",
|
||||
"requires": {
|
||||
"load-json-file": "1.1.0",
|
||||
"normalize-package-data": "2.4.0",
|
||||
"path-type": "1.1.0"
|
||||
}
|
||||
},
|
||||
"read-pkg-up": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
|
||||
"integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=",
|
||||
"requires": {
|
||||
"find-up": "1.1.2",
|
||||
"read-pkg": "1.1.0"
|
||||
}
|
||||
},
|
||||
"request": {
|
||||
"version": "2.87.0",
|
||||
"resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz",
|
||||
@@ -285,6 +495,16 @@
|
||||
"tough-cookie": "2.3.4"
|
||||
}
|
||||
},
|
||||
"require-directory": {
|
||||
"version": "2.1.1",
|
||||
"resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
|
||||
"integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I="
|
||||
},
|
||||
"require-main-filename": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
|
||||
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE="
|
||||
},
|
||||
"safe-buffer": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
|
||||
@@ -295,6 +515,44 @@
|
||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
||||
},
|
||||
"semver": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz",
|
||||
"integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA=="
|
||||
},
|
||||
"set-blocking": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||
},
|
||||
"spdx-correct": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
|
||||
"integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==",
|
||||
"requires": {
|
||||
"spdx-expression-parse": "3.0.0",
|
||||
"spdx-license-ids": "3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-exceptions": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz",
|
||||
"integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg=="
|
||||
},
|
||||
"spdx-expression-parse": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz",
|
||||
"integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==",
|
||||
"requires": {
|
||||
"spdx-exceptions": "2.1.0",
|
||||
"spdx-license-ids": "3.0.0"
|
||||
}
|
||||
},
|
||||
"spdx-license-ids": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz",
|
||||
"integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA=="
|
||||
},
|
||||
"sshpk": {
|
||||
"version": "1.14.2",
|
||||
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz",
|
||||
@@ -316,6 +574,32 @@
|
||||
"resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
|
||||
"integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks="
|
||||
},
|
||||
"string-width": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
|
||||
"requires": {
|
||||
"code-point-at": "1.1.0",
|
||||
"is-fullwidth-code-point": "1.0.0",
|
||||
"strip-ansi": "3.0.1"
|
||||
}
|
||||
},
|
||||
"strip-ansi": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
|
||||
"requires": {
|
||||
"ansi-regex": "2.1.1"
|
||||
}
|
||||
},
|
||||
"strip-bom": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
|
||||
"integrity": "sha1-YhmoVhZSBJHzV4i9vxRHqZx+aw4=",
|
||||
"requires": {
|
||||
"is-utf8": "0.2.1"
|
||||
}
|
||||
},
|
||||
"tough-cookie": {
|
||||
"version": "2.3.4",
|
||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz",
|
||||
@@ -343,6 +627,15 @@
|
||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.0.tgz",
|
||||
"integrity": "sha512-ijO9N2xY/YaOqQ5yz5c4sy2ZjWmA6AR6zASb/gdpeKZ8+948CxwfMW9RrKVk5may6ev8c0/Xguu32e2Llelpqw=="
|
||||
},
|
||||
"validate-npm-package-license": {
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz",
|
||||
"integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==",
|
||||
"requires": {
|
||||
"spdx-correct": "3.0.0",
|
||||
"spdx-expression-parse": "3.0.0"
|
||||
}
|
||||
},
|
||||
"verror": {
|
||||
"version": "1.10.0",
|
||||
"resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
|
||||
@@ -352,6 +645,60 @@
|
||||
"core-util-is": "1.0.2",
|
||||
"extsprintf": "1.3.0"
|
||||
}
|
||||
},
|
||||
"which-module": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
|
||||
"integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8="
|
||||
},
|
||||
"window-size": {
|
||||
"version": "0.2.0",
|
||||
"resolved": "https://registry.npmjs.org/window-size/-/window-size-0.2.0.tgz",
|
||||
"integrity": "sha1-tDFbtCFKPXBY6+7okuE/ok2YsHU="
|
||||
},
|
||||
"wrap-ansi": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
|
||||
"integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=",
|
||||
"requires": {
|
||||
"string-width": "1.0.2",
|
||||
"strip-ansi": "3.0.1"
|
||||
}
|
||||
},
|
||||
"y18n": {
|
||||
"version": "3.2.1",
|
||||
"resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz",
|
||||
"integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE="
|
||||
},
|
||||
"yargs": {
|
||||
"version": "4.8.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs/-/yargs-4.8.1.tgz",
|
||||
"integrity": "sha1-wMQpJMpKqmsObaFznfshZDn53cA=",
|
||||
"requires": {
|
||||
"cliui": "3.2.0",
|
||||
"decamelize": "1.2.0",
|
||||
"get-caller-file": "1.0.3",
|
||||
"lodash.assign": "4.2.0",
|
||||
"os-locale": "1.4.0",
|
||||
"read-pkg-up": "1.0.1",
|
||||
"require-directory": "2.1.1",
|
||||
"require-main-filename": "1.0.1",
|
||||
"set-blocking": "2.0.0",
|
||||
"string-width": "1.0.2",
|
||||
"which-module": "1.0.0",
|
||||
"window-size": "0.2.0",
|
||||
"y18n": "3.2.1",
|
||||
"yargs-parser": "2.4.1"
|
||||
}
|
||||
},
|
||||
"yargs-parser": {
|
||||
"version": "2.4.1",
|
||||
"resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-2.4.1.tgz",
|
||||
"integrity": "sha1-hVaN488VD/SfpRgl8DqMiA3cxcQ=",
|
||||
"requires": {
|
||||
"camelcase": "3.0.0",
|
||||
"lodash.assign": "4.2.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
"description": "Atom release scripts",
|
||||
"dependencies": {
|
||||
"request": "^2.87.0",
|
||||
"request-promise-native": "^1.0.5"
|
||||
"request-promise-native": "^1.0.5",
|
||||
"yargs": "4.8.1"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,9 @@ phases:
|
||||
versionSpec: 8.9.3
|
||||
displayName: Install Node.js 8.9.3
|
||||
|
||||
- script: npm install --global npm@6.2.0
|
||||
displayName: Update npm
|
||||
|
||||
- script: |
|
||||
apt-get update
|
||||
apt-get install -y --no-install-recommends build-essential xvfb clang-3.5 fakeroot git libsecret-1-dev rpm libx11-dev libxkbfile-dev xz-utils xorriso zsync libxss1 libgconf2-4 libgtk-3-0
|
||||
@@ -36,23 +39,25 @@ phases:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
displayName: Run tests
|
||||
|
||||
# This step is necessary in the short term due to a bug in the *NIX
|
||||
# implementation of the CopyFiles task which scans the entire file
|
||||
# system structure just to resolve the glob pattern.
|
||||
- script: rm -rf $(Build.SourcesDirectory)/out/*/
|
||||
displayName: Delete Intermediate Output
|
||||
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Build.SourcesDirectory)/out
|
||||
contents: '?(*.deb|*.rpm|*.tar.gz)'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Stage Artifacts
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||
ArtifactName: Binaries
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/atom.x86_64.rpm
|
||||
ArtifactName: atom.x86_64.rpm
|
||||
ArtifactType: Container
|
||||
displayName: Upload Artifacts
|
||||
displayName: Upload atom.x84_64.rpm
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/atom-amd64.deb
|
||||
ArtifactName: atom-amd64.deb
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-amd64.deb
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/atom-amd64.tar.gz
|
||||
ArtifactName: atom-amd64.tar.gz
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-amd64.tar.gz
|
||||
72
script/vsts/platforms/macos.yml
Normal file
72
script/vsts/platforms/macos.yml
Normal file
@@ -0,0 +1,72 @@
|
||||
phases:
|
||||
- phase: macOS
|
||||
dependsOn: GetReleaseVersion
|
||||
variables:
|
||||
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
||||
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
|
||||
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
|
||||
queue:
|
||||
name: Hosted macOS Preview
|
||||
timeoutInMinutes: 180
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 8.9.3
|
||||
displayName: Install Node.js 8.9.3
|
||||
|
||||
- script: npm install --global npm@6.2.0
|
||||
displayName: Update npm
|
||||
|
||||
- script: |
|
||||
if [ $IS_RELEASE_BRANCH == "true" ] || [ $IS_SIGNED_ZIP_BRANCH == "true" ]; then
|
||||
script/build --code-sign --compress-artifacts
|
||||
else
|
||||
script/build --compress-artifacts
|
||||
fi
|
||||
displayName: Build Atom
|
||||
env:
|
||||
IS_RELEASE_BRANCH: $(IsReleaseBranch)
|
||||
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
|
||||
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
||||
ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_MAC_CODE_SIGNING_CERT_DOWNLOAD_URL)
|
||||
ATOM_MAC_CODE_SIGNING_CERT_PASSWORD: $(ATOM_MAC_CODE_SIGNING_CERT_PASSWORD)
|
||||
ATOM_MAC_CODE_SIGNING_KEYCHAIN: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN)
|
||||
ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD: $(ATOM_MAC_CODE_SIGNING_KEYCHAIN_PASSWORD)
|
||||
|
||||
- script: script/lint
|
||||
displayName: Run linter
|
||||
|
||||
- script: |
|
||||
osascript -e 'tell application "System Events" to keystroke "x"' # clear screen saver
|
||||
caffeinate -s script/test # Run with caffeinate to prevent screen saver
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
displayName: Run tests
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
||||
- script: |
|
||||
cp $(Build.SourcesDirectory)/out/*.zip $(Build.ArtifactStagingDirectory)
|
||||
displayName: Stage Artifacts
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac.zip
|
||||
ArtifactName: atom-mac.zip
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-mac.zip
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)/atom-mac-symbols.zip
|
||||
ArtifactName: atom-mac-symbols.zip
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-mac-symbols.zip
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/docs/output/atom-api.json
|
||||
ArtifactName: atom-api.json
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-api.json
|
||||
93
script/vsts/platforms/windows.yml
Normal file
93
script/vsts/platforms/windows.yml
Normal file
@@ -0,0 +1,93 @@
|
||||
phases:
|
||||
- phase: Windows
|
||||
dependsOn: GetReleaseVersion
|
||||
variables:
|
||||
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
||||
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
|
||||
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
|
||||
queue:
|
||||
name: Hosted
|
||||
timeoutInMinutes: 180
|
||||
parallel: 2
|
||||
matrix:
|
||||
x64:
|
||||
buildArch: x64
|
||||
# TODO: x86 is currently not supported on VSTS
|
||||
# x86:
|
||||
# buildArch: x86
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 8.9.3
|
||||
displayName: Install Node.js 8.9.3
|
||||
|
||||
- script: |
|
||||
ECHO Installing npm-windows-upgrade
|
||||
npm install --global --production npm-windows-upgrade
|
||||
ECHO Upgrading npm
|
||||
npm-windows-upgrade --no-spinner --no-prompt --npm-version 6.2.0
|
||||
|
||||
- script: |
|
||||
IF NOT EXIST C:\tmp MKDIR C:\tmp
|
||||
SET SQUIRREL_TEMP=C:\tmp
|
||||
IF [%IS_RELEASE_BRANCH%]==[true] (
|
||||
ECHO Creating production artifacts for release branch %BUILD_SOURCEBRANCHNAME%
|
||||
script\build.cmd --code-sign --compress-artifacts --create-windows-installer
|
||||
) ELSE (
|
||||
IF [%IS_SIGNED_ZIP_BRANCH%]==[true] (
|
||||
ECHO Creating signed CI artifacts for branch %BUILD_SOURCEBRANCHNAME%
|
||||
script\build.cmd --code-sign --compress-artifacts
|
||||
) ELSE (
|
||||
ECHO Pull request build, no code signing will be performed
|
||||
script\build.cmd --compress-artifacts
|
||||
)
|
||||
)
|
||||
env:
|
||||
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
||||
ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL)
|
||||
ATOM_WIN_CODE_SIGNING_CERT_PASSWORD: $(ATOM_WIN_CODE_SIGNING_CERT_PASSWORD)
|
||||
IS_RELEASE_BRANCH: $(IsReleaseBranch)
|
||||
IS_SIGNED_ZIP_BRANCH: $(IsSignedZipBranch)
|
||||
displayName: Build Atom
|
||||
|
||||
- script: script\lint.cmd
|
||||
displayName: Run linter
|
||||
|
||||
- script: script\test.cmd
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
displayName: Run tests
|
||||
condition: and(succeeded(), ne(variables['Atom.SkipTests'], 'true'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-windows.zip
|
||||
ArtifactName: atom-x64-windows.zip
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-x64-windows.zip
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/AtomSetup-x64.exe
|
||||
ArtifactName: AtomSetup-x64.exe
|
||||
ArtifactType: Container
|
||||
displayName: Upload AtomSetup-x64.exe
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/atom-x64-$(ReleaseVersion)-full.nupkg
|
||||
ArtifactName: atom-x64-$(ReleaseVersion)-full.nupkg
|
||||
ArtifactType: Container
|
||||
displayName: Upload atom-x64-$(ReleaseVersion)-full.nupkg
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.SourcesDirectory)/out/RELEASES-x64
|
||||
ArtifactName: RELEASES-x64
|
||||
ArtifactType: Container
|
||||
displayName: Upload RELEASES-x64
|
||||
condition: and(succeeded(), eq(variables['IsReleaseBranch'], 'true'))
|
||||
19
script/vsts/pull-requests.yml
Normal file
19
script/vsts/pull-requests.yml
Normal file
@@ -0,0 +1,19 @@
|
||||
trigger: none # No CI builds, only PR builds
|
||||
|
||||
phases:
|
||||
|
||||
- phase: GetReleaseVersion
|
||||
steps:
|
||||
# This has to be done separately because VSTS inexplicably
|
||||
# exits the script block after `npm install` completes.
|
||||
- script: |
|
||||
cd script\vsts
|
||||
npm install
|
||||
displayName: npm install
|
||||
- script: node script\vsts\get-release-version.js
|
||||
name: Version
|
||||
|
||||
# Import OS-specific build definitions
|
||||
- template: platforms/windows.yml
|
||||
- template: platforms/macos.yml
|
||||
- template: platforms/linux.yml
|
||||
64
script/vsts/release-branch-build.yml
Normal file
64
script/vsts/release-branch-build.yml
Normal file
@@ -0,0 +1,64 @@
|
||||
trigger:
|
||||
- master
|
||||
- 1.* # VSTS only supports wildcards at the end
|
||||
|
||||
phases:
|
||||
|
||||
- phase: GetReleaseVersion
|
||||
steps:
|
||||
# This has to be done separately because VSTS inexplicably
|
||||
# exits the script block after `npm install` completes.
|
||||
- script: |
|
||||
cd script\vsts
|
||||
npm install
|
||||
displayName: npm install
|
||||
- script: node script\vsts\get-release-version.js
|
||||
name: Version
|
||||
|
||||
# Import OS-specific build definitions
|
||||
- template: platforms/windows.yml
|
||||
- template: platforms/macos.yml
|
||||
- template: platforms/linux.yml
|
||||
|
||||
- phase: UploadArtifacts
|
||||
queue: Hosted # Need this for Python 2.7
|
||||
|
||||
dependsOn:
|
||||
- GetReleaseVersion
|
||||
- Windows
|
||||
- Linux
|
||||
- macOS
|
||||
|
||||
variables:
|
||||
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
||||
IsReleaseBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsReleaseBranch'] ]
|
||||
IsSignedZipBranch: $[ dependencies.GetReleaseVersion.outputs['Version.IsSignedZipBranch'] ]
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 8.9.3
|
||||
displayName: Install Node.js 8.9.3
|
||||
|
||||
# This has to be done separately because VSTS inexplicably
|
||||
# exits the script block after `npm install` completes.
|
||||
- script: |
|
||||
cd script
|
||||
npm install
|
||||
displayName: npm install
|
||||
|
||||
- task: DownloadBuildArtifacts@0
|
||||
inputs:
|
||||
itemPattern: '**'
|
||||
downloadType: 'specific'
|
||||
displayName: Download Release Artifacts
|
||||
|
||||
- script: |
|
||||
$(Build.SourcesDirectory)\script\publish-release.cmd --assets-path "$(System.ArtifactsDirectory)" --s3-path "vsts-artifacts/$(Build.BuildId)/"
|
||||
env:
|
||||
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
||||
ATOM_RELEASES_S3_KEY: $(ATOM_RELEASES_S3_KEY)
|
||||
ATOM_RELEASES_S3_SECRET: $(ATOM_RELEASES_S3_SECRET)
|
||||
ATOM_RELEASES_S3_BUCKET: $(ATOM_RELEASES_S3_BUCKET)
|
||||
displayName: Upload CI Artifacts to S3
|
||||
condition: and(succeeded(), eq(variables['IsSignedZipBranch'], 'true'))
|
||||
@@ -1,54 +0,0 @@
|
||||
phases:
|
||||
- phase: Windows
|
||||
dependsOn: GetReleaseVersion
|
||||
variables:
|
||||
ReleaseVersion: $[ dependencies.GetReleaseVersion.outputs['Version.ReleaseVersion'] ]
|
||||
queue:
|
||||
name: Hosted
|
||||
timeoutInMinutes: 180
|
||||
parallel: 2
|
||||
matrix:
|
||||
x64:
|
||||
buildArch: x64
|
||||
# TODO: x86 is currently not supported on VSTS
|
||||
# x86:
|
||||
# buildArch: x86
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: 8.9.3
|
||||
displayName: Install Node.js 8.9.3
|
||||
|
||||
- script: |
|
||||
IF NOT EXIST C:\tmp MKDIR C:\tmp
|
||||
SET SQUIRREL_TEMP=C:\tmp
|
||||
script\build.cmd --create-windows-installer --code-sign --compress-artifacts
|
||||
env:
|
||||
ATOM_RELEASE_VERSION: $(ReleaseVersion)
|
||||
ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL: $(ATOM_WIN_CODE_SIGNING_CERT_DOWNLOAD_URL)
|
||||
ATOM_WIN_CODE_SIGNING_CERT_PASSWORD: $(ATOM_WIN_CODE_SIGNING_CERT_PASSWORD)
|
||||
displayName: Build Atom
|
||||
|
||||
- script: script\lint.cmd
|
||||
displayName: Run linter
|
||||
|
||||
- script: script\test.cmd
|
||||
env:
|
||||
CI: true
|
||||
CI_PROVIDER: VSTS
|
||||
displayName: Run tests
|
||||
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
sourceFolder: $(Build.SourcesDirectory)/out
|
||||
contents: '?(*.exe|*.zip|*.nupkg|RELEASES*)'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
displayName: Stage Artifacts
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
inputs:
|
||||
PathtoPublish: $(Build.ArtifactStagingDirectory)
|
||||
ArtifactName: Binaries
|
||||
ArtifactType: Container
|
||||
displayName: Upload Artifacts
|
||||
@@ -746,29 +746,6 @@ describe('AtomEnvironment', () => {
|
||||
})
|
||||
})
|
||||
|
||||
describe('::updateAvailable(info) (called via IPC from browser process)', () => {
|
||||
let subscription
|
||||
|
||||
afterEach(() => {
|
||||
if (subscription) subscription.dispose()
|
||||
})
|
||||
|
||||
it('invokes onUpdateAvailable listeners', async () => {
|
||||
if (process.platform !== 'darwin') return // Test tied to electron autoUpdater, we use something else on Linux and Win32
|
||||
|
||||
const updateAvailablePromise = new Promise(resolve => {
|
||||
subscription = atom.onUpdateAvailable(resolve)
|
||||
})
|
||||
|
||||
atom.listenForUpdates()
|
||||
const {autoUpdater} = require('electron').remote
|
||||
autoUpdater.emit('update-downloaded', null, 'notes', 'version')
|
||||
|
||||
const {releaseVersion} = await updateAvailablePromise
|
||||
expect(releaseVersion).toBe('version')
|
||||
})
|
||||
})
|
||||
|
||||
describe('::getReleaseChannel()', () => {
|
||||
let version
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
'use babel'
|
||||
|
||||
import AutoUpdateManager from '../src/auto-update-manager'
|
||||
import {remote} from 'electron'
|
||||
const AutoUpdateManager = require('../src/auto-update-manager')
|
||||
const {remote} = require('electron')
|
||||
const electronAutoUpdater = remote.require('electron').autoUpdater
|
||||
|
||||
describe('AutoUpdateManager (renderer)', () => {
|
||||
|
||||
if (process.platform !== 'darwin') return // Tests are tied to electron autoUpdater, we use something else on Linux and Win32
|
||||
|
||||
let autoUpdateManager
|
||||
|
||||
@@ -108,17 +108,6 @@ describe('Config', () => {
|
||||
expect(atom.config.get('foo.bar.baz', {scope: ['.source.coffee']})).toBe(100)
|
||||
})
|
||||
)
|
||||
|
||||
describe('when the first component of the scope descriptor matches a legacy scope alias', () =>
|
||||
it('falls back to properties defined for the legacy scope if no value is found for the original scope descriptor', () => {
|
||||
atom.config.setLegacyScopeAliasForNewScope('javascript', '.source.js')
|
||||
atom.config.set('foo', 100, {scopeSelector: '.source.js'})
|
||||
atom.config.set('foo', 200, {scopeSelector: 'javascript for_statement'})
|
||||
|
||||
expect(atom.config.get('foo', {scope: ['javascript', 'for_statement', 'identifier']})).toBe(200)
|
||||
expect(atom.config.get('foo', {scope: ['javascript', 'function', 'identifier']})).toBe(100)
|
||||
})
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -147,22 +136,6 @@ describe('Config', () => {
|
||||
{scopeSelector: '*', value: 40}
|
||||
])
|
||||
})
|
||||
|
||||
describe('when the first component of the scope descriptor matches a legacy scope alias', () =>
|
||||
it('includes the values defined for the legacy scope', () => {
|
||||
atom.config.setLegacyScopeAliasForNewScope('javascript', '.source.js')
|
||||
|
||||
expect(atom.config.set('foo', 41)).toBe(true)
|
||||
expect(atom.config.set('foo', 42, {scopeSelector: 'javascript'})).toBe(true)
|
||||
expect(atom.config.set('foo', 43, {scopeSelector: '.source.js'})).toBe(true)
|
||||
|
||||
expect(atom.config.getAll('foo', {scope: ['javascript']})).toEqual([
|
||||
{scopeSelector: 'javascript', value: 42},
|
||||
{scopeSelector: '.js.source', value: 43},
|
||||
{scopeSelector: '*', value: 41}
|
||||
])
|
||||
})
|
||||
)
|
||||
})
|
||||
|
||||
describe('.set(keyPath, value, {source, scopeSelector})', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: 'Some Language'
|
||||
|
||||
id: 'some-language'
|
||||
scopeName: 'some-language'
|
||||
|
||||
type: 'tree-sitter'
|
||||
|
||||
|
||||
@@ -55,13 +55,13 @@ describe('GrammarRegistry', () => {
|
||||
})
|
||||
|
||||
describe('.grammarForId(languageId)', () => {
|
||||
it('converts the language id to a text-mate language id when `core.useTreeSitterParsers` is false', () => {
|
||||
it('returns a text-mate grammar when `core.useTreeSitterParsers` is false', () => {
|
||||
atom.config.set('core.useTreeSitterParsers', false)
|
||||
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/javascript.cson'))
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/tree-sitter-javascript.cson'))
|
||||
|
||||
const grammar = grammarRegistry.grammarForId('javascript')
|
||||
const grammar = grammarRegistry.grammarForId('source.js')
|
||||
expect(grammar instanceof FirstMate.Grammar).toBe(true)
|
||||
expect(grammar.scopeName).toBe('source.js')
|
||||
|
||||
@@ -69,7 +69,7 @@ describe('GrammarRegistry', () => {
|
||||
expect(grammarRegistry.grammarForId('javascript')).toBe(undefined)
|
||||
})
|
||||
|
||||
it('converts the language id to a tree-sitter language id when `core.useTreeSitterParsers` is true', () => {
|
||||
it('returns a tree-sitter grammar when `core.useTreeSitterParsers` is true', () => {
|
||||
atom.config.set('core.useTreeSitterParsers', true)
|
||||
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/javascript.cson'))
|
||||
@@ -77,7 +77,7 @@ describe('GrammarRegistry', () => {
|
||||
|
||||
const grammar = grammarRegistry.grammarForId('source.js')
|
||||
expect(grammar instanceof TreeSitterGrammar).toBe(true)
|
||||
expect(grammar.id).toBe('javascript')
|
||||
expect(grammar.scopeName).toBe('source.js')
|
||||
|
||||
grammarRegistry.removeGrammar(grammar)
|
||||
expect(grammarRegistry.grammarForId('source.js') instanceof FirstMate.Grammar).toBe(true)
|
||||
@@ -123,11 +123,11 @@ describe('GrammarRegistry', () => {
|
||||
buffer.setPath('test.js')
|
||||
grammarRegistry.maintainLanguageMode(buffer)
|
||||
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/javascript.cson'))
|
||||
expect(buffer.getLanguageMode().getLanguageId()).toBe('source.js')
|
||||
const textMateGrammar = grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/javascript.cson'))
|
||||
expect(buffer.getLanguageMode().grammar).toBe(textMateGrammar)
|
||||
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/tree-sitter-javascript.cson'))
|
||||
expect(buffer.getLanguageMode().getLanguageId()).toBe('source.js')
|
||||
expect(buffer.getLanguageMode().grammar).toBe(textMateGrammar)
|
||||
})
|
||||
|
||||
it('updates the buffer\'s grammar when a more appropriate tree-sitter grammar is added for its path', async () => {
|
||||
@@ -139,11 +139,11 @@ describe('GrammarRegistry', () => {
|
||||
buffer.setPath('test.js')
|
||||
grammarRegistry.maintainLanguageMode(buffer)
|
||||
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/tree-sitter-javascript.cson'))
|
||||
expect(buffer.getLanguageMode().getLanguageId()).toBe('javascript')
|
||||
const treeSitterGrammar = grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/tree-sitter-javascript.cson'))
|
||||
expect(buffer.getLanguageMode().grammar).toBe(treeSitterGrammar)
|
||||
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/javascript.cson'))
|
||||
expect(buffer.getLanguageMode().getLanguageId()).toBe('javascript')
|
||||
expect(buffer.getLanguageMode().grammar).toBe(treeSitterGrammar)
|
||||
})
|
||||
|
||||
it('can be overridden by calling .assignLanguageMode', () => {
|
||||
@@ -412,7 +412,6 @@ describe('GrammarRegistry', () => {
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-javascript/grammars/tree-sitter-javascript.cson'))
|
||||
|
||||
const grammar = grammarRegistry.selectGrammar('test.js')
|
||||
expect(grammar.id).toBe('javascript')
|
||||
expect(grammar instanceof TreeSitterGrammar).toBe(true)
|
||||
})
|
||||
|
||||
@@ -472,6 +471,19 @@ describe('GrammarRegistry', () => {
|
||||
expect(grammar.name).toBe('C++')
|
||||
})
|
||||
|
||||
it('does not apply content regexes from grammars without filetype or first line matches', () => {
|
||||
atom.config.set('core.useTreeSitterParsers', true)
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-c/grammars/tree-sitter-cpp.cson'))
|
||||
|
||||
let grammar = grammarRegistry.selectGrammar('', dedent `
|
||||
class Foo
|
||||
# this is ruby, not C++
|
||||
end
|
||||
`)
|
||||
|
||||
expect(grammar.name).toBe('Null Grammar')
|
||||
})
|
||||
|
||||
it('recognizes shell scripts with shebang lines', () => {
|
||||
atom.config.set('core.useTreeSitterParsers', true)
|
||||
grammarRegistry.loadGrammarSync(require.resolve('language-shellscript/grammars/shell-unix-bash.cson'))
|
||||
@@ -485,6 +497,14 @@ describe('GrammarRegistry', () => {
|
||||
expect(grammar.name).toBe('Shell Script')
|
||||
expect(grammar instanceof TreeSitterGrammar).toBeTruthy()
|
||||
|
||||
grammar = grammarRegistry.selectGrammar('test.h', dedent `
|
||||
# vim: set ft=bash
|
||||
|
||||
echo "hi"
|
||||
`)
|
||||
expect(grammar.name).toBe('Shell Script')
|
||||
expect(grammar instanceof TreeSitterGrammar).toBeTruthy()
|
||||
|
||||
atom.config.set('core.useTreeSitterParsers', false)
|
||||
grammar = grammarRegistry.selectGrammar('test.h', dedent `
|
||||
#!/bin/bash
|
||||
|
||||
@@ -58,10 +58,8 @@ describe "MenuManager", ->
|
||||
menu.add [{label: "A", submenu: [{label: "B", command: "b"}]}]
|
||||
atom.keymaps.add 'test', 'atom-workspace': 'ctrl-b': 'b'
|
||||
menu.update()
|
||||
|
||||
waits 50
|
||||
|
||||
runs -> expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toEqual ['ctrl-b']
|
||||
advanceClock(1)
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toEqual ['ctrl-b']
|
||||
|
||||
it "omits key bindings that are mapped to unset! in any context", ->
|
||||
# it would be nice to be smarter about omitting, but that would require a much
|
||||
@@ -69,10 +67,8 @@ describe "MenuManager", ->
|
||||
menu.add [{label: "A", submenu: [{label: "B", command: "b"}]}]
|
||||
atom.keymaps.add 'test', 'atom-workspace': 'ctrl-b': 'b'
|
||||
atom.keymaps.add 'test', 'atom-text-editor': 'ctrl-b': 'unset!'
|
||||
|
||||
waits 50
|
||||
|
||||
runs -> expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined()
|
||||
advanceClock(1)
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined()
|
||||
|
||||
it "omits key bindings that could conflict with AltGraph characters on macOS", ->
|
||||
Object.defineProperty process, 'platform', value: 'darwin'
|
||||
@@ -87,12 +83,10 @@ describe "MenuManager", ->
|
||||
'alt-shift-C': 'c'
|
||||
'alt-cmd-d': 'd'
|
||||
|
||||
waits 50
|
||||
|
||||
runs ->
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['c']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['d']).toEqual(['alt-cmd-d'])
|
||||
advanceClock(1)
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['c']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['d']).toEqual(['alt-cmd-d'])
|
||||
|
||||
it "omits key bindings that could conflict with AltGraph characters on Windows", ->
|
||||
Object.defineProperty process, 'platform', value: 'win32'
|
||||
@@ -107,12 +101,10 @@ describe "MenuManager", ->
|
||||
'ctrl-alt-shift-C': 'c'
|
||||
'ctrl-alt-cmd-d': 'd'
|
||||
|
||||
waits 50
|
||||
|
||||
runs ->
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['c']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['d']).toEqual(['ctrl-alt-cmd-d'])
|
||||
advanceClock(1)
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['b']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['c']).toBeUndefined()
|
||||
expect(menu.sendToBrowserProcess.argsForCall[0][1]['d']).toEqual(['ctrl-alt-cmd-d'])
|
||||
|
||||
it "updates the application menu when a keymap is reloaded", ->
|
||||
spyOn(menu, 'update')
|
||||
|
||||
@@ -112,7 +112,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
it('correctly skips over tokens with zero size', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, cGrammarPath, {
|
||||
parser: 'tree-sitter-c',
|
||||
scopes: {
|
||||
'primitive_type': 'type',
|
||||
@@ -192,6 +192,36 @@ describe('TreeSitterLanguageMode', () => {
|
||||
])
|
||||
})
|
||||
|
||||
it('allows comma-separated selectors as scope mapping keys', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {
|
||||
'identifier, call_expression > identifier': [
|
||||
{match: '^[A-Z]', scopes: 'constructor'}
|
||||
],
|
||||
|
||||
'call_expression > identifier': 'function'
|
||||
}
|
||||
})
|
||||
|
||||
buffer.setText(`a(B(new C))`)
|
||||
|
||||
const languageMode = new TreeSitterLanguageMode({buffer, grammar})
|
||||
buffer.setLanguageMode(languageMode)
|
||||
await nextHighlightingUpdate(languageMode)
|
||||
|
||||
expectTokensToEqual(editor, [
|
||||
[
|
||||
{text: 'a', scopes: ['function']},
|
||||
{text: '(', scopes: []},
|
||||
{text: 'B', scopes: ['constructor']},
|
||||
{text: '(new ', scopes: []},
|
||||
{text: 'C', scopes: ['constructor']},
|
||||
{text: '))', scopes: []},
|
||||
]
|
||||
])
|
||||
})
|
||||
|
||||
it('handles edits after tokens that end between CR and LF characters (regression)', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
parser: 'tree-sitter-javascript',
|
||||
@@ -314,7 +344,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
])
|
||||
})
|
||||
|
||||
it('applies rules when specified', async () => {
|
||||
it('applies regex match rules when specified', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {
|
||||
@@ -446,7 +476,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {
|
||||
'property_identifier': 'property',
|
||||
@@ -460,7 +490,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {
|
||||
fragment: 'html',
|
||||
@@ -656,8 +686,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
const languageMode = new TreeSitterLanguageMode({buffer, grammar: ejsGrammar, grammars: atom.grammars})
|
||||
buffer.setLanguageMode(languageMode)
|
||||
|
||||
// 4 parses: EJS, HTML, template JS, script tag JS
|
||||
await nextHighlightingUpdate(languageMode)
|
||||
// Parse EJS, then HTML and template JS in parallel, then script tag JS
|
||||
await nextHighlightingUpdate(languageMode)
|
||||
await nextHighlightingUpdate(languageMode)
|
||||
await nextHighlightingUpdate(languageMode)
|
||||
@@ -695,6 +724,39 @@ describe('TreeSitterLanguageMode', () => {
|
||||
],
|
||||
])
|
||||
})
|
||||
|
||||
it('notifies onDidTokenize listeners the first time all syntax highlighting is done', async () => {
|
||||
const promise = new Promise(resolve => {
|
||||
editor.onDidTokenize(event => {
|
||||
expectTokensToEqual(editor, [
|
||||
[
|
||||
{text: '<', scopes: ['html']},
|
||||
{text: 'script', scopes: ['html', 'tag']},
|
||||
{text: '>', scopes: ['html']},
|
||||
],
|
||||
[
|
||||
{text: 'hello', scopes: ['html', 'function']},
|
||||
{text: '();', scopes: ['html']},
|
||||
],
|
||||
[
|
||||
{text: '</', scopes: ['html']},
|
||||
{text: 'script', scopes: ['html', 'tag']},
|
||||
{text: '>', scopes: ['html']},
|
||||
]
|
||||
])
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
|
||||
atom.grammars.addGrammar(jsGrammar)
|
||||
atom.grammars.addGrammar(htmlGrammar)
|
||||
buffer.setText('<script>\nhello();\n</script>')
|
||||
|
||||
const languageMode = new TreeSitterLanguageMode({buffer, grammar: htmlGrammar, grammars: atom.grammars})
|
||||
buffer.setLanguageMode(languageMode)
|
||||
|
||||
await promise
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1182,7 +1244,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
it('folds code in injected languages', async () => {
|
||||
const htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {},
|
||||
folds: [{
|
||||
@@ -1194,7 +1256,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
const jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {},
|
||||
folds: [{
|
||||
@@ -1261,39 +1323,49 @@ describe('TreeSitterLanguageMode', () => {
|
||||
describe('.scopeDescriptorForPosition', () => {
|
||||
it('returns a scope descriptor representing the given position in the syntax tree', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
parser: 'tree-sitter-javascript'
|
||||
scopeName: 'source.js',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {
|
||||
program: 'source.js',
|
||||
property_identifier: 'property.name'
|
||||
}
|
||||
})
|
||||
|
||||
buffer.setText('foo({bar: baz});')
|
||||
|
||||
buffer.setLanguageMode(new TreeSitterLanguageMode({buffer, grammar}))
|
||||
await nextHighlightingUpdate(buffer.getLanguageMode())
|
||||
expect(editor.scopeDescriptorForBufferPosition([0, 6]).getScopesArray()).toEqual([
|
||||
'javascript',
|
||||
'program',
|
||||
'expression_statement',
|
||||
'call_expression',
|
||||
'arguments',
|
||||
'object',
|
||||
'pair',
|
||||
'property_identifier'
|
||||
expect(editor.scopeDescriptorForBufferPosition([0, 'foo({b'.length]).getScopesArray()).toEqual([
|
||||
'source.js',
|
||||
'property.name'
|
||||
])
|
||||
expect(editor.scopeDescriptorForBufferPosition([0, 'foo({'.length]).getScopesArray()).toEqual([
|
||||
'source.js',
|
||||
'property.name'
|
||||
])
|
||||
})
|
||||
|
||||
it('includes nodes in injected syntax trees', async () => {
|
||||
const jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'source.js',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {},
|
||||
scopes: {
|
||||
program: 'source.js',
|
||||
template_string: 'string.quoted',
|
||||
interpolation: 'meta.embedded',
|
||||
property_identifier: 'property.name'
|
||||
},
|
||||
injectionRegExp: 'javascript',
|
||||
injectionPoints: [HTML_TEMPLATE_LITERAL_INJECTION_POINT]
|
||||
})
|
||||
|
||||
const htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'text.html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {},
|
||||
scopes: {
|
||||
fragment: 'text.html',
|
||||
raw_element: 'script.tag'
|
||||
},
|
||||
injectionRegExp: 'html',
|
||||
injectionPoints: [SCRIPT_TAG_INJECTION_POINT]
|
||||
})
|
||||
@@ -1319,20 +1391,12 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
const position = buffer.findSync('name').start
|
||||
expect(languageMode.scopeDescriptorForPosition(position).getScopesArray()).toEqual([
|
||||
'html',
|
||||
'fragment',
|
||||
'element',
|
||||
'raw_element',
|
||||
'raw_text',
|
||||
'program',
|
||||
'expression_statement',
|
||||
'call_expression',
|
||||
'template_string',
|
||||
'fragment',
|
||||
'element',
|
||||
'template_substitution',
|
||||
'member_expression',
|
||||
'property_identifier'
|
||||
'text.html',
|
||||
'script.tag',
|
||||
'source.js',
|
||||
'string.quoted',
|
||||
'text.html',
|
||||
'property.name'
|
||||
])
|
||||
})
|
||||
})
|
||||
@@ -1341,7 +1405,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
describe('when selector = null', () => {
|
||||
it('returns the range of the smallest node at position', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript'
|
||||
})
|
||||
|
||||
@@ -1359,7 +1423,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
it('includes nodes in injected syntax trees', async () => {
|
||||
const jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {},
|
||||
injectionRegExp: 'javascript',
|
||||
@@ -1367,7 +1431,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
const htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {},
|
||||
injectionRegExp: 'html',
|
||||
@@ -1404,7 +1468,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
describe('with a selector', () => {
|
||||
it('returns the range of the smallest matching node at position', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript'
|
||||
})
|
||||
|
||||
@@ -1425,7 +1489,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
it('includes nodes in injected syntax trees', async () => {
|
||||
const jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {},
|
||||
injectionRegExp: 'javascript',
|
||||
@@ -1433,7 +1497,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
const htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {},
|
||||
injectionRegExp: 'html',
|
||||
@@ -1470,7 +1534,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
it('accepts node-matching functions as selectors', async () => {
|
||||
const jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {},
|
||||
injectionRegExp: 'javascript',
|
||||
@@ -1478,7 +1542,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
const htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {},
|
||||
injectionRegExp: 'html',
|
||||
@@ -1518,7 +1582,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
describe('.getSyntaxNodeAtPosition(position, where?)', () => {
|
||||
it('returns the range of the smallest matching node at position', async () => {
|
||||
const grammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript'
|
||||
})
|
||||
|
||||
@@ -1580,7 +1644,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
|
||||
it('handles injected languages', async () => {
|
||||
const jsGrammar = new TreeSitterGrammar(atom.grammars, jsGrammarPath, {
|
||||
id: 'javascript',
|
||||
scopeName: 'javascript',
|
||||
parser: 'tree-sitter-javascript',
|
||||
scopes: {
|
||||
'property_identifier': 'property',
|
||||
@@ -1594,7 +1658,7 @@ describe('TreeSitterLanguageMode', () => {
|
||||
})
|
||||
|
||||
const htmlGrammar = new TreeSitterGrammar(atom.grammars, htmlGrammarPath, {
|
||||
id: 'html',
|
||||
scopeName: 'html',
|
||||
parser: 'tree-sitter-html',
|
||||
scopes: {
|
||||
fragment: 'html',
|
||||
|
||||
@@ -1,12 +1,23 @@
|
||||
const {ipcRenderer, remote, shell} = require('electron')
|
||||
const ipcHelpers = require('./ipc-helpers')
|
||||
const {Disposable} = require('event-kit')
|
||||
const {Emitter, Disposable} = require('event-kit')
|
||||
const getWindowLoadSettings = require('./get-window-load-settings')
|
||||
|
||||
module.exports =
|
||||
class ApplicationDelegate {
|
||||
constructor () {
|
||||
this.pendingSettingsUpdateCount = 0
|
||||
this._ipcMessageEmitter = null
|
||||
}
|
||||
|
||||
ipcMessageEmitter () {
|
||||
if (!this._ipcMessageEmitter) {
|
||||
this._ipcMessageEmitter = new Emitter()
|
||||
ipcRenderer.on('message', (event, message, detail) => {
|
||||
this._ipcMessageEmitter.emit(message, detail)
|
||||
})
|
||||
}
|
||||
return this._ipcMessageEmitter
|
||||
}
|
||||
|
||||
getWindowLoadSettings () { return getWindowLoadSettings() }
|
||||
@@ -189,21 +200,13 @@ class ApplicationDelegate {
|
||||
}
|
||||
|
||||
onDidChangeUserSettings (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
if (message === 'did-change-user-settings') {
|
||||
if (this.pendingSettingsUpdateCount === 0) callback(detail)
|
||||
}
|
||||
}
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('did-change-user-settings', detail => {
|
||||
if (this.pendingSettingsUpdateCount === 0) callback(detail)
|
||||
})
|
||||
}
|
||||
|
||||
onDidFailToReadUserSettings (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
if (message === 'did-fail-to-read-user-settings') callback(detail)
|
||||
}
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('did-fail-to-read-user-setting', callback)
|
||||
}
|
||||
|
||||
confirm (options, callback) {
|
||||
@@ -261,24 +264,14 @@ class ApplicationDelegate {
|
||||
}
|
||||
|
||||
onDidOpenLocations (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
if (message === 'open-locations') callback(detail)
|
||||
}
|
||||
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('open-locations', callback)
|
||||
}
|
||||
|
||||
onUpdateAvailable (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
// TODO: Yes, this is strange that `onUpdateAvailable` is listening for
|
||||
// `did-begin-downloading-update`. We currently have no mechanism to know
|
||||
// if there is an update, so begin of downloading is a good proxy.
|
||||
if (message === 'did-begin-downloading-update') callback(detail)
|
||||
}
|
||||
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
// TODO: Yes, this is strange that `onUpdateAvailable` is listening for
|
||||
// `did-begin-downloading-update`. We currently have no mechanism to know
|
||||
// if there is an update, so begin of downloading is a good proxy.
|
||||
return this.ipcMessageEmitter().on('did-begin-downloading-update', callback)
|
||||
}
|
||||
|
||||
onDidBeginDownloadingUpdate (callback) {
|
||||
@@ -286,40 +279,19 @@ class ApplicationDelegate {
|
||||
}
|
||||
|
||||
onDidBeginCheckingForUpdate (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
if (message === 'checking-for-update') callback(detail)
|
||||
}
|
||||
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('checking-for-update', callback)
|
||||
}
|
||||
|
||||
onDidCompleteDownloadingUpdate (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
// TODO: We could rename this event to `did-complete-downloading-update`
|
||||
if (message === 'update-available') callback(detail)
|
||||
}
|
||||
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('update-available', callback)
|
||||
}
|
||||
|
||||
onUpdateNotAvailable (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
if (message === 'update-not-available') callback(detail)
|
||||
}
|
||||
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('update-not-available', callback)
|
||||
}
|
||||
|
||||
onUpdateError (callback) {
|
||||
const outerCallback = (event, message, detail) => {
|
||||
if (message === 'update-error') callback(detail)
|
||||
}
|
||||
|
||||
ipcRenderer.on('message', outerCallback)
|
||||
return new Disposable(() => ipcRenderer.removeListener('message', outerCallback))
|
||||
return this.ipcMessageEmitter().on('update-error', callback)
|
||||
}
|
||||
|
||||
onApplicationMenuCommand (handler) {
|
||||
|
||||
@@ -6,6 +6,7 @@ const {watchPath} = require('./path-watcher')
|
||||
const CSON = require('season')
|
||||
const Path = require('path')
|
||||
const async = require('async')
|
||||
const temp = require('temp')
|
||||
|
||||
const EVENT_TYPES = new Set([
|
||||
'created',
|
||||
@@ -37,9 +38,11 @@ class ConfigFile {
|
||||
this.reloadCallbacks = []
|
||||
|
||||
// Use a queue to prevent multiple concurrent write to the same file.
|
||||
const writeQueue = async.queue((data, callback) =>
|
||||
CSON.writeFile(this.path, data, error => {
|
||||
if (error) {
|
||||
const writeQueue = async.queue((data, callback) => {
|
||||
(async () => {
|
||||
try {
|
||||
await writeCSONFileAtomically(this.path, data)
|
||||
} catch (error) {
|
||||
this.emitter.emit('did-error', dedent `
|
||||
Failed to write \`${Path.basename(this.path)}\`.
|
||||
|
||||
@@ -47,8 +50,8 @@ class ConfigFile {
|
||||
`)
|
||||
}
|
||||
callback()
|
||||
})
|
||||
)
|
||||
})()
|
||||
})
|
||||
|
||||
this.requestLoad = _.debounce(() => this.reload(), 200)
|
||||
this.requestSave = _.debounce((data) => writeQueue.push(data), 200)
|
||||
@@ -116,3 +119,27 @@ class ConfigFile {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
function writeCSONFile (path, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
CSON.writeFile(path, data, error => {
|
||||
if (error) reject(error)
|
||||
else resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
async function writeCSONFileAtomically (path, data) {
|
||||
const tempPath = temp.path()
|
||||
await writeCSONFile(tempPath, data)
|
||||
await rename(tempPath, path)
|
||||
}
|
||||
|
||||
function rename (oldPath, newPath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
fs.rename(oldPath, newPath, error => {
|
||||
if (error) reject(error)
|
||||
else resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ const schemaEnforcers = {}
|
||||
// ### Value Coercion
|
||||
//
|
||||
// Config settings each have a type specified by way of a
|
||||
// [schema](json-schema.org). For example we might an integer setting that only
|
||||
// [schema](json-schema.org). For example we might want an integer setting that only
|
||||
// allows integers greater than `0`:
|
||||
//
|
||||
// ```coffee
|
||||
@@ -823,21 +823,7 @@ class Config {
|
||||
}
|
||||
|
||||
getLegacyScopeDescriptorForNewScopeDescriptor (scopeDescriptor) {
|
||||
scopeDescriptor = ScopeDescriptor.fromObject(scopeDescriptor)
|
||||
const legacyAlias = this.legacyScopeAliases.get(scopeDescriptor.scopes[0])
|
||||
if (legacyAlias) {
|
||||
const scopes = scopeDescriptor.scopes.slice()
|
||||
scopes[0] = legacyAlias
|
||||
return new ScopeDescriptor({scopes})
|
||||
}
|
||||
}
|
||||
|
||||
setLegacyScopeAliasForNewScope (languageId, legacyScopeName) {
|
||||
this.legacyScopeAliases.set(languageId, legacyScopeName)
|
||||
}
|
||||
|
||||
removeLegacyScopeAliasForNewScope (languageId) {
|
||||
this.legacyScopeAliases.delete(languageId)
|
||||
return null
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -163,7 +163,7 @@ class GitRepository {
|
||||
// Public: Invoke the given callback when a multiple files' statuses have
|
||||
// changed. For example, on window focus, the status of all the paths in the
|
||||
// repo is checked. If any of them have changed, this will be fired. Call
|
||||
// {::getPathStatus(path)} to get the status for your path of choice.
|
||||
// {::getPathStatus} to get the status for your path of choice.
|
||||
//
|
||||
// * `callback` {Function}
|
||||
//
|
||||
|
||||
@@ -122,7 +122,6 @@ class GrammarRegistry {
|
||||
// found.
|
||||
assignLanguageMode (buffer, languageId) {
|
||||
if (buffer.getBuffer) buffer = buffer.getBuffer()
|
||||
languageId = this.normalizeLanguageId(languageId)
|
||||
|
||||
let grammar = null
|
||||
if (languageId != null) {
|
||||
@@ -208,25 +207,34 @@ class GrammarRegistry {
|
||||
contents = fs.readFileSync(filePath, 'utf8')
|
||||
}
|
||||
|
||||
// Initially identify matching grammars based on the filename and the first
|
||||
// line of the file.
|
||||
let score = this.getGrammarPathScore(grammar, filePath)
|
||||
if (score > 0 && !grammar.bundledPackage) {
|
||||
score += 0.125
|
||||
}
|
||||
if (this.grammarMatchesPrefix(grammar, contents)) score += 0.5
|
||||
|
||||
if (grammar instanceof TreeSitterGrammar) {
|
||||
if (!this.config.get('core.useTreeSitterParsers')) return -Infinity
|
||||
|
||||
if (grammar.contentRegExp) {
|
||||
if (grammar.contentRegExp.test(contents)) {
|
||||
score += 0.25
|
||||
// If multiple grammars match by one of the above criteria, break ties.
|
||||
if (score > 0) {
|
||||
// Prefer either TextMate or Tree-sitter grammars based on the user's settings.
|
||||
if (grammar instanceof TreeSitterGrammar) {
|
||||
if (this.config.get('core.useTreeSitterParsers')) {
|
||||
score += 0.1
|
||||
} else {
|
||||
score -= 0.25
|
||||
return -Infinity
|
||||
}
|
||||
}
|
||||
|
||||
if (score > 0) score += 0.5
|
||||
} else if (this.grammarMatchesPrefix(grammar, contents)) {
|
||||
score += 0.25
|
||||
// Prefer grammars with matching content regexes. Prefer a grammar with no content regex
|
||||
// over one with a non-matching content regex.
|
||||
if (grammar.contentRegex) {
|
||||
if (grammar.contentRegex.test(contents)) {
|
||||
score += 0.05
|
||||
} else {
|
||||
score -= 0.05
|
||||
}
|
||||
}
|
||||
|
||||
// Prefer grammars that the user has manually installed over bundled grammars.
|
||||
if (!grammar.bundledPackage) score += 0.01
|
||||
}
|
||||
|
||||
return score
|
||||
@@ -282,8 +290,12 @@ class GrammarRegistry {
|
||||
}
|
||||
}
|
||||
|
||||
const lines = contents.split('\n')
|
||||
return grammar.firstLineRegex.testSync(lines.slice(0, numberOfNewlinesInRegex + 1).join('\n'))
|
||||
const prefix = contents.split('\n').slice(0, numberOfNewlinesInRegex + 1).join('\n')
|
||||
if (grammar.firstLineRegex.testSync) {
|
||||
return grammar.firstLineRegex.testSync(prefix)
|
||||
} else {
|
||||
return grammar.firstLineRegex.test(prefix)
|
||||
}
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
@@ -293,17 +305,23 @@ class GrammarRegistry {
|
||||
this.textmateRegistry.grammars.forEach(callback)
|
||||
for (const grammarId in this.treeSitterGrammarsById) {
|
||||
const grammar = this.treeSitterGrammarsById[grammarId]
|
||||
if (grammar.id) callback(grammar)
|
||||
if (grammar.scopeName) callback(grammar)
|
||||
}
|
||||
}
|
||||
|
||||
grammarForId (languageId) {
|
||||
languageId = this.normalizeLanguageId(languageId)
|
||||
|
||||
return (
|
||||
this.textmateRegistry.grammarForScopeName(languageId) ||
|
||||
this.treeSitterGrammarsById[languageId]
|
||||
)
|
||||
if (!languageId) return null
|
||||
if (this.config.get('core.useTreeSitterParsers')) {
|
||||
return (
|
||||
this.treeSitterGrammarsById[languageId] ||
|
||||
this.textmateRegistry.grammarForScopeName(languageId)
|
||||
)
|
||||
} else {
|
||||
return (
|
||||
this.textmateRegistry.grammarForScopeName(languageId) ||
|
||||
this.treeSitterGrammarsById[languageId]
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
// Deprecated: Get the grammar override for the given file path.
|
||||
@@ -350,8 +368,8 @@ class GrammarRegistry {
|
||||
const languageMode = buffer.getLanguageMode()
|
||||
const languageOverride = this.languageOverridesByBufferId.get(buffer.id)
|
||||
|
||||
if ((grammar.id === buffer.getLanguageMode().getLanguageId() ||
|
||||
grammar.id === languageOverride)) {
|
||||
if (grammar === buffer.getLanguageMode().grammar ||
|
||||
grammar === this.grammarForId(languageOverride)) {
|
||||
buffer.setLanguageMode(this.languageModeForGrammarAndBuffer(grammar, buffer))
|
||||
return
|
||||
} else if (!languageOverride) {
|
||||
@@ -395,7 +413,7 @@ class GrammarRegistry {
|
||||
// * `injectionPoint` An {Object} with the following keys:
|
||||
// * `type` The {String} type of syntax node that may embed other languages
|
||||
// * `language` A {Function} that is called with syntax nodes of the specified `type` and
|
||||
// returns a {String} that will be tested against other grammars' `injectionRegExp` in
|
||||
// returns a {String} that will be tested against other grammars' `injectionRegex` in
|
||||
// order to determine what language should be embedded.
|
||||
// * `content` A {Function} that is called with syntax nodes of the specified `type` and
|
||||
// returns another syntax node or array of syntax nodes that contain the embedded source code.
|
||||
@@ -433,13 +451,8 @@ class GrammarRegistry {
|
||||
|
||||
addGrammar (grammar) {
|
||||
if (grammar instanceof TreeSitterGrammar) {
|
||||
const existingParams = this.treeSitterGrammarsById[grammar.id] || {}
|
||||
this.treeSitterGrammarsById[grammar.id] = grammar
|
||||
if (grammar.legacyScopeName) {
|
||||
this.config.setLegacyScopeAliasForNewScope(grammar.id, grammar.legacyScopeName)
|
||||
this.textMateScopeNamesByTreeSitterLanguageId.set(grammar.id, grammar.legacyScopeName)
|
||||
this.treeSitterLanguageIdsByTextMateScopeName.set(grammar.legacyScopeName, grammar.id)
|
||||
}
|
||||
const existingParams = this.treeSitterGrammarsById[grammar.scopeName] || {}
|
||||
if (grammar.scopeName) this.treeSitterGrammarsById[grammar.scopeName] = grammar
|
||||
if (existingParams.injectionPoints) grammar.injectionPoints.push(...existingParams.injectionPoints)
|
||||
this.grammarAddedOrUpdated(grammar)
|
||||
return new Disposable(() => this.removeGrammar(grammar))
|
||||
@@ -450,12 +463,7 @@ class GrammarRegistry {
|
||||
|
||||
removeGrammar (grammar) {
|
||||
if (grammar instanceof TreeSitterGrammar) {
|
||||
delete this.treeSitterGrammarsById[grammar.id]
|
||||
if (grammar.legacyScopeName) {
|
||||
this.config.removeLegacyScopeAliasForNewScope(grammar.id)
|
||||
this.textMateScopeNamesByTreeSitterLanguageId.delete(grammar.id)
|
||||
this.treeSitterLanguageIdsByTextMateScopeName.delete(grammar.legacyScopeName)
|
||||
}
|
||||
delete this.treeSitterGrammarsById[grammar.scopeName]
|
||||
} else {
|
||||
return this.textmateRegistry.removeGrammar(grammar)
|
||||
}
|
||||
@@ -542,12 +550,22 @@ class GrammarRegistry {
|
||||
}
|
||||
|
||||
treeSitterGrammarForLanguageString (languageString) {
|
||||
let longestMatchLength = 0
|
||||
let grammarWithLongestMatch = null
|
||||
for (const id in this.treeSitterGrammarsById) {
|
||||
const grammar = this.treeSitterGrammarsById[id]
|
||||
if (grammar.injectionRegExp && grammar.injectionRegExp.test(languageString)) {
|
||||
return grammar
|
||||
if (grammar.injectionRegex) {
|
||||
const match = languageString.match(grammar.injectionRegex)
|
||||
if (match) {
|
||||
const {length} = match[0]
|
||||
if (length > longestMatchLength) {
|
||||
grammarWithLongestMatch = grammar
|
||||
longestMatchLength = length
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return grammarWithLongestMatch
|
||||
}
|
||||
|
||||
normalizeLanguageId (languageId) {
|
||||
|
||||
@@ -185,6 +185,7 @@ class AtomWindow extends EventEmitter {
|
||||
dialog.showMessageBox(this.browserWindow, {
|
||||
type: 'warning',
|
||||
buttons: ['Force Close', 'Keep Waiting'],
|
||||
cancelId: 1, // Canceling should be the least destructive action
|
||||
message: 'Editor is not responding',
|
||||
detail:
|
||||
'The editor is not responding. Would you like to force close it or just keep waiting?'
|
||||
@@ -202,6 +203,7 @@ class AtomWindow extends EventEmitter {
|
||||
dialog.showMessageBox(this.browserWindow, {
|
||||
type: 'warning',
|
||||
buttons: ['Close Window', 'Reload', 'Keep It Open'],
|
||||
cancelId: 2, // Canceling should be the least destructive action
|
||||
message: 'The editor has crashed',
|
||||
detail: 'Please report this issue to https://github.com/atom/atom'
|
||||
}, response => {
|
||||
|
||||
@@ -94,7 +94,7 @@ class AutoUpdateManager
|
||||
scheduleUpdateCheck: ->
|
||||
# Only schedule update check periodically if running in release version and
|
||||
# and there is no existing scheduled update check.
|
||||
unless /\w{7}/.test(@version) or @checkForUpdatesIntervalID
|
||||
unless /-dev/.test(@version) or @checkForUpdatesIntervalID
|
||||
checkForUpdates = => @check(hidePopups: true)
|
||||
fourHours = 1000 * 60 * 60 * 4
|
||||
@checkForUpdatesIntervalID = setInterval(checkForUpdates, fourHours)
|
||||
|
||||
@@ -149,9 +149,9 @@ class MenuManager
|
||||
update: ->
|
||||
return unless @initialized
|
||||
|
||||
clearImmediate(@pendingUpdateOperation) if @pendingUpdateOperation?
|
||||
clearTimeout(@pendingUpdateOperation) if @pendingUpdateOperation?
|
||||
|
||||
@pendingUpdateOperation = setImmediate =>
|
||||
@pendingUpdateOperation = setTimeout(=>
|
||||
unsetKeystrokes = new Set
|
||||
for binding in @keymapManager.getKeyBindings()
|
||||
if binding.command is 'unset!'
|
||||
@@ -168,6 +168,7 @@ class MenuManager
|
||||
keystrokesByCommand[binding.command].unshift binding.keystrokes
|
||||
|
||||
@sendToBrowserProcess(@template, keystrokesByCommand)
|
||||
, 1)
|
||||
|
||||
loadPlatformItems: ->
|
||||
if platformMenu?
|
||||
|
||||
@@ -6,11 +6,14 @@ module.exports =
|
||||
class TreeSitterGrammar {
|
||||
constructor (registry, filePath, params) {
|
||||
this.registry = registry
|
||||
this.id = params.id
|
||||
this.name = params.name
|
||||
this.legacyScopeName = params.legacyScopeName
|
||||
if (params.contentRegExp) this.contentRegExp = new RegExp(params.contentRegExp)
|
||||
if (params.injectionRegExp) this.injectionRegExp = new RegExp(params.injectionRegExp)
|
||||
this.scopeName = params.scopeName
|
||||
|
||||
// TODO - Remove the `RegExp` spelling and only support `Regex`, once all of the existing
|
||||
// Tree-sitter grammars are updated to spell it `Regex`.
|
||||
this.contentRegex = buildRegex(params.contentRegex || params.contentRegExp)
|
||||
this.injectionRegex = buildRegex(params.injectionRegex || params.injectionRegExp)
|
||||
this.firstLineRegex = buildRegex(params.firstLineRegex)
|
||||
|
||||
this.folds = params.folds || []
|
||||
this.folds.forEach(normalizeFoldSpecification)
|
||||
@@ -22,11 +25,21 @@ class TreeSitterGrammar {
|
||||
|
||||
const scopeSelectors = {}
|
||||
for (const key in params.scopes || {}) {
|
||||
scopeSelectors[key] = toSyntaxClasses(params.scopes[key])
|
||||
const classes = toSyntaxClasses(params.scopes[key])
|
||||
const selectors = key.split(/,\s+/)
|
||||
for (let selector of selectors) {
|
||||
selector = selector.trim()
|
||||
if (!selector) continue
|
||||
if (scopeSelectors[selector]) {
|
||||
scopeSelectors[selector] = [].concat(scopeSelectors[selector], classes)
|
||||
} else {
|
||||
scopeSelectors[selector] = classes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.scopeMap = new SyntaxScopeMap(scopeSelectors)
|
||||
this.fileTypes = params.fileTypes
|
||||
this.fileTypes = params.fileTypes || []
|
||||
this.injectionPoints = params.injectionPoints || []
|
||||
|
||||
// TODO - When we upgrade to a new enough version of node, use `require.resolve`
|
||||
@@ -39,11 +52,16 @@ class TreeSitterGrammar {
|
||||
|
||||
this.languageModule = require(languageModulePath)
|
||||
this.scopesById = new Map()
|
||||
this.conciseScopesById = new Map()
|
||||
this.idsByScope = {}
|
||||
this.nextScopeId = 256 + 1
|
||||
this.registration = null
|
||||
}
|
||||
|
||||
inspect () {
|
||||
return `TreeSitterGrammar {scopeName: ${this.scopeName}}`
|
||||
}
|
||||
|
||||
idForScope (scope) {
|
||||
let id = this.idsByScope[scope]
|
||||
if (!id) {
|
||||
@@ -58,8 +76,15 @@ class TreeSitterGrammar {
|
||||
return this.scopesById.get(id)
|
||||
}
|
||||
|
||||
get scopeName () {
|
||||
return this.id
|
||||
scopeNameForScopeId (id) {
|
||||
let result = this.conciseScopesById.get(id)
|
||||
if (!result) {
|
||||
result = this.scopesById.get(id)
|
||||
.slice('syntax--'.length)
|
||||
.replace(/ syntax--/g, '.')
|
||||
this.conciseScopesById.set(id, result)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
activate () {
|
||||
@@ -115,3 +140,11 @@ function normalizeFoldSpecification (spec) {
|
||||
if (spec.start) normalizeFoldSpecification(spec.start)
|
||||
if (spec.end) normalizeFoldSpecification(spec.end)
|
||||
}
|
||||
|
||||
function buildRegex (value) {
|
||||
// Allow multiple alternatives to be specified via an array, for
|
||||
// readability of the grammar file
|
||||
if (Array.isArray(value)) value = value.map(_ => `(${_})`).join('|')
|
||||
if (typeof value === 'string') return new RegExp(value)
|
||||
return null
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
const Parser = require('tree-sitter')
|
||||
const {Point, Range} = require('text-buffer')
|
||||
const {Point, Range, spliceArray} = require('text-buffer')
|
||||
const {Patch} = require('superstring')
|
||||
const {Emitter, Disposable} = require('event-kit')
|
||||
const {Emitter} = require('event-kit')
|
||||
const ScopeDescriptor = require('./scope-descriptor')
|
||||
const TokenizedLine = require('./tokenized-line')
|
||||
const TextMateLanguageMode = require('./text-mate-language-mode')
|
||||
@@ -14,13 +14,6 @@ const WORD_REGEX = /\w/
|
||||
|
||||
class TreeSitterLanguageMode {
|
||||
static _patchSyntaxNode () {
|
||||
if (!Parser.SyntaxNode.prototype.hasOwnProperty('text')) {
|
||||
Object.defineProperty(Parser.SyntaxNode.prototype, 'text', {
|
||||
get () {
|
||||
return this.tree.buffer.getTextInRange(new Range(this.startPosition, this.endPosition))
|
||||
}
|
||||
})
|
||||
}
|
||||
if (!Parser.SyntaxNode.prototype.hasOwnProperty('range')) {
|
||||
Object.defineProperty(Parser.SyntaxNode.prototype, 'range', {
|
||||
get () {
|
||||
@@ -41,7 +34,7 @@ class TreeSitterLanguageMode {
|
||||
this.rootLanguageLayer = new LanguageLayer(this, grammar)
|
||||
this.injectionsMarkerLayer = buffer.addMarkerLayer()
|
||||
|
||||
this.rootScopeDescriptor = new ScopeDescriptor({scopes: [this.grammar.id]})
|
||||
this.rootScopeDescriptor = new ScopeDescriptor({scopes: [this.grammar.scopeName]})
|
||||
this.emitter = new Emitter()
|
||||
this.isFoldableCache = []
|
||||
this.hasQueuedParse = false
|
||||
@@ -52,17 +45,20 @@ class TreeSitterLanguageMode {
|
||||
this.subscription = this.buffer.onDidChangeText(({changes}) => {
|
||||
for (let i = 0, {length} = changes; i < length; i++) {
|
||||
const {oldRange, newRange} = changes[i]
|
||||
this.isFoldableCache.splice(
|
||||
spliceArray(
|
||||
this.isFoldableCache,
|
||||
newRange.start.row,
|
||||
oldRange.end.row - oldRange.start.row,
|
||||
...new Array(newRange.end.row - newRange.start.row)
|
||||
{length: newRange.end.row - newRange.start.row}
|
||||
)
|
||||
}
|
||||
|
||||
this.rootLanguageLayer.update(null)
|
||||
})
|
||||
|
||||
this.rootLanguageLayer.update(null)
|
||||
this.rootLanguageLayer.update(null).then(() =>
|
||||
this.emitter.emit('did-tokenize')
|
||||
)
|
||||
|
||||
// TODO: Remove this once TreeSitterLanguageMode implements its own auto-indentation system. This
|
||||
// is temporarily needed in order to delegate to the TextMateLanguageMode's auto-indent system.
|
||||
@@ -77,7 +73,7 @@ class TreeSitterLanguageMode {
|
||||
}
|
||||
|
||||
getLanguageId () {
|
||||
return this.grammar.id
|
||||
return this.grammar.scopeName
|
||||
}
|
||||
|
||||
bufferDidChange (change) {
|
||||
@@ -118,6 +114,10 @@ class TreeSitterLanguageMode {
|
||||
return new HighlightIterator(this, layerIterators)
|
||||
}
|
||||
|
||||
onDidTokenize (callback) {
|
||||
return this.emitter.on('did-tokenize', callback)
|
||||
}
|
||||
|
||||
onDidChangeHighlighting (callback) {
|
||||
return this.emitter.on('did-change-highlighting', callback)
|
||||
}
|
||||
@@ -385,8 +385,6 @@ class TreeSitterLanguageMode {
|
||||
Section - Backward compatibility shims
|
||||
*/
|
||||
|
||||
onDidTokenize (callback) { return new Disposable(() => {}) }
|
||||
|
||||
tokenizedLineForRow (row) {
|
||||
return new TokenizedLine({
|
||||
openScopes: [],
|
||||
@@ -400,42 +398,15 @@ class TreeSitterLanguageMode {
|
||||
}
|
||||
|
||||
scopeDescriptorForPosition (point) {
|
||||
if (!this.tree) return this.rootScopeDescriptor
|
||||
point = Point.fromObject(point)
|
||||
|
||||
const iterators = []
|
||||
this._forEachTreeWithRange(new Range(point, point), tree => {
|
||||
const rootStartIndex = tree.rootNode.startIndex
|
||||
let node = tree.rootNode.descendantForPosition(point)
|
||||
|
||||
// Don't include anonymous token types like '(' because they prevent scope chains
|
||||
// from being parsed as CSS selectors by the `slick` parser. Other css selector
|
||||
// parsers like `postcss-selector-parser` do allow arbitrary quoted strings in
|
||||
// selectors.
|
||||
if (!node.isNamed) node = node.parent
|
||||
iterators.push({node, rootStartIndex})
|
||||
})
|
||||
|
||||
iterators.sort(compareScopeDescriptorIterators)
|
||||
|
||||
const iterator = this.buildHighlightIterator()
|
||||
const scopes = []
|
||||
for (;;) {
|
||||
const {length} = iterators
|
||||
if (!length) break
|
||||
const iterator = iterators[length - 1]
|
||||
scopes.push(iterator.node.type)
|
||||
iterator.node = iterator.node.parent
|
||||
if (iterator.node) {
|
||||
let i = length - 1
|
||||
while (i > 0 && compareScopeDescriptorIterators(iterator, iterators[i - 1]) < 0) i--
|
||||
if (i < length - 1) iterators.splice(i, 0, iterators.pop())
|
||||
} else {
|
||||
iterators.pop()
|
||||
}
|
||||
for (const scope of iterator.seek(point)) {
|
||||
scopes.push(this.grammar.scopeNameForScopeId(scope, false))
|
||||
}
|
||||
|
||||
scopes.push(this.grammar.id)
|
||||
return new ScopeDescriptor({scopes: scopes.reverse()})
|
||||
for (const scope of iterator.getOpenScopeIds()) {
|
||||
scopes.push(this.grammar.scopeNameForScopeId(scope, false))
|
||||
}
|
||||
return new ScopeDescriptor({scopes})
|
||||
}
|
||||
|
||||
getGrammar () {
|
||||
@@ -529,7 +500,7 @@ class LanguageLayer {
|
||||
}
|
||||
|
||||
updateInjections (grammar) {
|
||||
if (grammar.injectionRegExp) {
|
||||
if (grammar.injectionRegex) {
|
||||
if (!this.currentParsePromise) this.currentParsePromise = Promise.resolve()
|
||||
this.currentParsePromise = this.currentParsePromise.then(async () => {
|
||||
await this._populateInjections(MAX_RANGE, null)
|
||||
@@ -1075,13 +1046,6 @@ function nodeIsSmaller (left, right) {
|
||||
return left.endIndex - left.startIndex < right.endIndex - right.startIndex
|
||||
}
|
||||
|
||||
function compareScopeDescriptorIterators (a, b) {
|
||||
return (
|
||||
a.node.startIndex - b.node.startIndex ||
|
||||
a.rootStartIndex - b.rootStartIndex
|
||||
)
|
||||
}
|
||||
|
||||
function last (array) {
|
||||
return array[array.length - 1]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user