diff --git a/.cirrus.yml b/.cirrus.yml index 7558f55caf..58d5fff145 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -63,7 +63,7 @@ arm_linux_task: memory: 8G env: USE_SYSTEM_FPM: 'true' - ROLLING_UPLOAD_TOKEN: ENCRYPTED[bda9bda0d9ca3ed72f8efdf33e09c0abe63f568db948b11e348f963dd532c08fdf91e54d7db549b97f763f284c4a96ec] + ROLLING_UPLOAD_TOKEN: ENCRYPTED[bc554e7208b73b37e2b776c70905b142a5023cea4a9b89e1370b8815adea18f8436e8b075e6cf1bcb62133d659b5d198] prepare_script: - apt-get update - export DEBIAN_FRONTEND="noninteractive" @@ -135,7 +135,7 @@ silicon_mac_task: APPLEID: ENCRYPTED[549ce052bd5666dba5245f4180bf93b74ed206fe5e6e7c8f67a8596d3767c1f682b84e347b326ac318c62a07c8844a57] APPLEID_PASSWORD: ENCRYPTED[774c3307fd3b62660ecf5beb8537a24498c76e8d90d7f28e5bc816742fd8954a34ffed13f9aa2d1faf66ce08b4496e6f] TEAM_ID: ENCRYPTED[11f3fedfbaf4aff1859bf6c105f0437ace23d84f5420a2c1cea884fbfa43b115b7834a463516d50cb276d4c4d9128b49] - ROLLING_UPLOAD_TOKEN: ENCRYPTED[bda9bda0d9ca3ed72f8efdf33e09c0abe63f568db948b11e348f963dd532c08fdf91e54d7db549b97f763f284c4a96ec] + ROLLING_UPLOAD_TOKEN: ENCRYPTED[bc554e7208b73b37e2b776c70905b142a5023cea4a9b89e1370b8815adea18f8436e8b075e6cf1bcb62133d659b5d198] prepare_script: - brew update - brew uninstall node@20 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ae8ba3ad6..31232ccac5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,22 @@ ## [Unreleased] +## 1.123.0 + - Fixed SQL State Storage not loading when starting Pulsar from a self-contained binary like appImage, tar.gz, etc. +- [symbols-view] Allow project-wide symbol search to consider results from more than one provider. +- Tree-sitter fixes and enhancements for hyperlinks, C, and shell scripts. +- Restore use of `shell.moveItemToTrash` API in tree-view, for Electron 12 compatibility. + +### Pulsar + +- Tree-sitter rolling fixes, 1.123 edition [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/1118) +- [symbols-view] Allow project-wide symbol searches to consider multiple providers [@savetheclocktower](github.com/pulsar-edit/pulsar/pull/1133) +- electron-builder: Fix race condition when preparing to copy binaries [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/1137) +- [ci] Update GitHub Token in CirrusCI config [@confused-Techie](https://github.com/pulsar-edit/pulsar/pull/1134) +- Fixing requiring of better-sqlite3 [@mauricioszabo](github.com/pulsar-edit/pulsar/pull/1122) +- Revert removal of `shell.moveItemToTrash` [@savetheclocktower](https://github.com/pulsar-edit/pulsar/pull/1125) +- CI: Bump macOS runner images from macos-12 to macos-13 [@DeeDeeG](https://github.com/pulsar-edit/pulsar/pull/1120) ## 1.122.0 diff --git a/package.json b/package.json index 1af5fa8215..fdd1374fdb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pulsar", "author": "Pulsar-Edit ", "productName": "Pulsar", - "version": "1.122.0-dev", + "version": "1.123.0-dev", "description": "A Community-led Hyper-Hackable Text Editor", "branding": { "id": "pulsar", diff --git a/packages/language-c/grammars/tree-sitter-cpp/highlights.scm b/packages/language-c/grammars/tree-sitter-cpp/highlights.scm index 0aaca38b19..6ac6dc4b73 100644 --- a/packages/language-c/grammars/tree-sitter-cpp/highlights.scm +++ b/packages/language-c/grammars/tree-sitter-cpp/highlights.scm @@ -152,10 +152,10 @@ ; ((identifier) @variable.other.readwrite.member.cpp ; (#match? @variable.other.readwrite.member.cpp "^(f|m)[A-Z]\\w*$")) -; The "foo" in `int &foo` with in a parameter list. -(parameter_declaration - declarator: (reference_declarator - (identifier) @variable.parameter.cpp)) +; The "foo" in `const char *foo` within a parameter list. +; (Should work no matter how many pointers deep we are.) +(reference_declarator (identifier) @variable.parameter.cpp + (#is? test.descendantOfType "parameter_declaration")) ; KEYWORDS diff --git a/packages/language-hyperlink/grammars/modern-tree-sitter-hyperlink.cson b/packages/language-hyperlink/grammars/modern-tree-sitter-hyperlink.cson index 7977a53691..ebd8738380 100644 --- a/packages/language-hyperlink/grammars/modern-tree-sitter-hyperlink.cson +++ b/packages/language-hyperlink/grammars/modern-tree-sitter-hyperlink.cson @@ -5,6 +5,6 @@ parser: 'tree-sitter-hyperlink' injectionRegex: 'hyperlink' treeSitter: - parserSource: 'github:savetheclocktower/tree-sitter-hyperlink#04c3a667ba432236578ac99bbacd0412f88d6fac' + parserSource: 'github:savetheclocktower/tree-sitter-hyperlink#0704b3e5a72892495dd13b85a5064582414cb39a' grammar: 'ts/tree-sitter-hyperlink.wasm' highlightsQuery: 'ts/highlights.scm' diff --git a/packages/language-hyperlink/grammars/ts/tree-sitter-hyperlink.wasm b/packages/language-hyperlink/grammars/ts/tree-sitter-hyperlink.wasm index 723c2ae6bd..21a144fb89 100755 Binary files a/packages/language-hyperlink/grammars/ts/tree-sitter-hyperlink.wasm and b/packages/language-hyperlink/grammars/ts/tree-sitter-hyperlink.wasm differ diff --git a/packages/language-shellscript/grammars/tree-sitter/highlights.scm b/packages/language-shellscript/grammars/tree-sitter/highlights.scm index 031507a766..8c8549738f 100644 --- a/packages/language-shellscript/grammars/tree-sitter/highlights.scm +++ b/packages/language-shellscript/grammars/tree-sitter/highlights.scm @@ -134,7 +134,15 @@ (binary_expression ["&&" "||"] @keyword.operator.logical.shell) (pipeline "|" @keyword.operator.pipe.shell) -(expansion operator: "#" @keyword.operator.expansion.shell) + +; Any expansion operator, including all `#`s and `%`s in the following examples: +; +; foo="${bar#*.}" +; foo="${bar##*.}" +; foo="${bar%*.}" +; foo="${bar%%*.}" +; +(expansion operator: _ @keyword.operator.expansion.shell) ; "*" @keyword.operator.glob.shell diff --git a/packages/symbols-view/lib/project-view.js b/packages/symbols-view/lib/project-view.js index 7988cdb3d2..04d06894cd 100644 --- a/packages/symbols-view/lib/project-view.js +++ b/packages/symbols-view/lib/project-view.js @@ -143,7 +143,11 @@ module.exports = class ProjectView extends SymbolsView { // longer need the symbols we asked for. let signal = this.abortController.signal; - let providers = await this.broker.select(meta); + // A user would probably expect this search to return symbols from all + // files in the project, regardless of their language. Instead of picking a + // “winning” provider as we usually do, we should instead consult _all_ + // providers that consider themselves up to the task. + let providers = await this.broker.select(meta, { enforceExclusivity: false }); if (providers?.length === 0) { console.warn('No providers found!'); return null; diff --git a/packages/symbols-view/lib/provider-broker.js b/packages/symbols-view/lib/provider-broker.js index f702336272..0c28739f42 100644 --- a/packages/symbols-view/lib/provider-broker.js +++ b/packages/symbols-view/lib/provider-broker.js @@ -175,7 +175,7 @@ module.exports = class ProviderBroker { * @returns {Promise} A promise that resolves with a list * of symbol providers. */ - async select(meta) { + async select(meta, { enforceExclusivity = true } = {}) { let shouldLog = Config.get('enableDebugLogging'); let exclusivesByScore = []; let results = []; @@ -210,7 +210,14 @@ module.exports = class ProviderBroker { let { value: score } = outcome; let name = provider.name ?? 'unknown'; let packageName = provider?.packageName ?? 'unknown'; - let isExclusive = provider?.isExclusive ?? false; + + // When `enforceExclusivity` is `false`, we'll treat all providers as + // non-exclusive, even the ones that indicate otherwise. + // + // It still falls on a provider to know whether to provide symbols or + // not. Any provider is free to inspect the metadata and return an empty + // set if it thinks it's inappropriate for its results to be considered. + let isExclusive = enforceExclusivity ? (provider?.isExclusive ?? false) : false; if (shouldLog) console.debug('Score for', provider.name, 'is:', score); diff --git a/packages/symbols-view/spec/fixtures/providers/second-dummy-provider.js b/packages/symbols-view/spec/fixtures/providers/second-dummy-provider.js new file mode 100644 index 0000000000..5f5cd9e8fb --- /dev/null +++ b/packages/symbols-view/spec/fixtures/providers/second-dummy-provider.js @@ -0,0 +1,51 @@ +const { Point } = require('atom'); + +function last(arr) { + return arr[arr.length - 1]; +} + +const ICONS = [ + 'icon-package', + 'icon-key', + 'icon-gear', + 'icon-tag', + null +]; + +module.exports = { + packageName: 'symbol-provider-dummy-second', + name: 'Dummy (Second)', + isExclusive: true, + canProvideSymbols() { + return true; + }, + getSymbols(meta) { + let { editor, type } = meta; + let results = []; + if (type === 'file') { + let count = editor.getLineCount(); + // Put a symbol on every third line. + for (let i = 0; i < count; i += 3) { + results.push({ + position: new Point(i, 0), + name: `(Second) Symbol on Row ${i + 1}`, + icon: ICONS[(i / 3) % (ICONS.length + 1)] + }); + } + } else if (type === 'project') { + let root = last(atom.project.getPaths()); + let count = editor.getLineCount(); + // Put a symbol on every third line. + for (let i = 0; i < count; i += 3) { + results.push({ + position: new Point(i, 0), + name: `(Second) Symbol on Row ${i + 1}`, + directory: root, + file: 'other-file.js', + icon: ICONS[i % (ICONS.length + 1)] + }); + } + } + return results; + } +}; diff --git a/packages/symbols-view/spec/symbols-view-spec.js b/packages/symbols-view/spec/symbols-view-spec.js index ef73f3b599..9001bd62ee 100644 --- a/packages/symbols-view/spec/symbols-view-spec.js +++ b/packages/symbols-view/spec/symbols-view-spec.js @@ -7,6 +7,7 @@ const SymbolsView = require('../lib/symbols-view'); const { migrateOldConfigIfNeeded } = require('../lib/util'); const DummyProvider = require('./fixtures/providers/dummy-provider'); +const SecondDummyProvider = require('./fixtures/providers/second-dummy-provider'); const AsyncDummyProvider = require('./fixtures/providers/async-provider'); const ProgressiveProjectProvider = require('./fixtures/providers/progressive-project-provider.js'); const QuicksortProvider = require('./fixtures/providers/quicksort-provider.js'); @@ -696,6 +697,27 @@ describe('SymbolsView', () => { expect(symbolsView.element.querySelector('li:first-child .secondary-line')).toHaveText(`${relative}:13`); }); + it('includes results from all providers, even if they claim to be exclusive', async () => { + registerProvider(DummyProvider); + registerProvider(SecondDummyProvider); + + await dispatchAndWaitForChoices('symbols-view:toggle-project-symbols'); + symbolsView = atom.workspace.getModalPanels()[0].item; + + expect(symbolsView.selectListView.refs.loadingMessage).toBeUndefined(); + expect(document.body.contains(symbolsView.element)).toBe(true); + expect(symbolsView.element.querySelectorAll('li').length).toBe(10); + + let root = atom.project.getPaths()[1]; + let resolved = directory.resolve('other-file.js'); + let relative = `${path.basename(root)}${resolved.replace(root, '')}`; + + expect(symbolsView.element.querySelector('li:first-child .primary-line')).toHaveText('Symbol on Row 1'); + expect(symbolsView.element.querySelector('li:first-child .secondary-line')).toHaveText(`${relative}:1`); + expect(symbolsView.element.querySelector('li:last-child .primary-line')).toHaveText('(Second) Symbol on Row 13'); + expect(symbolsView.element.querySelector('li:last-child .secondary-line')).toHaveText(`${relative}:13`); + }); + it('does not prefill the query field if `prefillSelectedText` is `false`', async () => { atom.config.set('symbols-view.prefillSelectedText', false); registerProvider(DummyProvider); diff --git a/packages/welcome/lib/changelog-view.js b/packages/welcome/lib/changelog-view.js index 8f47460936..e932bbe404 100644 --- a/packages/welcome/lib/changelog-view.js +++ b/packages/welcome/lib/changelog-view.js @@ -50,34 +50,16 @@ export default class ChangeLogView {

