diff --git a/.cirrus.yml b/.cirrus.yml index d52b7a328..c4ba42d30 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,6 +1,6 @@ env: PYTHON_VERSION: 3.12 - GITHUB_TOKEN: ENCRYPTED[!b0ff4671044672be50914a3a10b49af642bd8e0e681a6f4e5855ec5230a5cf9afbc53d9e90239b8d2c79455f014f383f!] + GITHUB_TOKEN: ENCRYPTED[!c394f11378a8bc92ff1b05662ee3e574fc662692e45f0a048aa8cab42fb072b039d83f68fd6953f470af51846063ce46!] # The above token, is a GitHub API Token, that allows us to download RipGrep without concern of API limits # linux_task: @@ -63,7 +63,7 @@ arm_linux_task: memory: 8G env: USE_SYSTEM_FPM: 'true' - ROLLING_UPLOAD_TOKEN: ENCRYPTED[690950798401ec3715e9d20ac29a0859d3c58097038081ff6afeaf4721e661672d34eb952d8a6442bc7410821ab8545a] + ROLLING_UPLOAD_TOKEN: ENCRYPTED[f935c396a9f4bca108ec2fdedb00dbc9be2f4c411f100d577acdab42db59ea134be059ce8535396db8222a2b1eb68c27] prepare_script: - apt-get update - export DEBIAN_FRONTEND="noninteractive" @@ -85,6 +85,7 @@ arm_linux_task: libasound2-dev libnss3 xvfb + - gem install dotenv -v '~> 2.8' - gem install fpm - git submodule init - git submodule update @@ -122,7 +123,7 @@ silicon_mac_task: only_if: $CIRRUS_CRON != "" || $CIRRUS_TAG != "" skip: $CIRRUS_CHANGE_IN_REPO == $CIRRUS_LAST_GREEN_CHANGE macos_instance: - image: ghcr.io/cirruslabs/macos-monterey-xcode:14 + image: ghcr.io/cirruslabs/macos-ventura-xcode:latest memory: 8G env: CSC_LINK: ENCRYPTED[0078015a03bb6cfdbd80113ae5bbb6f448fd4bbbc40efd81bf2cb1554373046b475a4d7c77e3e3e82ac1ce2f7e3d2da5] @@ -130,39 +131,45 @@ silicon_mac_task: APPLEID: ENCRYPTED[549ce052bd5666dba5245f4180bf93b74ed206fe5e6e7c8f67a8596d3767c1f682b84e347b326ac318c62a07c8844a57] APPLEID_PASSWORD: ENCRYPTED[774c3307fd3b62660ecf5beb8537a24498c76e8d90d7f28e5bc816742fd8954a34ffed13f9aa2d1faf66ce08b4496e6f] TEAM_ID: ENCRYPTED[11f3fedfbaf4aff1859bf6c105f0437ace23d84f5420a2c1cea884fbfa43b115b7834a463516d50cb276d4c4d9128b49] - ROLLING_UPLOAD_TOKEN: ENCRYPTED[690950798401ec3715e9d20ac29a0859d3c58097038081ff6afeaf4721e661672d34eb952d8a6442bc7410821ab8545a] + ROLLING_UPLOAD_TOKEN: ENCRYPTED[f935c396a9f4bca108ec2fdedb00dbc9be2f4c411f100d577acdab42db59ea134be059ce8535396db8222a2b1eb68c27] prepare_script: - brew update - - brew install node@16 yarn git python@$PYTHON_VERSION - - python3 -m pip install setuptools + - brew uninstall node + - brew install git python@$PYTHON_VERSION python-setuptools - git submodule init - git submodule update - ln -s /opt/homebrew/bin/python$PYTHON_VERSION /opt/homebrew/bin/python - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" + - mkdir tj_n && cd tj_n + - curl -L https://github.com/tj/n/archive/0ce85771fdff8f4b3e09ade700461b4f58a64444.tar.gz -O + - tar xf 0ce85771fdff8f4b3e09ade700461b4f58a64444.tar.gz + - sudo bash ./n-0ce85771fdff8f4b3e09ade700461b4f58a64444/bin/n 16 + - cd .. + - sudo npm install -g yarn - sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json install_script: - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" - yarn install --ignore-engines || yarn install --ignore-engines build_script: - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" - yarn build - yarn run build:apm build_binary_script: - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" - yarn dist || yarn dist rename_binary_script: - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" - node script/rename.js "Silicon.Mac" binary_artifacts: path: ./binaries/* test_script: - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" - rm -R node_modules/electron; yarn install --check-files - hdiutil mount binaries/*Pulsar*dmg - export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar` - PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list rolling_upload_script: - - export PATH="/opt/homebrew/bin:/opt/homebrew/opt/node@16/bin:$PATH" + - export PATH="/opt/homebrew/bin:$PATH" - cd ./script/rolling-release-scripts - npm install - node ./rolling-release-binary-upload.js cirrus @@ -177,7 +184,7 @@ silicon_mac_task: # intel_mac_task: # alias: mac # macos_instance: -# image: ghcr.io/cirruslabs/macos-monterey-xcode:14 +# image: ghcr.io/cirruslabs/macos-ventura-xcode:latest # memory: 8G # env: # CSC_LINK: ENCRYPTED[0078015a03bb6cfdbd80113ae5bbb6f448fd4bbbc40efd81bf2cb1554373046b475a4d7c77e3e3e82ac1ce2f7e3d2da5] @@ -190,30 +197,32 @@ silicon_mac_task: # - echo A | softwareupdate --install-rosetta # - arch -x86_64 xcode-select --install # - arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" -# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH" +# - export PATH="/usr/local/bin:$PATH" # - arch -x86_64 brew update -# - arch -x86_64 brew install node@16 yarn git python@$PYTHON_VERSION +# - arch -x86_64 brew uninstall node +# - arch -x86_64 brew install node@16 git python@$PYTHON_VERSION python-setuptools # - ln -s /usr/local/bin/python$PYTHON_VERSION /usr/local/bin/python +# - npm install -g yarn # - git submodule init # - git submodule update # - sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json # install_script: -# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH" +# - export PATH="/usr/local/bin:$PATH" # - arch -x86_64 npx yarn install --ignore-engines || arch -x86_64 npx yarn install --ignore-engines # build_script: -# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH" +# - export PATH="/usr/local/bin:$PATH" # - arch -x86_64 npx yarn build # - arch -x86_64 yarn run build:apm # build_binary_script: -# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH" +# - export PATH="/usr/local/bin:$PATH" # - arch -x86_64 npx yarn dist || arch -x86_64 npx yarn dist # rename_binary_script: -# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH" +# - export PATH="/usr/local/bin:$PATH" # - node script/rename.js "Intel.Mac" # binary_artifacts: # path: ./binaries/* # test_script: -# - export PATH="/usr/local/opt/node@16/bin:/usr/local/bin:$PATH" +# - export PATH="/usr/local/bin:$PATH" # - rm -R node_modules/electron; yarn install --check-files # - hdiutil mount binaries/*Pulsar*dmg # - export BINARY_NAME=`ls /Volumes/Pulsar*/Pulsar.app/Contents/MacOS/Pulsar` diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 000000000..cd878a46f --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +*.ts +vendor diff --git a/.eslintrc.js b/.eslintrc.js index 520c2aeb7..41df8c581 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -19,6 +19,20 @@ module.exports = { asyncArrow: "always", named: "never" }], + "no-constant-condition": "off", + "no-unused-vars": [ + "warn", + { + varsIgnorePattern: '^_', + argsIgnorePattern: '^_' + } + ], + "node/no-missing-require": [ + "error", + { + allowModules: ["atom"] + } + ], "node/no-unpublished-require": [ "error", { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e7e3b70fa..e45f2794e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,11 +24,21 @@ jobs: build: strategy: matrix: - os: [ ubuntu-20.04, windows-latest, macos-latest ] + os: [ ubuntu-latest, macos-latest, windows-latest ] + include: + - os: ubuntu-latest + image: "debian:10" fail-fast: false runs-on: ${{ matrix.os }} + container: ${{ matrix.image }} + outputs: + timestamp: ${{ steps.linux-binary-version.outputs.timestamp }} steps: + - name: Install build dependencies - Linux + if: ${{ runner.os == 'Linux' }} + run: apt-get update && apt-get install -y git python3 python3-pip make gcc g++ libx11-dev libxkbfile-dev pkg-config libsecret-1-dev rpm xvfb ffmpeg zstd + - name: Checkout the latest code uses: actions/checkout@v3 @@ -38,6 +48,10 @@ jobs: node-version: ${{ env.NODE_VERSION }} - name: Setup Python + # actions/setup-python's copy of Python is compiled for too new glibc, + # which won't work in a Debian 10 Docker image. + # Get Python from apt repos instead on Linux. + if: ${{ runner.os != 'Linux' }} uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} @@ -48,11 +62,30 @@ jobs: # out of the box. 'setuptools' package provides 'distutils'. run: python3 -m pip install setuptools + - name: Install Yarn - Linux + if: ${{ runner.os == 'Linux' }} + run: npm install -g yarn + - name: Setup Git Submodule + if: ${{ runner.os != 'Linux' }} run: | git submodule init git submodule update + - name: Setup Git Submodule - Linux + if: ${{ runner.os == 'Linux' }} + run: | + git config --global --add safe.directory /__w/pulsar/pulsar + git submodule init + git submodule update + + - name: Set Timestamp for Binary Version - Linux + id: linux-binary-version + if: ${{ runner.os == 'Linux' }} + # This output is currently only set for the sake of the Rolling binary upload script. + # See the "test-and-upload-Linux" job below. + run: echo "timestamp=`date -u +%Y%m%d%H`" >> "$GITHUB_OUTPUT" + - name: Check Pulsar Version if: ${{ runner.os != 'Windows' }} run: sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json @@ -86,6 +119,15 @@ jobs: yarn build yarn run build:apm + - name: Cache Pulsar dependencies - Linux + if: ${{ runner.os == 'Linux' }} + uses: actions/cache/save@v3 + with: + path: | + node_modules + packages + key: Linux-dependencies-${{ github.sha }}-${{ github.workflow }} + # macOS Signing Stuff - name: Build Pulsar Binaries (macOS) (Signed) if: ${{ runner.os == 'macOS' && github.event_name == 'push' }} @@ -135,21 +177,19 @@ jobs: if: ${{ runner.os == 'Windows' }} run: node ./script/rename.js "Windows" + - name: Cache Pulsar Binaries - Linux + if: ${{ runner.os == 'Linux' }} + uses: actions/cache/save@v3 + with: + path: ./binaries + key: pulsar-Linux-Binaries-${{ github.sha }}-${{ github.workflow }} + - name: Upload Binary Artifacts uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }} Binaries path: ./binaries/* - - name: Test Binary - Linux - if: ${{ (runner.os == 'Linux') && env.RUN_LINUX_VT }} - run: | - rm -R node_modules/electron; yarn install --check-files - ./binaries/*AppImage --appimage-extract - export BINARY_NAME='squashfs-root/pulsar' - mkdir -p ./tests/videos - Xvfb -screen 0 1024x768x24+32 :99 & nohup ffmpeg -video_size 1024x768 -f x11grab -i :99.0 ./tests/videos/out.mpg & DISPLAY=:99 PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list - - name: Test Binary - Windows if: runner.os == 'Windows' && env.RUN_WINDOWS_VT == true # TODO: Convert script to PowerShell @@ -168,7 +208,7 @@ jobs: PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml arch -x86_64 npx playwright test --reporter=junit,list - name: Add binaries to Rolling Release Repo - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' && runner.os != 'Linux' }} # We only want to upload rolling binaries if they are a commit to master # Otherwise we want to not upload if it's a PR or manually triggered build run: | @@ -177,6 +217,74 @@ jobs: node ./rolling-release-binary-upload.js - name: Upload Video Artifacts + # Run whether this job passed or failed, unless explicitly cancelled. + if: ${{ !cancelled() && runner.os != 'Linux' }} + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.os }} Videos + path: ./tests/videos/** + + + test-and-upload-Linux: + # I couldn't figure out how to get these visual tests to actually run in the + # Debian Docker environment. If anyone can make it work, feel free to + # re-combine visual testing on Linux back into the main build job above! + # - DeeDeeG + runs-on: ubuntu-latest + needs: build + + steps: + - name: Checkout the latest code + uses: actions/checkout@v3 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + + - name: Restore Cached Pulsar Binaries - Linux + if: ${{ runner.os == 'Linux' }} + uses: actions/cache/restore@v3 + with: + path: ./binaries + key: pulsar-Linux-Binaries-${{ github.sha }}-${{ github.workflow }} + + - name: Restore Cached Pulsar dependencies - Linux + if: ${{ runner.os == 'Linux' }} + uses: actions/cache/restore@v3 + with: + path: | + node_modules + packages + key: Linux-dependencies-${{ github.sha }}-${{ github.workflow }} + + - name: Test Binary - Linux + if: ${{ (runner.os == 'Linux') && env.RUN_LINUX_VT }} + run: | + rm -R node_modules/electron; yarn install --check-files + ./binaries/*AppImage --appimage-extract + export BINARY_NAME='squashfs-root/pulsar' + mkdir -p ./tests/videos + Xvfb -screen 0 1024x768x24+32 :99 & nohup ffmpeg -video_size 1024x768 -f x11grab -i :99.0 ./tests/videos/out.mpg & DISPLAY=:99 PLAYWRIGHT_JUNIT_OUTPUT_NAME=report.xml npx playwright test --reporter=junit,list + + - name: Check Pulsar Version + if: ${{ runner.os != 'Windows' }} + run: sed -i -e "s/[0-9]*-dev/${TIMESTAMP}/g" package.json + env: + TIMESTAMP: ${{needs.build.outputs.timestamp}} + + - name: Add binaries to Rolling Release Repo - Linux + if: ${{ github.event_name == 'push' && runner.os == 'Linux' }} + # We only want to upload rolling binaries if they are a commit to master + # Otherwise we want to not upload if it's a PR or manually triggered build + run: | + cd ./script/rolling-release-scripts + npm install + node ./rolling-release-binary-upload.js + + - name: Upload Video Artifacts - Linux + # Run whether this job passed or failed, unless explicitly cancelled. + if: ${{ !cancelled() && runner.os == 'Linux' }} uses: actions/upload-artifact@v3 with: name: ${{ matrix.os }} Videos diff --git a/.github/workflows/package-tests-linux.yml b/.github/workflows/package-tests-linux.yml index ab7659fb7..844e948a6 100644 --- a/.github/workflows/package-tests-linux.yml +++ b/.github/workflows/package-tests-linux.yml @@ -116,7 +116,9 @@ jobs: - package: "spell-check" - package: "status-bar" - package: "styleguide" - # - package: "symbols-view" + - package: "symbol-provider-ctags" + - package: "symbol-provider-tree-sitter" + - package: "symbols-view" - package: "tabs" - package: "timecop" - package: "tree-view" diff --git a/CHANGELOG.md b/CHANGELOG.md index 693048ecf..e27303b11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,183 @@ better support for "def" elements (example - don't syntax `default` or `definition` as a `def`, but highlights `p/defresolver`) +## 1.115.0 + +- Fixed some folds in Ruby like `unless`, some blocks, multiline comments, function calls, and different array syntaxes for strings and keywords. +- Improved the accuracy of indentation hinting in modern Tree-sitter grammars, especially in multi-cursor scenarios. +- Improved the ability of the user to opt into a specific kind of grammar for a specific language. +- Changed the behavior of the `grammar-selector` package so that it will show the user's preferred grammar for a specific language. +- Updated to version `0.20.9` of `web-tree-sitter`. +- Improved syntax highlighting, indentation, and code folding in various languages, including TypeScript, shell scripts, Ruby, and C/C++. + +### Pulsar +- Fixed: Fixed folds for Ruby [@mauricioszabo](https://github.com/pulsar-edit/pulsar/pull/956) +- Fixed: Tree-sitter fixes: 1.115 edition [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/941) +- Updated: cirrus: Update Rolling upload token again [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/960) +- Fixed: cirrus: Various fixes for macOS Cirrus CI [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/961) +- Fixed: Fix(fuzzy-finder) fs.lstatSync throws Exception if not a file or dir [@schadomi7](https://github.com/pulsar-edit/pulsar/pull/944) +- Updated: CI: Update Rolling upload token for Cirrus CI [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/936) +- Updated: Cirrus: Install older dotenv gem version ~> 2.8 (< 3) [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/937) + +## 1.114.0 + +- Prevented an exception raised in the command palette in certain unusual filtering scenarios. +- Refrain from rendering anchor icons when showing a package's README file in `settings-view`. +- Build Linux binaries on Debian 10, for older glibc and compatibility with older Linux distros. +- Fixed a rendering error in `atom.ui.markdown.render` when `disableMode` was set to `"strict"` and the input contained HTML line breaks. +- Added support for the semanticolor package in modern tree-sitter grammars. +- Added new `--force` flag to `ppm link` command that will uninstall any conflicting package already installed. +- Added language entity colors to `syntax-variables.less`. +- Numerous Tree-Sitter Grammar syntax highlighting fixes. +- Bumped dugite to make the github package compatible with ARM Linux. + +### Pulsar +- Fixed: fix(tree-sitter): pass node text to grammar [@claytonrcarter](https://github.com/pulsar-edit/pulsar/pull/860) +- Fixed: Fix issue with Markdown rendering after line break in strict mode [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/889) +- Updated: Update README badges [@Daeraxa](https://github.com/pulsar-edit/pulsar/pull/891) +- Updated: Update copyright year to 2024 [@Daeraxa](https://github.com/pulsar-edit/pulsar/pull/870) +- Added: CI: build Linux x86-64 binaries on older Linux [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/858) +- Fixed: Tree-sitter rolling fixes (January edition) [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/859) +- Fixed: Fix failing spec [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/902) +- Fixed: [settings-view] Don't display heading anchor icons within a README [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/905) +- Updated: ppm: Update ppm to commit 241d794f326b63b5abdb9769 [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/908) +- Fixed: script: Update version check in Rolling release binary upload script to exclude '-dev' versions [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/903) +- Fixed: CI: Fix tag Linux binaries are uploaded to for Rolling [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/901) +- Fixed: [command-palette] Guard against failure to highlight a match [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/913) +- Fixed: `symbols-view` rolling fixes [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/861) +- Fixed: Tree-sitter rolling fixes (February) [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/906) +- Updated: [meta] Update Cirrus `GITHUB_TOKEN` [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/924) +- Updated: deps: Update github to v0.36.20-pretranspiled to bump dugite [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/925) +- Fixed: [symbols-view] Remap go-to-declaration commands on Windows/Linux [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/926) + +### PPM +- Fixed: Fix test failure due to missing atom command [@toddy15](https://github.com/pulsar-edit/ppm/pull/124) +- Updated: Update syntax-variables.less to include language entity colors [@savetheclocktower](https://github.com/pulsar-edit/ppm/pull/123) +- Added: feat(link): add --force flag [@claytonrcarter](https://github.com/pulsar-edit/ppm/pull/122) + +### github +- Updated: Bump dugite to 2.5.2 [@DeeDeeG](https://github.com/pulsar-edit/github/pull/39) + +## 1.113.0 + +- Enabled Modern Tree-sitter Grammars by default +- Added a modern Tree-sitter grammar for PHP. +- Fix a measurement issue that was causing visual glitches in the `github` package's diff views. +- Enabled the core `symbols-view` package to accept symbols from a number of sources, including Tree-sitter grammars and IDE packages. +- Switch default to false for converting ASCII emoticons to emoji when rendering Markdown. +- Fix certain find-and-replace scenarios when the "Preserve Case During Replace" setting is enabled. +- Fix an issue in `symbols-view` when returning from visiting a symbol declaration. + +### Pulsar +- Fixed: Tree-sitter fixes for December (including a PHP grammar!) [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/852) +- Added: Make `useExperimentalModernTreeSitter` the default... [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/855) +- Fixed: Ensure editor is visible before measuring block decorations [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/854) +- Added: Overhaul `symbols-view` [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/829) +- Added: Default to no emoji when rendering Markdown [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/850) + +### find-and-replace +- Fixed: [find-and-replace] Fix `capitalize` utility [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/849) + +### symbols-view +- Fixed: [symbols-view] Fix issue with returning from a declaration [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/864) + +## 1.112.1 + +- Fixed a bug in PPM that prevented package publishing. + +### Pulsar +- Bumped: ppm: Update ppm to commit 0bc207133b26de82aa28500e [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/845) +- Bumped: ppm: Update ppm to commit 7dfd9ca8cf877391fc6ef1d5 [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/842) + +### PPM +- Fixed: Fix placement of `setTimeout` [@savetheclocktower](https://github.com/pulsar-edit/ppm/pull/118) +- Fixed: Fix bugs found in `publish` after 1.112 release [@savetheclocktower](https://github.com/pulsar-edit/ppm/pull/116) + +## 1.112.0 + +- Fixed github package not giving feedback when a token with the wrong scopes was entered, tweak scope-checking logic to match expectations, and log incorrect scopes. +- Various cleanups, maintenance and upkeep of the PPM repo. +- Added options for a user to control when to automatically show or hide the wrap-guide; "Always", "When soft wrap is enabled", and "When soft wrap at preferred line length is enabled". +- Updated network handling in PPM to something newer and more secure. +- Updated most of PPM's code to use async/await and promises internally. +- Created `atom.ui.fuzzyMatcher` API, moving the Pulsar `fuzzy-finder` module into the core of the editor for community packages to utilize. +- Fixed an issue that prevented Pulsar from inheriting the directory from which the `pulsar` binary was run. + +### Pulsar +- Added: [tree-sitter] Share config caches between `ScopeResolver`s [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/836) +- Bumped: deps: Update github to v0.36.19-pretranspiled (fix silent failure when inputting a token with incorrect scopes) [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/838) +- Bumped: ppm: Update ppm to commit 957acbd90cfc9f361c183b3c [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/837) +- Added: Return to original logic for `ATOM_DISABLE_SHELLING_OUT_FOR_ENVIRONMENT` [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/831) +- Added: Moving fuzzy-native to core [@mauricioszabo](https://github.com/pulsar-edit/pulsar/pull/774) +- Fixed: Tree-sitter rolling fixes for November [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/819) +- Fixed: CI: Update Rolling upload token for Cirrus [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/812) +- Bumped: ppm: Update to commit 13fb2845e00d7e04c2461f93 [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/809) +- Added: Ability to indicate when to automatically show or hide the wrap-guide [@Trigan2025](https://github.com/pulsar-edit/pulsar/pull/780) + +### PPM +- Bumped: fix(deps): update dependency semver to v7.5.2 [security] [@renovate](https://github.com/pulsar-edit/ppm/pull/114) +- Added: Configure Renovate [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/110) +- Added: Migrate from `rimraf` to NodeJS `fs` [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/108) +- Added: Implement Codacy Recommendations [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/113) +- Removed: Prune outdated Deps [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/109) +- Removed: Remove unused Variables [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/112) +- Added: Add Codacy and Friends Configuration [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/111) +- Removed: src: Delete unused code in uninstall.js [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/104) +- Fixed: src: Fix usage/help text (and error message) for -b/-t flags for ppm install [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/105) +- Added: Repository Cleanup [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/107) +- Fixed: Fix Newer NodeJS CI [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/106) +- Fixed: src: Stop pinging backend during package uninstalls [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/103) +- Added: Asyncify without topmost interface [@2colours](https://github.com/pulsar-edit/ppm/pull/95) +- Fixed: CI: Work around a weird bug in Yarn v1.x [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/101) +- Fixed: src: Rebrand two lines of "ppm --version" output [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/100) +- Bumped: deps: Bump nan for compatibility with newer NodeJS [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/97) +- Fixed: Fix Error Handling [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/99) +- Removed: Remove `request` Migrate to `superagent` && Fix CI [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/87) + +### github +- Added: lib: Allow parent scopes when checking if each required scope is set [@DeeDeeG](https://github.com/pulsar-edit/github/pull/38) + +## 1.111.0 + +- Added a new "UI" API to `atom`, accessible via `atom.ui`. This exposes a `markdown` object, allowing community packages to offload Markdown handling to the core editor. +- Fine-tuned/deduped dependencies to remove ~35.5 MB from Pulsar's installed size. +- Fixed an issue that sometimes caused text to shift or disappear after an editor pane regains focus. +- Fixed scoping/highlighting of single-quoted (`'...'`) and C-style (`$'...'`) strings in shell scripts. +- Fixed an issue with the "Dismiss this Version" button (in the `pulsar-updater` package). +- Fixed an issue with how Linux Pulsar binaries were built, to ensure compatibility with non-bleeding edge glibc versions. (Compatibility with even older glibc versions is still being looked into, for the folks on older or RHEL-compatible distros.) + +### Pulsar +- Fixed: meta: Update CirrusCI GitHub Token [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/804) +- Bumped: deps: Update `github`, for `dugite` deduping purposes [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/799) +- Fixed: Tree-sitter running fixes (October) [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/789) +- Fixed: Prevent "half screen" bug by resetting scroll position when editor regains focus [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/798) +- Added: [core] New `UI` API [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/763) +- Fixed: CI: Build binaries for tag pushes (GitHub Actions) [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/782) +- Added: [DOCS] Add non-macOS keybindings for fuzzy-finder readme [@Daeraxa](https://github.com/pulsar-edit/pulsar/pull/796) +- Removed: Remove Teletype from Welcome guide [@Daeraxa](https://github.com/pulsar-edit/pulsar/pull/793) +- Fixed: CI: Python 3.12-related fixes on Cirrus CI [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/794) +- Fixed: CI: Work around missing 'distutils' for Python 3.12+ (GHA round two) [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/795) +- Added: [meta] Create Workflow to validate WASM Grammar Changes [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/740) +- Fixed: πŸ› βœ… Fix caching for "Dismiss this Version" in pulsar-updater [@kiskoza](https://github.com/pulsar-edit/pulsar/pull/785) +- Fixed: [tree-sitter] Fix proliferation of extra injection layers [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/783) +- Added: CI: Increase timeout length for macOS binary builds [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/781) +- Fixed: Fix the matching of `$'...'` strings. [@danfuzz](https://github.com/pulsar-edit/pulsar/pull/776) +- Fixed: [meta] Install Python package `setuptools` && Use Python `3.12.x` [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/779) +- Fixed: Update `web-tree-sitter` to include `isalnum` builtin [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/770) +- Fixed: [meta] Build x86 Linux binaries on Ubuntu 20.04, for older (more compatible) glibc [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/760) +- Bumped: [core] Bump `git-utils`: `5.7.1` => `^5.7.3` [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/772) +- Removed: [core] Cleanup Unused Deps [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/771) + +### github +- Bumped: deps: Update `whats-my-line` to bump `dugite` to 2.1.0 [@DeeDeeG](https://github.com/pulsar-edit/github/pull/36) + +### whats-my-line +- Bumped: Pin `dugite` to `2.1.0` [@confused-Techie](https://github.com/pulsar-edit/whats-my-line/pull/7) +- Bumped: Bump dugite && Bump `package.json` version [@confused-Techie](https://github.com/pulsar-edit/whats-my-line/pull/2) +- Added: Add dugite tests [@confused-Techie](https://github.com/pulsar-edit/whats-my-line/pull/4) +- Removed: Remove TypeScript [@confused-Techie](https://github.com/pulsar-edit/whats-my-line/pull/3) +- Added: Setup Tests and Modernize [@confused-Techie](https://github.com/pulsar-edit/whats-my-line/pull/1) + ## 1.110.0 - Made the modification of `editor.preferredLineLength` configurable within `wrap-guide` when changing `wrap-guide.columns` diff --git a/LICENSE.md b/LICENSE.md index 50a586694..5c07eeda9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022-2023 Pulsar-Edit +Copyright (c) 2022-2024 Pulsar-Edit Original work copyright (c) 2011-2022 GitHub Inc. Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/README.md b/README.md index 149f4f8b9..82f1a1258 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,9 @@ [![Badge Discussions]][Discussions]   [![Badge Discord]][Discord]   -[![Badge Reddit]][Reddit] +[![Badge Reddit]][Reddit]   +[![Badge Mastodon]][Mastodon]   +[![Badge Lemmy]][Lemmy]   [![Badge Status]][Status]   [![Badge License]][License] @@ -51,6 +53,8 @@ [Status]: https://cirrus-ci.com/github/pulsar-edit/pulsar/master [Codacy]: https://app.codacy.com/gh/pulsar-edit/pulsar [Reddit]: https://www.reddit.com/r/pulsaredit/ +[Mastodon]: https://fosstodon.org/@pulsaredit/ +[Lemmy]: https://lemmy.ml/c/pulsaredit/ [#]: # @@ -72,14 +76,18 @@ [Badge OpenCollective]: https://opencollective.com/pulsar-edit/tiers/badge.svg -[Badge Discussions]: https://img.shields.io/github/discussions/pulsar-edit/.github?style=for-the-badge&labelColor=78af9f&color=5a8377 +[Badge Discussions]: https://img.shields.io/github/discussions/pulsar-edit/.github?style=for-the-badge&logo=GitHub&labelColor=50555b&color=35393d [Badge Upstream]: https://img.shields.io/badge/Upstream_Status-Sunset-966227.svg?style=for-the-badge&labelColor=c38033 [Badge Discord]: https://img.shields.io/badge/Discord-4b7494.svg?style=for-the-badge&labelColor=6399c4&logoColor=white&logo=Discord [Badge License]: https://img.shields.io/badge/License-MIT-ac7f31.svg?style=for-the-badge&labelColor=e5ab42 [Badge Crowdin]: https://badges.crowdin.net/pulsar-edit/localized.svg [Badge Codacy]: https://app.codacy.com/project/badge/Grade/24873ecb93dc4c1d865202ce5b24efc1 -[Badge Reddit]: https://img.shields.io/reddit/subreddit-subscribers/pulsaredit?style=for-the-badge&label=Reddit&logoColor=white&logo=Reddit&labelColor=e05d44&color=b14835 + + +[Badge Reddit]: https://img.shields.io/badge/%2Fr%2Fpulsaredit-e05d44?style=for-the-badge&logo=Reddit&logoColor=white&labelColor=e05d44&color=b14835 [Badge Status]: https://img.shields.io/cirrus/github/pulsar-edit/pulsar?style=for-the-badge&labelColor=c77b7f&label=Build%20Status&color=8d575a +[Badge Mastodon]: https://img.shields.io/mastodon/follow/109416671848539153?domain=https%3A%2F%2Ffosstodon.org%2F&style=for-the-badge&logo=Mastodon&logoColor=white&label=Mastodon&labelColor=a0a0d8&color=7c7cc1 +[Badge Lemmy]: https://img.shields.io/lemmy/pulsaredit%40lemmy.ml?style=for-the-badge&logo=Lemmy&logoColor=white&label=Lemmy&labelColor=64ad82&color=1d9b52 diff --git a/docs/Pulsar-API-Documentation.md b/docs/Pulsar-API-Documentation.md index df38ca986..0c2cfe448 100644 --- a/docs/Pulsar-API-Documentation.md +++ b/docs/Pulsar-API-Documentation.md @@ -7,6 +7,23 @@
Clipboard
+
Container
+

