Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into clojure-grammar-enh…
Browse files Browse the repository at this point in the history
…ancements
  • Loading branch information
mauricioszabo committed Nov 8, 2023
2 parents 09ee95b + 30dc9d2 commit 16b72dc
Show file tree
Hide file tree
Showing 35 changed files with 3,410 additions and 3,085 deletions.
5 changes: 4 additions & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
env:
PYTHON_VERSION: 3.10
PYTHON_VERSION: 3.12
GITHUB_TOKEN: ENCRYPTED[!b0ff4671044672be50914a3a10b49af642bd8e0e681a6f4e5855ec5230a5cf9afbc53d9e90239b8d2c79455f014f383f!]
# The above token, is a GitHub API Token, that allows us to download RipGrep without concern of API limits

Expand Down Expand Up @@ -132,7 +132,9 @@ silicon_mac_task:
TEAM_ID: ENCRYPTED[11f3fedfbaf4aff1859bf6c105f0437ace23d84f5420a2c1cea884fbfa43b115b7834a463516d50cb276d4c4d9128b49]
ROLLING_UPLOAD_TOKEN: ENCRYPTED[690950798401ec3715e9d20ac29a0859d3c58097038081ff6afeaf4721e661672d34eb952d8a6442bc7410821ab8545a]
prepare_script:
- brew update
- brew install node@16 yarn git python@$PYTHON_VERSION
- python3 -m pip install setuptools
- git submodule init
- git submodule update
- ln -s /opt/homebrew/bin/python$PYTHON_VERSION /opt/homebrew/bin/python
Expand Down Expand Up @@ -189,6 +191,7 @@ silicon_mac_task:
# - 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"
# - arch -x86_64 brew update
# - arch -x86_64 brew install node@16 yarn git python@$PYTHON_VERSION
# - ln -s /usr/local/bin/python$PYTHON_VERSION /usr/local/bin/python
# - git submodule init
Expand Down
31 changes: 23 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ on:
push:
branches:
- 'master'
tags:
- '**'
pull_request:
workflow_dispatch:

env:
# Variables needed for build information
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHON_VERSION: '3.10'
PYTHON_VERSION: '3.12'
NODE_VERSION: 16
ROLLING_UPLOAD_TOKEN: ${{ secrets.ROLLING_RELEASE_UPLOAD_TOKEN }}
# Below variables allow us to quickly control visual tests for each platform
Expand All @@ -22,7 +24,7 @@ jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
os: [ ubuntu-20.04, windows-latest, macos-latest ]
fail-fast: false
runs-on: ${{ matrix.os }}

Expand All @@ -40,6 +42,12 @@ jobs:
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Python setuptools
# This is needed for Python 3.12+, since many versions of node-gyp
# are incompatible with Python 3.12+, which no-longer ships 'distutils'
# out of the box. 'setuptools' package provides 'distutils'.
run: python3 -m pip install setuptools

- name: Setup Git Submodule
run: |
git submodule init
Expand All @@ -53,6 +61,12 @@ jobs:
if: ${{ runner.os == 'Windows' }}
run: (Get-Content package.json) -replace '[0-9]*-dev', (date -u +%Y%m%d%H) | Set-Content -Path package.json

- name: Reinstall Current Node-GYP NodeJS Headers
# Overwrite bad headers that get downloaded.
# NodeJS versions above 16 should come with `node-gyp@9.4.0` that has a fix
# for this issue. At that point this additional step can be removed.
run: npx node-gyp install ${{ env.NODE_VERSION }}

- name: Install Pulsar Dependencies
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
with:
Expand All @@ -74,9 +88,10 @@ jobs:
# macOS Signing Stuff
- name: Build Pulsar Binaries (macOS) (Signed)
if: ${{ runner.os == 'macOS' && github.event.pull_request.head.repo.full_name == 'pulsar-edit/pulsar' }}
# PRs generated from forks cannot access GitHub Secrets
# So if the PR is a fork, we will still build, but will not sign.
if: ${{ runner.os == 'macOS' && github.event_name == 'push' }}
# Note: PRs generated from forks cannot access GitHub Secrets.
# So if the PR is from a fork, we can still build, but cannot sign.
# Note: We aren't attempting to sign for *any* PRs anymore, though.
env:
CSC_LINK: ${{ secrets.CSC_LINK }}
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
Expand All @@ -85,16 +100,16 @@ jobs:
TEAM_ID: ${{ secrets.TEAM_ID }}
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
with:
timeout_minutes: 30
timeout_minutes: 45
max_attempts: 3
retry_on: error
command: yarn dist