Feel free to read our Full Change Log.

diff --git a/script/electron-builder.js b/script/electron-builder.js index a49fd52f40..9a15598285 100644 --- a/script/electron-builder.js +++ b/script/electron-builder.js @@ -1,6 +1,7 @@ const path = require('path') const normalizePackageData = require('normalize-package-data'); const fs = require("fs/promises"); +const {mkdirSync} = require("fs"); const generateMetadata = require('./generate-metadata-for-builder') const macBundleDocumentTypes = require("./mac-bundle-document-types.js"); @@ -198,7 +199,8 @@ let options = { }, }, "dmg": { - "sign": false + "sign": false, + "writeUpdateInfo": false }, "win": { "icon": icoIcon, @@ -235,7 +237,8 @@ let options = { // the AppID 'dev.pulsar-edit.pulsar'. If this value ever changes, // A PR to GitHub Desktop must be made with the updated value "include": "resources/win/installer.nsh", - "warningsAsErrors": false + "warningsAsErrors": false, + "differentialPackage": false }, "extraMetadata": { }, @@ -289,7 +292,13 @@ async function main() { config: options }).then((result) => { console.log("Built binaries") - fs.mkdir('binaries').catch(() => "") + try { + mkdirSync('binaries', {recursive: true}) + } catch (err) { + console.warn("Warning: error encountered when making the 'binaries' dir.") + console.warn("(HINT: If the 'binaries' folder already exists, then this error message is probably fine to ignore!)") + console.warn(err) + } Promise.all(result.map(r => fs.copyFile(r, path.join('binaries', path.basename(r))))) }).catch((error) => { console.error("Error building binaries")