Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/ui-api' into filtering-api
Browse files Browse the repository at this point in the history
  • Loading branch information
mauricioszabo committed Nov 7, 2023
2 parents ed73630 + 339f228 commit a987468
Show file tree
Hide file tree
Showing 46 changed files with 3,910 additions and 3,254 deletions.
4 changes: 3 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 @@ -86,6 +86,7 @@ arm_linux_task:
libnss3
xvfb
- gem install fpm
- python3 -m pip install setuptools
- git submodule init
- git submodule update
- sed -i -e "s/[0-9]*-dev/`date -u +%Y%m%d%H`/g" package.json
Expand Down Expand Up @@ -133,6 +134,7 @@ silicon_mac_task:
ROLLING_UPLOAD_TOKEN: ENCRYPTED[690950798401ec3715e9d20ac29a0859d3c58097038081ff6afeaf4721e661672d34eb952d8a6442bc7410821ab8545a]
prepare_script:
- 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
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
env:
# Variables needed for build information
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTHON_VERSION: '3.11'
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 +22,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 +40,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 Down Expand Up @@ -92,7 +98,7 @@ 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
Expand All @@ -101,7 +107,7 @@ jobs:
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 @@ -5,8 +5,59 @@
- Project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html)

## [Unreleased]

## 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
8 changes: 3 additions & 5 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 @@ -63,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",
Expand All @@ -73,12 +74,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 @@ -149,7 +148,6 @@
"pathwatcher": "^8.1.2",
"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
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 @@ -373,14 +373,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 = atom.ui.fuzzyMatcher.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 = atom.ui.fuzzyMatcher.score(text, suggestionPrefix)) > 0) {
suggestion.score = score * suggestion.sortScore
results.push(suggestion)
}
}
}

Expand Down
16 changes: 6 additions & 10 deletions packages/autocomplete-plus/lib/suggestion-list-element.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
const {CompositeDisposable} = require('atom')
const SnippetParser = require('./snippet-parser')
const {isString} = require('./type-helpers')
const {marked} = require('marked')
const createDOMPurify = require('dompurify')

const createSuggestionFrag = () => {
const frag = document.createDocumentFragment()
Expand Down Expand Up @@ -133,15 +131,13 @@ module.exports = class SuggestionListElement {

if (item.descriptionMarkdown && item.descriptionMarkdown.length > 0) {
this.descriptionContainer.style.display = 'block'
this.descriptionContent.innerHTML = createDOMPurify().sanitize(
marked(item.descriptionMarkdown, {
gfm: true,
this.descriptionContent.innerHTML = atom.ui.markdown.render(
item.descriptionMarkdown,
{
breaks: true,
sanitize: false,
mangle: false,
headerIds: false
})
)
renderMode: "fragment"
}
);
this.setDescriptionMoreLink(item)
} else if (item.description && item.description.length > 0) {
this.descriptionContainer.style.display = 'block'
Expand Down
2 changes: 0 additions & 2 deletions packages/autocomplete-plus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
},
"dependencies": {
"atom-slick": "^2.0.0",
"dompurify": "^3.0.4",
"grim": "^2.0.1",
"marked": "^5.1.1",
"minimatch": "^3.0.3",
"selector-kit": "^0.1.0",
"stable": "^0.1.8",
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
5 changes: 2 additions & 3 deletions packages/deprecation-cop/lib/deprecation-cop-view.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { CompositeDisposable } from 'atom';
import etch from 'etch';
import fs from 'fs-plus';
import Grim from 'grim';
import { marked } from 'marked';
import path from 'path';
import { shell } from 'electron';

Expand Down Expand Up @@ -138,7 +137,7 @@ export default class DeprecationCopView {
<span className="text-warning icon icon-alert" />
<div
className="list-item deprecation-message"
innerHTML={marked(deprecation.getMessage())}
innerHTML={atom.ui.markdown.render(deprecation.getMessage())}
/>
{this.renderIssueURLIfNeeded(
packageName,
Expand Down Expand Up @@ -218,7 +217,7 @@ export default class DeprecationCopView {
<span className="text-warning icon icon-alert" />
<div
className="list-item deprecation-message"
innerHTML={marked(deprecation.message)}
innerHTML={atom.ui.markdown.render(deprecation.message)}
/>
{this.renderSelectorIssueURLIfNeeded(
packageName,
Expand Down
1 change: 0 additions & 1 deletion packages/deprecation-cop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"etch": "0.9.0",
"fs-plus": "^3.0.0",
"grim": "^2.0.1",
"marked": "5.0.3",
"underscore-plus": "^1.7.0"
},
"consumedServices": {
Expand Down
Loading

0 comments on commit a987468

Please sign in to comment.