- name: Build Pulsar Binaries (macOS) (Unsigned)
if: ${{ runner.os == 'macOS' && github.event.pull_request.head.repo.full_name != 'pulsar-edit/pulsar' }}
if: ${{ runner.os == 'macOS' && github.event_name != 'push' }}
uses: nick-fields/retry@943e742917ac94714d2f408a0e8320f2d1fcafcd
with:
timeout_minutes: 30
timeout_minutes: 45
max_attempts: 3
retry_on: error
command: yarn dist
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- name: Install Python setuptools
# This is needed for Python 3.12+, since many versions of node-gyp
# are incompatible with Python 3.12+, which no-longer ships 'distutils'
# out of the box. 'setuptools' package provides 'distutils'.
run: python3 -m pip install setuptools

- name: Install Dependencies
run: yarn install

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/editor-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ jobs:
with:
node-version: 16

- name: Install Python setuptools
# This is needed for Python 3.12+, since many versions of node-gyp
# are incompatible with Python 3.12+, which no-longer ships 'distutils'
# out of the box. 'setuptools' package provides 'distutils'.
run: python3 -m pip install setuptools

- name: Install Dependencies
run: yarn install

Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/package-tests-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ jobs:
with:
node-version: 16

- name: Install Python setuptools
# This is needed for Python 3.12+, since many versions of node-gyp
# are incompatible with Python 3.12+, which no-longer ships 'distutils'
# out of the box. 'setuptools' package provides 'distutils'.
run: python3 -m pip install setuptools

- name: Install Dependencies
run: yarn install

Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/validate-wasm-grammar-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Validate WASM Grammar PR Changes
# Since we now want to enforce the rule that any changes to a WASM grammar binary
# file, is accompanied by a change to the `parserSource` key within the
# `grammar.cson` file. This GHA will preform this check for us.

on:
pull_request:
paths:
- '**.wasm'

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout the Latest Code
uses: actions/checkout@v3
with:
fetch-depth: 0
# Make sure we get all commits, so that we can compare to early commits

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: 16

- name: Install Python setuptools
# This is needed for Python 3.12+, since many versions of node-gyp
# are incompatible with Python 3.12+, which no-longer ships 'distutils'
# out of the box. 'setuptools' package provides 'distutils'.
run: python3 -m pip install setuptools

- name: Install dependencies
run: yarn install

- name: Run Validation Script
run: node ./script/validate-wasm-grammar-prs.js
51 changes: 51 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,59 @@
injection points on Clojure. Added support for highligting metadata, and added
better support for "def" elements (example - don't syntax `default` or
`definition` as a `def`, but highlights `p/defresolver`)

## 1.110.0

- Made the modification of `editor.preferredLineLength` configurable within `wrap-guide` when changing `wrap-guide.columns`
- Fixed Snippets from `language-php` that would lose the `$` character
- Fixed a condition where an invalid config may crash Pulsar before fully starting up, but not registering that it's crashed
- Reduced error notifications that may appear from `autocomplete-html` when handling EJS files
- Fixed macOS binary signing after moving over to GitHub Actions for CI
- Updated PPM to a newer `node-gyp`, allowing newer versions of C/C++ compiler toolchains and Python to be used (also dropped support for Python 2.x!)
- Fully decaffed the entire PPM codebase
- Added a new autocomplete API that does not uses prefixes and instead declares the range it'll replace (better LSP support)

