Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"@babel/core": "7.18.6",
"@electron/remote": "2.1.2",
"@formatjs/fast-memoize": "^2.2.6",
"@parcel/watcher": "^2.5.6",
"@pulsar-edit/atom-keymap": "^9.1.0",
"@pulsar-edit/fuzzy-native": "1.3.1",
"@pulsar-edit/get-scrollbar-style": "^1.0.1",
Expand Down Expand Up @@ -74,6 +75,7 @@
"encoding-selector": "file:packages/encoding-selector",
"etch": "0.14.1",
"event-kit": "^2.5.3",
"fdir": "^6.5.0",
"find-and-replace": "file:packages/find-and-replace",
"find-parent-dir": "^0.3.0",
"focus-trap": "6.3.0",
Expand Down
452 changes: 251 additions & 201 deletions spec/path-watcher-spec.js

Large diffs are not rendered by default.

33 changes: 23 additions & 10 deletions src/atom-environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -488,35 +488,48 @@ class AtomEnvironment {
// need other disposing objects to be able to check it. We won't need to
// reset it because another environment will be created.
this.isDestroying = true;
this.emitter.emit('will-destroy');

this.disposables.dispose();

if (this.workspace) this.workspace.destroy();
this.workspace = null;
this.themes.workspace = null;

if (this.project) this.project.destroy();
this.project = null;

this.commands.clear();

if (this.stylesElement) this.stylesElement.remove();

this.uriHandlerRegistry.destroy();

this.uninstallWindowEventHandler();
}

/**
* @memberof AtomEnvironment
* @function onDidBeep
* @desc Invoke the given callback whenever {@link ::beep} is called.
* @listens ::beep
* @param {function} callback - Function to be called whenever {@link ::beep} is called.
* @returns {Disposable} on which `.dispose()` can be called to unsubscribe.
* @category Event Subscription
*/
// Extend: Invoke the given callback when the environment is destroying, as
// happens during window close or reload.
//
// * `callback` {Function} to be called when the environment starts
// destroying
//
// Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onWillDestroy (callback) {
return this.emitter.on('will-destroy', callback);
}

// Extended: Invoke the given callback whenever {::beep} is called.
//
// * `callback` {Function} to be called whenever {::beep} is called
//
// Returns a {Disposable} on which `.dispose()` can be called to unsubscribe.
onDidBeep(callback) {
return this.emitter.on('did-beep', callback);
}

// Extended: Invoke the given callback when there is an unhandled error, but
// before the devtools pop open
// before the devtools pop open.
//
// * `callback` {Function} to be called whenever there is an unhandled error
// * `event` {Object}
Expand Down
16 changes: 12 additions & 4 deletions src/config-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,21 @@ const configSchema = {
},
fileSystemWatcher: {
description:
'Choose the underlying implementation used to watch for filesystem changes. Emulating changes will miss any events caused by applications other than Pulsar, but may help prevent crashes or freezes.',
'Choose the underlying implementation used to watch for filesystem changes. It’s usually best to let Pulsar handle this, but if you have issues with filesystem events, you can opt into a specific watcher that may work better for your platform.',
type: 'string',
default: 'native',
default: 'default',
enum: [
{
value: 'native',
description: 'Native operating system APIs'
value: 'default',
description: 'Default (let Pulsar decide)'
},
{
value: 'nsfw',
description: 'Node Sentinel File Watcher'
},
{
value: 'parcel',
description: '@parcel/watcher'
}
]
},
Expand Down
Loading
Loading