A container capture. When another capture's node is contained by the +definition capture's node, it gets added to this instance.

+
+
CaptureOrganizer
+

Keeps track of @definition.* captures and the captures they may contain.

+
+
InvalidProviderError ⇐ Error
+

An error thrown when a newly added symbol provider does not conform to its +contract.

+
+
ListController
+

A class for setting various UI properties on a symbol list palette. This is a +privilege given to the β€œmain” (or exclusive) provider for a given task.

+

This is how we allow a provider to communicate its state to the UI without +giving it full control over the SelectListView used to show results.

+
## Constants @@ -173,6 +190,9 @@ style: Exclusively used for the style attribute

## Functions
+
renderMarkdown(content, givenOpts) β‡’ string
+

Takes a Markdown document and renders it as HTML.

+
beforeEach()
beforeEach()
@@ -199,6 +219,25 @@ style: Exclusively used for the style attribute

beforeEach()
+
isIterable(obj) β‡’ Boolean
+

Ensures an object can be iterated over.

+

The contract with the symbol providers is that they return an object that +gives us symbol objects when we iterate over it. It'll probably be an array, +but we're cool with anything iterable.

+
+
timeout(ms) β‡’ Promise.<true>
+

Returns a promise that resolves after a given number of milliseconds.

+
+
getBadgeTextVariant(text) β‡’ String
+