### Pulsar
- Added: [wrap-guide] Make the automatic modification of `editor.preferredLineLength` configurable [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/754)
- Fixed: Fixed filtering of suggestions with ranges [@mauricioszabo](https://github.com/pulsar-edit/pulsar/pull/762)
- Added: Tree-sitter running fixes for September [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/735)
- Added: Add escapement to variable literals within php snippets [@Spiker985](https://github.com/pulsar-edit/pulsar/pull/758)
- Added: [core] Handle invalid config on load [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/750)
- Added: [autocomplete-html] Wrap completions in `try/catch` handler [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/753)
- Bumped: Update dependency postcss to v8.4.31 [SECURITY] [@renovate](https://github.com/pulsar-edit/pulsar/pull/752)
- Fixed: CI: Sign macOS binaries for branch pushes, not PRs [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/745)
- Fixed: CI: Use Python 3.11 to fix macOS signing [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/743)
- Fixed: [meta] Fix Windows Builds in CI [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/738)
- Bumped: ppm: Update ppm submodule to commit a2ade745bfbc5f [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/725)
- Added: Making autocomplete-plus work to replace ranges [@mauricioszabo](https://github.com/pulsar-edit/pulsar/pull/479)

### ppm
- Bumped: Update npm and node-gyp, for macOS signing fix [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/94)
- Removed: Remove remnants of Coffeescript building [@2colours](https://github.com/pulsar-edit/ppm/pull/92)
- Added: Update unpublishing wording [@Daeraxa](https://github.com/pulsar-edit/ppm/pull/90)
- Added: Migrate to `second-mate` and remove `first-mate` [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/86)
- Added: Cleanup `visualStudioIsInstalled()` [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/85)
- Decafed: Decaf Source [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/84)
- Fixed: Make `postinstall` scripts work on Windows with spaces in cwd path [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/83)
- Added: Move Spec Decaf PRs into `master` [@confused-Techie](https://github.com/pulsar-edit/ppm/pull/81)
- Bumped: Switch to our npm fork, to get newer node-gyp (node-gyp 9.x) [@DeeDeeG](https://github.com/pulsar-edit/ppm/pull/79)
- Decafed: Decaffeinate remaining spec files from list-spec on [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/78)
- Decafed: Decaffeinate link spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/77)
- Decafed: Decaffeinate install spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/76)
- Decafed: Decaffeinate init spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/75)
- Decafed: Decaffeinate help spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/74)
- Decafed: Decaffeinate featured spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/73)
- Decafed: Decaffeinate enable spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/72)
- Decafed: Decaffeinate docs spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/71)
- Decafed: Decaffeinate disable spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/70)
- Decafed: Decaffeinate develop spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/69)
- Decafed: Decaffeinate config spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/68)
- Decafed: Decaffeinate command spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/67)
- Decafed: Decaffeinate clean spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/66)
- Decafed: Decaffeinate ci spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/65)
- Decafed: Decaffeinate apm cli spec [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/64)
- Decafed: Decaffeinate spec helper (updated) [@GuilleW and @2colours](https://github.com/pulsar-edit/ppm/pull/63)

## 1.109.0

- Fixed a race condition that could cause `autocomplete-plus` to ignore user input.
Expand Down
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pulsar",
"author": "Pulsar-Edit <admin@pulsar-edit.dev>",
"productName": "Pulsar",
"version": "1.109.0-dev",
"version": "1.110.0-dev",
"description": "A Community-led Hyper-Hackable Text Editor",
"branding": {
"id": "pulsar",
Expand Down Expand Up @@ -72,12 +72,10 @@
"fs-admin": "0.19.0",
"fs-plus": "^3.1.1",
"fstream": "1.0.12",
"functional-red-black-tree": "^1.0.1",
"fuzzy-finder": "file:packages/fuzzy-finder",
"git-diff": "file:packages/git-diff",
"git-utils": "5.7.1",
"git-utils": "^5.7.3",
"github": "https://codeload.github.com/pulsar-edit/github/tar.gz/refs/tags/v0.36.17-pretranspiled",
"glob": "^7.1.1",
"go-to-line": "file:packages/go-to-line",
"grammar-selector": "file:packages/grammar-selector",
"grim": "2.0.3",
Expand Down Expand Up @@ -142,9 +140,8 @@
"open-on-github": "file:packages/open-on-github",
"package-generator": "file:packages/package-generator",
"pathwatcher": "^8.1.2",
"postcss": "8.2.13",
"postcss": "8.4.31",
"postcss-selector-parser": "6.0.4",
"property-accessors": "^1.1.3",
"pulsar-updater": "file:packages/pulsar-updater",
"resolve": "1.18.1",
"scandal": "^3.2.0",
Expand Down
17 changes: 13 additions & 4 deletions packages/autocomplete-html/lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ const provider = {
filterSuggestions: true,

getSuggestions (request) {
if (request.editor.getBuffer().getLanguageMode().tree) {
return getSuggestionsWithTreeSitter(request)
} else {
return getSuggestionsWithTextMate(request)
try {
if (request.editor.getBuffer().getLanguageMode().tree) {
return getSuggestionsWithTreeSitter(request)
} else {
return getSuggestionsWithTextMate(request)
}
} catch(err) {
// We avoid creating any actual error messages, as this is intended to fix
// the case when providing completions for EJS that multiple continious
// errors are created rapidly.
// https://github.com/pulsar-edit/pulsar/issues/649
console.error(err);
return [];
}
},

Expand Down
11 changes: 6 additions & 5 deletions packages/autocomplete-plus/lib/autocomplete-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,15 @@ class AutocompleteManager {
const text = (suggestion.snippet || suggestion.text)
const suggestionPrefix = suggestion.replacementPrefix != null ? suggestion.replacementPrefix : prefix
const prefixIsEmpty = !suggestionPrefix || suggestionPrefix === ' '
const firstCharIsMatch = !prefixIsEmpty && suggestionPrefix[0].toLowerCase() === text[0].toLowerCase()

if (prefixIsEmpty) {
results.push(suggestion)
}
if (firstCharIsMatch && (score = fuzzaldrinProvider.score(text, suggestionPrefix)) > 0) {
suggestion.score = score * suggestion.sortScore
results.push(suggestion)
} else {
const keepMatching = suggestion.ranges || suggestionPrefix[0].toLowerCase() === text[0].toLowerCase()
if (keepMatching && (score = fuzzaldrinProvider.score(text, suggestionPrefix)) > 0) {
suggestion.score = score * suggestion.sortScore
results.push(suggestion)
}
}
}

Expand Down
20 changes: 20 additions & 0 deletions packages/autocomplete-plus/spec/provider-api-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -327,5 +327,25 @@ describe('Provider API', () => {

expect(editor.getText()).toEqual("ohai, world\n")
})

it('ignores `prefix` if `range` is present', async () => {
testProvider = {
scopeSelector: '.source.js',
filterSuggestions: true,
getSuggestions (options) {
return [
{text: 'notmatch/foololohairange', ranges: [[[0, 0], [0, 5]]]},
{text: 'notmatch/foololohaiprefix'},
{text: 'foololohaiprefix2'}
]
}
}
registration = atom.packages.serviceHub.provide('autocomplete.provider', '5.0.0', testProvider)
editor.insertText('foololohai')
await triggerAutocompletion()
expect(document.querySelector('autocomplete-suggestion-list').innerText).toMatch(/notmatch\/foololohairange/)
expect(document.querySelector('autocomplete-suggestion-list').innerText).toMatch(/foololohaiprefix2/)
expect(document.querySelector('autocomplete-suggestion-list').innerText).toNotMatch(/notmatch\/foololohaiprefix/)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
}

.syntax--meta {
&.syntax--class {
&.syntax--class:not(.syntax--block) {
color: @yellow;

&.syntax--body {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
}

.syntax--meta {
&.syntax--class {
&.syntax--class:not(.syntax--block) {
color: @yellow;

&.syntax--body {
Expand Down
10 changes: 5 additions & 5 deletions packages/fuzzy-finder/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# Fuzzy Finder package

Quickly find and open files using <kbd>cmd-t</kbd>.
Quickly find and open files using <kbd>cmd/ctrl-t</kbd>.

* <kbd>cmd-t</kbd> or <kbd>cmd-p</kbd> to open the file finder
* <kbd>cmd-b</kbd> to open the list of open buffers
* <kbd>cmd-shift-b</kbd> to open the list of Git modified and untracked files
* <kbd>cmd-t</kbd>/<kbd>cmd-p</kbd> *(macOS)* or <kbd>ctrl-t</kbd>/<kbd>ctrl-p</kbd> *(Linux/Windows)* to open the file finder
* <kbd>cmd-b</kbd> *(macOS)* or <kbd>ctrl-b</kbd> *(Linux/Windows)* to open the list of open buffers
* <kbd>cmd-shift-b</kbd> *(macOS)* or <kbd>ctrl-shift-b</kbd> *(Linux/Windows)* to open the list of Git modified and untracked files

When opening a file, you can control the behavior.

* <kbd>enter</kbd> defaults to opening the selected file without leaving the current pane
* <kbd>shift-enter</kbd> defaults to switching to another pane if the file is already open there
* <kbd>cmd-k</kbd> <kbd>right</kbd> (or any other directional arrow) will open the highlighted file in a new pane on the side indicated by the arrow
* <kbd>cmd-k</kbd> <kbd>right</kbd> *(macOS)* or <kbd>ctrl-k</kbd> <kbd>right</kbd> *(Linux/Windows)* (or any other directional arrow) will open the highlighted file in a new pane on the side indicated by the arrow
* Adding `:<line number>` to the end of your search will go directly to the line number you specify, or the last line if the number is larger

Turning on the "Search All Panes" setting reverses the behavior of <kbd>enter</kbd> and <kbd>shift-enter</kbd> so <kbd>enter</kbd> opens the file in any pane and <kbd>shift-enter</kbd> creates a new tab in the current pane.
Expand Down
Loading

0 comments on commit 16b72dc

Please sign in to comment.