Given a string of text, returns a hexadecimal character from 0 to f to +represent a classification β€œbucket.” This is used when assigning colors to +various symbol badges.

+
+
badge(text, options) β‡’ Element
+

Return a DOM element for a badge for a given symbol tag name.

+
+
beforeEach()
+
beforeEach()
beforeEach()
@@ -355,6 +394,37 @@ atom.clipboard.write('hello'); console.log(atom.clipboard.read()); ``` + + +## Container +A container capture. When another capture's node is contained by the +definition capture's node, it gets added to this instance. + +**Kind**: global class + + +## CaptureOrganizer +Keeps track of @definition.* captures and the captures they may contain. + +**Kind**: global class + + +## InvalidProviderError ⇐ Error +An error thrown when a newly added symbol provider does not conform to its +contract. + +**Kind**: global class +**Extends**: Error + + +## ListController +A class for setting various UI properties on a symbol list palette. This is a +privilege given to the β€œmain” (or _exclusive_) provider for a given task. + +This is how we allow a provider to communicate its state to the UI without +giving it full control over the `SelectListView` used to show results. + +**Kind**: global class ## etch @@ -625,6 +695,68 @@ This file aims to run some short simple tests against `update.js`. Focusing **Babel**: +## beforeEach() +**Kind**: global function +**Babel**: + + +## isIterable(obj) β‡’ Boolean +Ensures an object can be iterated over. + +The contract with the symbol providers is that they return an object that +gives us symbol objects when we iterate over it. It'll probably be an array, +but we're cool with anything iterable. + +**Kind**: global function +**Returns**: Boolean - Whether the item will respond correctly to a `for..of` + loop. + +| Param | Type | Description | +| --- | --- | --- | +| obj | ? | Anything. | + + + +## timeout(ms) β‡’ Promise.<true> +Returns a promise that resolves after a given number of milliseconds. + +**Kind**: global function +**Returns**: Promise.<true> - A promise that resolves with `true` as its argument. + +| Param | Type | Description | +| --- | --- | --- | +| ms | Number | Number of milliseconds after which to resolve. | + + + +## getBadgeTextVariant(text) β‡’ String +Given a string of text, returns a hexadecimal character from `0` to `f` to +represent a classification β€œbucket.” This is used when assigning colors to +various symbol badges. + +**Kind**: global function +**Returns**: String - A single character that represents a hexadecimal digit. + +| Param | Type | Description | +| --- | --- | --- | +| text | String | The text of the badge. | + + + +## badge(text, options) β‡’ Element +Return a DOM element for a badge for a given symbol tag name. + +**Kind**: global function +**Returns**: Element - An element for adding to an `atom-select-view` entry. + +| Param | Type | Description | +| --- | --- | --- | +| text | String | The text of the tag. | +| options | Object | Options. Defaults to an empty object. | +| options.variant | Boolean | Whether to add a class name for the badge's β€œvariant.” If enabled, this will attempt to assign a different badge color for each kind of tag. Optional; defaults to `false`. | + + + ## beforeEach() **Kind**: global function **Babel**: diff --git a/docs/Source-Code-Documentation.md b/docs/Source-Code-Documentation.md index 4651c1d42..0c5b0f5d5 100644 --- a/docs/Source-Code-Documentation.md +++ b/docs/Source-Code-Documentation.md @@ -7,6 +7,23 @@
Clipboard
+
Container
+

A container capture. When another capture's node is contained by the +definition capture's node, it gets added to this instance.

+
+
CaptureOrganizer
+

Keeps track of @definition.* captures and the captures they may contain.

+
+
InvalidProviderError ⇐ Error
+

An error thrown when a newly added symbol provider does not conform to its +contract.

+
+
ListController
+

A class for setting various UI properties on a symbol list palette. This is a +privilege given to the β€œmain” (or exclusive) provider for a given task.

+

This is how we allow a provider to communicate its state to the UI without +giving it full control over the SelectListView used to show results.

+
## Constants @@ -173,6 +190,9 @@ style: Exclusively used for the style attribute

## Functions
+
renderMarkdown(content, givenOpts) β‡’ string
+

Takes a Markdown document and renders it as HTML.

+
beforeEach()
beforeEach()
@@ -199,6 +219,25 @@ style: Exclusively used for the style attribute

beforeEach()
+
isIterable(obj) β‡’ Boolean
+

Ensures an object can be iterated over.

+

The contract with the symbol providers is that they return an object that +gives us symbol objects when we iterate over it. It'll probably be an array, +but we're cool with anything iterable.

+
+
timeout(ms) β‡’ Promise.<true>
+

Returns a promise that resolves after a given number of milliseconds.

+
+
getBadgeTextVariant(text) β‡’ String
+

Given a string of text, returns a hexadecimal character from 0 to f to +represent a classification β€œbucket.” This is used when assigning colors to +various symbol badges.

+
+
badge(text, options) β‡’ Element
+

Return a DOM element for a badge for a given symbol tag name.

+
+
beforeEach()
+
beforeEach()
beforeEach()
@@ -363,6 +402,37 @@ atom.clipboard.write('hello'); console.log(atom.clipboard.read()); ``` + + +## Container +A container capture. When another capture's node is contained by the +definition capture's node, it gets added to this instance. + +**Kind**: global class + + +## CaptureOrganizer +Keeps track of @definition.* captures and the captures they may contain. + +**Kind**: global class + + +## InvalidProviderError ⇐ Error +An error thrown when a newly added symbol provider does not conform to its +contract. + +**Kind**: global class +**Extends**: Error + + +## ListController +A class for setting various UI properties on a symbol list palette. This is a +privilege given to the β€œmain” (or _exclusive_) provider for a given task. + +This is how we allow a provider to communicate its state to the UI without +giving it full control over the `SelectListView` used to show results. + +**Kind**: global class ## etch @@ -633,6 +703,68 @@ This file aims to run some short simple tests against `update.js`. Focusing **Babel**: +## beforeEach() +**Kind**: global function +**Babel**: + + +## isIterable(obj) β‡’ Boolean +Ensures an object can be iterated over. + +The contract with the symbol providers is that they return an object that +gives us symbol objects when we iterate over it. It'll probably be an array, +but we're cool with anything iterable. + +**Kind**: global function +**Returns**: Boolean - Whether the item will respond correctly to a `for..of` + loop. + +| Param | Type | Description | +| --- | --- | --- | +| obj | ? | Anything. | + + + +## timeout(ms) β‡’ Promise.<true> +Returns a promise that resolves after a given number of milliseconds. + +**Kind**: global function +**Returns**: Promise.<true> - A promise that resolves with `true` as its argument. + +| Param | Type | Description | +| --- | --- | --- | +| ms | Number | Number of milliseconds after which to resolve. | + + + +## getBadgeTextVariant(text) β‡’ String +Given a string of text, returns a hexadecimal character from `0` to `f` to +represent a classification β€œbucket.” This is used when assigning colors to +various symbol badges. + +**Kind**: global function +**Returns**: String - A single character that represents a hexadecimal digit. + +| Param | Type | Description | +| --- | --- | --- | +| text | String | The text of the badge. | + + + +## badge(text, options) β‡’ Element +Return a DOM element for a badge for a given symbol tag name. + +**Kind**: global function +**Returns**: Element - An element for adding to an `atom-select-view` entry. + +| Param | Type | Description | +| --- | --- | --- | +| text | String | The text of the tag. | +| options | Object | Options. Defaults to an empty object. | +| options.variant | Boolean | Whether to add a class name for the badge's β€œvariant.” If enabled, this will attempt to assign a different badge color for each kind of tag. Optional; defaults to `false`. | + + + ## beforeEach() **Kind**: global function **Babel**: diff --git a/integration/workspace.spec.js b/integration/workspace.spec.js index f82e8b469..10c49797a 100644 --- a/integration/workspace.spec.js +++ b/integration/workspace.spec.js @@ -14,7 +14,7 @@ const languages = [ // {language: "gfm", code: '10', checks: {numeric: '10'}}, // {language: "git", code: '10', checks: {numeric: '10'}}, {language: "Go", code: '10', checks: {numeric: '10'}}, - {language: "HTML", code: '', checks: {string: '10'}}, + {language: "HTML", code: '', checks: {quoted: '"10"'}}, {language: "XML", code: '', checks: {string: '"10"'}}, // {language: "hyperlink", code: '10', checks: {numeric: '10'}}, {language: "JSON", code: '10', checks: {numeric: '10'}}, @@ -23,7 +23,7 @@ const languages = [ // {language: "mustache", code: '10', checks: {numeric: '10'}}, {language: "Objective C", code: '10', checks: {numeric: '10'}}, {language: "Perl", code: '10', checks: {numeric: '10'}}, - {language: "PHP", code: '', checks: {numeric: '10'}}, + {language: "PHP", code: '', checks: {variable: '$foo'}}, // {language: "property-list", code: '10', checks: {numeric: '10'}}, {language: "Python", code: '10', checks: {numeric: '10'}}, {language: "Ruby on Rails", code: '10', checks: {numeric: '10'}}, diff --git a/package.json b/package.json index 3abae3d90..0e88e504f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pulsar", "author": "Pulsar-Edit ", "productName": "Pulsar", - "version": "1.110.0-dev", + "version": "1.115.0-dev", "description": "A Community-led Hyper-Hackable Text Editor", "branding": { "id": "pulsar", @@ -30,6 +30,7 @@ "dependencies": { "@atom/source-map-support": "^0.3.4", "@babel/core": "7.18.6", + "@pulsar-edit/fuzzy-native": "https://github.com/pulsar-edit/fuzzy-native.git#c6ddd2e0ace7b3cfe8082fcbe5985c49f76da5b8", "about": "file:packages/about", "archive-view": "file:packages/archive-view", "async": "3.2.4", @@ -62,6 +63,7 @@ "deprecation-cop": "file:packages/deprecation-cop", "dev-live-reload": "file:packages/dev-live-reload", "document-register-element": "https://github.com/pulsar-edit/document-register-element.git#1f5868f", + "dompurify": "^3.0.6", "encoding-selector": "file:packages/encoding-selector", "etch": "0.14.1", "event-kit": "^2.5.3", @@ -75,7 +77,7 @@ "fuzzy-finder": "file:packages/fuzzy-finder", "git-diff": "file:packages/git-diff", "git-utils": "^5.7.3", - "github": "https://codeload.github.com/pulsar-edit/github/tar.gz/refs/tags/v0.36.17-pretranspiled", + "github": "https://github.com/pulsar-edit/github/archive/refs/tags/v0.36.20-pretranspiled.tar.gz", "go-to-line": "file:packages/go-to-line", "grammar-selector": "file:packages/grammar-selector", "grim": "2.0.3", @@ -124,6 +126,10 @@ "line-ending-selector": "file:packages/line-ending-selector", "line-top-index": "0.3.1", "link": "file:packages/link", + "markdown-it": "^13.0.2", + "markdown-it-emoji": "^2.0.2", + "markdown-it-github-headings": "^2.0.1", + "markdown-it-task-checkbox": "^1.0.6", "markdown-preview": "file:./packages/markdown-preview", "minimatch": "^3.0.3", "mocha": "6.2.3", @@ -153,14 +159,16 @@ "service-hub": "^0.7.4", "settings-view": "file:packages/settings-view", "sinon": "9.2.1", - "snippets": "github:pulsar-edit/snippets#ba70705", + "snippets": "github:pulsar-edit/snippets#6b9163415270b8757b262f5dfaafaa05d47324a9", "solarized-dark-syntax": "file:packages/solarized-dark-syntax", "solarized-light-syntax": "file:packages/solarized-light-syntax", "spell-check": "file:packages/spell-check", "status-bar": "file:packages/status-bar", "styleguide": "file:./packages/styleguide", "superstring": "^2.4.4", - "symbols-view": "https://codeload.github.com/atom/symbols-view/legacy.tar.gz/refs/tags/v0.118.4", + "symbol-provider-ctags": "file:./packages/symbol-provider-ctags", + "symbol-provider-tree-sitter": "file:./packages/symbol-provider-tree-sitter", + "symbols-view": "file:./packages/symbols-view", "tabs": "file:packages/tabs", "temp": "0.9.4", "text-buffer": "^13.18.6", @@ -176,6 +184,7 @@ "whitespace": "file:./packages/whitespace", "winreg": "^1.2.1", "wrap-guide": "file:./packages/wrap-guide", + "yaml-front-matter": "^4.1.1", "yargs": "17.6.2" }, "packageDependencies": { @@ -211,7 +220,7 @@ "exception-reporting": "file:./packages/exception-reporting", "find-and-replace": "file:./packages/find-and-replace", "fuzzy-finder": "file:packages/fuzzy-finder", - "github": "0.36.17", + "github": "0.36.20", "git-diff": "file:./packages/git-diff", "go-to-line": "file:./packages/go-to-line", "grammar-selector": "file:./packages/grammar-selector", @@ -230,7 +239,9 @@ "spell-check": "file:./packages/spell-check", "status-bar": "file:./packages/status-bar", "styleguide": "file:./packages/styleguide", - "symbols-view": "0.118.4", + "symbol-provider-ctags": "file:./packages/symbol-provider-ctags", + "symbol-provider-tree-sitter": "file:./packages/symbol-provider-tree-sitter", + "symbols-view": "file:./packages/symbols-view", "tabs": "file:./packages/tabs", "timecop": "file:./packages/timecop", "tree-view": "file:./packages/tree-view", diff --git a/packages/atom-dark-syntax/index.less b/packages/atom-dark-syntax/index.less index 161afc862..7a20f8eb9 100644 --- a/packages/atom-dark-syntax/index.less +++ b/packages/atom-dark-syntax/index.less @@ -9,3 +9,4 @@ @import "styles/syntax/base.less"; @import "styles/syntax/css.less"; @import "styles/syntax/html.less"; +@import "styles/syntax/json.less"; diff --git a/packages/atom-dark-syntax/styles/syntax/base.less b/packages/atom-dark-syntax/styles/syntax/base.less index d5fe55930..729b801df 100644 --- a/packages/atom-dark-syntax/styles/syntax/base.less +++ b/packages/atom-dark-syntax/styles/syntax/base.less @@ -229,6 +229,12 @@ &.syntax--italic { font-style: italic; } + + // Horizontal rules in GFM used to be scoped as `comment.hr`. For continuity, + // we assign the color of a comment to this new scope. + &.syntax--horizontal-rule { + color: #8A8A8A; + } } // /* comment */ diff --git a/packages/atom-dark-syntax/styles/syntax/json.less b/packages/atom-dark-syntax/styles/syntax/json.less new file mode 100644 index 000000000..011feb3b2 --- /dev/null +++ b/packages/atom-dark-syntax/styles/syntax/json.less @@ -0,0 +1,11 @@ + +.syntax--source.syntax--json { + + // Color JSON keys differently from other strings. + .syntax--meta.syntax--structure.syntax--key { + .syntax--string.syntax--quoted.syntax--double { + color: #96CBFE; + } + } + +} diff --git a/packages/atom-light-syntax/index.less b/packages/atom-light-syntax/index.less index d86a25ba2..639a66be4 100644 --- a/packages/atom-light-syntax/index.less +++ b/packages/atom-light-syntax/index.less @@ -8,3 +8,4 @@ @import "styles/syntax/base.less"; @import "styles/syntax/css.less"; +@import "styles/syntax/json.less"; diff --git a/packages/atom-light-syntax/styles/syntax/base.less b/packages/atom-light-syntax/styles/syntax/base.less index aa5de28f8..18f5ce6d8 100644 --- a/packages/atom-light-syntax/styles/syntax/base.less +++ b/packages/atom-light-syntax/styles/syntax/base.less @@ -198,6 +198,12 @@ &.syntax--italic { font-style: italic; } + + // Horizontal rules in GFM used to be scoped as `comment.hr`. For continuity, + // we assign the color of a comment to this new scope. + &.syntax--horizontal-rule { + color: #999988; + } } // /* comment */ diff --git a/packages/atom-light-syntax/styles/syntax/json.less b/packages/atom-light-syntax/styles/syntax/json.less new file mode 100644 index 000000000..6891b18a3 --- /dev/null +++ b/packages/atom-light-syntax/styles/syntax/json.less @@ -0,0 +1,11 @@ + +.syntax--source.syntax--json { + + // Color JSON keys differently from other strings. + .syntax--meta.syntax--structure.syntax--key { + .syntax--string.syntax--quoted.syntax--double { + color: #008080; + } + } + +} diff --git a/packages/autocomplete-css/spec/provider-spec.js b/packages/autocomplete-css/spec/provider-spec.js index 1249ee72c..cd85ef374 100644 --- a/packages/autocomplete-css/spec/provider-spec.js +++ b/packages/autocomplete-css/spec/provider-spec.js @@ -33,7 +33,7 @@ const packagesToTest = { const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms)); -const whenEditorReady = function(editor) { +const whenEditorReady = function (editor) { const languageMode = editor.getBuffer().getLanguageMode(); if (!languageMode.constructor.name.includes('TreeSitter')) { return Promise.resolve(); @@ -105,8 +105,6 @@ describe("CSS property name and value autocompletions", async () => { await atom.workspace.open(packagesToTest[packageLabel].file); editor = atom.workspace.getActiveTextEditor(); await whenEditorReady(editor); - console.warn('USING TREE SITTER?!?', packageLabel, meta.useTreeSitter); - atom.config.set('core.useExperimentalModernTreeSitter', meta.useTreeSitter ?? false); atom.config.set('core.useTreeSitterParsers', meta.useTreeSitter ?? false); }); @@ -738,7 +736,7 @@ div:nth { }) ); - Object.keys(packagesToTest).forEach(function(packageLabel) { + Object.keys(packagesToTest).forEach(function (packageLabel) { if (packagesToTest[packageLabel].name !== 'language-css') { describe(`${packageLabel} files`, async () => { beforeEach(async () => { diff --git a/packages/autocomplete-html/lib/main.js b/packages/autocomplete-html/lib/main.js index ee0da5386..e2e16c4f6 100644 --- a/packages/autocomplete-html/lib/main.js +++ b/packages/autocomplete-html/lib/main.js @@ -9,7 +9,8 @@ const provider = { getSuggestions (request) { try { - if (request.editor.getBuffer().getLanguageMode().tree) { + let languageMode = request.editor.getBuffer().getLanguageMode(); + if (languageMode.constructor.name === 'TreeSitterLanguageMode') { return getSuggestionsWithTreeSitter(request) } else { return getSuggestionsWithTextMate(request) diff --git a/packages/autocomplete-html/lib/text-mate-provider.js b/packages/autocomplete-html/lib/text-mate-provider.js index 8ed596552..479176e18 100644 --- a/packages/autocomplete-html/lib/text-mate-provider.js +++ b/packages/autocomplete-html/lib/text-mate-provider.js @@ -50,7 +50,7 @@ function isTagStart ({prefix, scopeDescriptor, bufferPosition, editor}) { function isAttributeStart ({prefix, scopeDescriptor, bufferPosition, editor}) { const scopes = scopeDescriptor.getScopesArray() if (!getPreviousAttribute(editor, bufferPosition) && prefix && !prefix.trim()) { - return hasTagScope(scopes) + return hasTagScope(scopes) || afterTagScope(editor, bufferPosition) } const previousBufferPosition = [bufferPosition.row, Math.max(0, bufferPosition.column - 1)] @@ -68,6 +68,25 @@ function isAttributeStart ({prefix, scopeDescriptor, bufferPosition, editor}) { ) } +// This fixes the +// +//
` on the tag, so we should +// move back to the nearest text and try to read the scopes from there. +// Designed to work no matter how many spaces there are between the end of the +// tag name and the cursor. +function afterTagScope (editor, bufferPosition) { + let cursor = editor.getCursors().find(cursor => { + return cursor.getBufferPosition().isEqual(bufferPosition) + }) + if (!cursor) return false; + let position = cursor.getPreviousWordBoundaryBufferPosition(); + position = position.translate([0, -1]); + let scopes = editor.scopeDescriptorForBufferPosition(position); + return scopes.getScopesArray().some(t => t.startsWith('entity.name.tag')); +} + function isAttributeValueStart ({scopeDescriptor, bufferPosition, editor}) { const scopes = scopeDescriptor.getScopesArray() @@ -75,6 +94,11 @@ function isAttributeValueStart ({scopeDescriptor, bufferPosition, editor}) { const previousScopes = editor.scopeDescriptorForBufferPosition(previousBufferPosition) const previousScopesArray = previousScopes.getScopesArray() + // This is an unambiguous case β€” if the cursor is on the right side of the + // opening quote, then we must be in the right place. + if (previousScopesArray.includes('punctuation.definition.string.begin.html')) + return true + // autocomplete here: attribute="|" // not here: attribute=|"" // or here: attribute=""| diff --git a/packages/autocomplete-html/spec/.eslintrc.js b/packages/autocomplete-html/spec/.eslintrc.js new file mode 100644 index 000000000..abdfc7010 --- /dev/null +++ b/packages/autocomplete-html/spec/.eslintrc.js @@ -0,0 +1,13 @@ +module.exports = { + env: { jasmine: true }, + globals: { + "waitsForPromise": true, + "advanceClock": true + }, + rules: { + "node/no-unpublished-require": "off", + "node/no-extraneous-require": "off", + "no-unused-vars": "off", + "no-empty": "off" + } +}; diff --git a/packages/autocomplete-html/spec/provider-spec.js b/packages/autocomplete-html/spec/provider-spec.js index ee3588df4..5b14544fb 100644 --- a/packages/autocomplete-html/spec/provider-spec.js +++ b/packages/autocomplete-html/spec/provider-spec.js @@ -1,5 +1,5 @@ describe('HTML autocompletions', () => { - let editor, provider + let editor, provider, languageMode function getCompletions () { const cursor = editor.getLastCursor() @@ -32,51 +32,66 @@ describe('HTML autocompletions', () => { return -1; } - beforeEach(() => { - waitsForPromise(() => atom.packages.activatePackage('autocomplete-html')) - waitsForPromise(() => atom.packages.activatePackage('language-html')) - waitsForPromise(() => atom.workspace.open('test.html')) + beforeEach(async () => { + await atom.packages.activatePackage('autocomplete-html') + await atom.packages.activatePackage('language-html') + await atom.workspace.open('test.html') + editor = atom.workspace.getActiveTextEditor() + languageMode = editor.getBuffer().getLanguageMode() + languageMode.useAsyncParsing = false + languageMode.useAsyncIndent = false + await languageMode.ready - runs(() => provider = atom.packages.getActivePackage('autocomplete-html').mainModule.getProvider()) - runs(() => editor = atom.workspace.getActiveTextEditor()) + provider = atom.packages.getActivePackage('autocomplete-html').mainModule.getProvider() }) - it('returns no completions when not at the start of a tag', () => { + afterEach(async () => { + await languageMode.atTransactionEnd() + }) + + it('returns no completions when not at the start of a tag', async () => { editor.setText('') + await languageMode.atTransactionEnd() expect(getCompletions().length).toBe(0) editor.setText('d') editor.setCursorBufferPosition([0, 0]) + await languageMode.atTransactionEnd() + expect(getCompletions().length).toBe(0) + editor.setCursorBufferPosition([0, 1]) expect(getCompletions().length).toBe(0) }) - it('returns no completions in style tags', () => { + it('returns no completions in style tags', async () => { editor.setText(`\ \ ` ) + await languageMode.atTransactionEnd() editor.setCursorBufferPosition([1, 1]) expect(getCompletions().length).toBe(0) }) - it('returns no completions in script tags', () => { + it('returns no completions in script tags', async () => { editor.setText(`\ \ ` ) + await languageMode.atTransactionEnd() editor.setCursorBufferPosition([1, 1]) expect(getCompletions().length).toBe(0) }) - it('autcompletes tag names without a prefix', () => { + it('autcompletes tag names without a prefix', async () => { editor.setText('<') editor.setCursorBufferPosition([0, 1]) + await languageMode.atTransactionEnd() const completions = getCompletions() expect(completions.length).toBeGreaterThan(113) // Fun Fact last check this was 232 @@ -90,9 +105,10 @@ describe('HTML autocompletions', () => { } }) - it('autocompletes tag names with a prefix', () => { + it('autocompletes tag names with a prefix', async () => { editor.setText(' { expect(isValueInCompletions('dt', completions)).toBe(true) }) - it("does not autocomplete tag names if there's a space after the <", () => { + it("does not autocomplete tag names if there's a space after the <", async () => { editor.setText('< ') editor.setCursorBufferPosition([0, 2]) + await languageMode.atTransactionEnd() let completions = getCompletions() expect(completions.length).toBe(0) editor.setText('< h') editor.setCursorBufferPosition([0, 2]) + await languageMode.atTransactionEnd() completions = getCompletions() expect(completions.length).toBe(0) }) - it('does not provide a descriptionMoreURL if the tag does not have a unique description', () => { + it('does not provide a descriptionMoreURL if the tag does not have a unique description', async () => { // isindex does not have an associated MDN page as of March 25, 2023 editor.setText(' { expect(completions[loc].descriptionMoreURL).toBeNull() }) - it('autocompletes attribute names without a prefix', () => { + it('autocompletes attribute names without a prefix', async () => { editor.setText('
{ editor.setText(' { editor.setText('
') editor.setCursorBufferPosition([0, 5]) + await languageMode.atTransactionEnd() completions = getCompletions() expect(completions.length).toBeGreaterThan(0) @@ -193,6 +215,7 @@ describe('HTML autocompletions', () => { editor.setText('
') editor.setCursorBufferPosition([0, 5]) + await languageMode.atTransactionEnd() completions = getCompletions() expect(completions.length).toBeGreaterThan(0) @@ -201,9 +224,10 @@ describe('HTML autocompletions', () => { } }) - it('autocompletes attribute names with a prefix', () => { + it('autocompletes attribute names with a prefix', async () => { editor.setText('
{ editor.setText('
{ editor.setText('
') editor.setCursorBufferPosition([0, 6]) + await languageMode.atTransactionEnd() completions = getCompletions() expect(completions.length).toBeGreaterThan(3) @@ -238,6 +264,7 @@ describe('HTML autocompletions', () => { editor.setText('
') editor.setCursorBufferPosition([0, 6]) + await languageMode.atTransactionEnd() completions = getCompletions() expect(completions.length).toBeGreaterThan(3) @@ -248,6 +275,7 @@ describe('HTML autocompletions', () => { editor.setText(' { editor.setText(' { + it('autocompletes attribute names without a prefix surrounded by whitespace', async () => { editor.setText(' { + it("respects the 'flag' type when autocompleting attribute names", async () => { editor.setText(' { + it('does not autocomplete attribute names outside of a tag', async () => { editor.setText('') editor.setCursorBufferPosition([0, 0]) @@ -324,18 +360,20 @@ describe('HTML autocompletions', () => { expect(getCompletions().length).toBe(0) }) - it('does not throw when a local attribute is not in the attributes list', () => { + it('does not throw when a local attribute is not in the attributes list', async () => { // Some tags, like body, have local attributes that are not present in the top-level attributes array editor.setText(' { + it('does not provide a descriptionMoreURL if the attribute does not have a unique description', async () => { editor.setText(' { expect(completions[loc].descriptionMoreURL).toBeNull() }) - it('autocompletes attribute values without a prefix', () => { + it('autocompletes attribute values without a prefix', async () => { editor.setText(' { expect(completions[1].text).toBe('slide') expect(completions[2].text).toBe('alternate') - editor.setText(' { expect(completions[2].text).toBe('alternate') }) - it('autocompletes attribute values with a prefix', () => { + it('autocompletes attribute values with a prefix', async () => { editor.setText(' { editor.setText(' { editor.setText(' { expect(completions[5].text).toBe('es') }) - it('autocompletes ambiguous attribute values', () => { + it('autocompletes ambiguous attribute values', async () => { editor.setText('