MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / add

Method add

src/platform/common/utils/lifecycle.ts:135–156  ·  view source on GitHub ↗

* Add a new IDisposable disposable to the collection.

(o: T)

Source from the content-addressed store, hash-verified

133 * Add a new {@link IDisposable disposable} to the collection.
134 */
135 public add<T extends IDisposable>(o: T): T {
136 if (!o) {
137 return o;
138 }
139 if ((o as unknown as DisposableStore) === this) {
140 throw new Error('Cannot register a disposable on itself!');
141 }
142
143 if (this._isDisposed) {
144 if (!DisposableStore.DISABLE_DISPOSED_WARNING) {
145 console.warn(
146 new Error(
147 'Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!'
148 ).stack
149 );
150 }
151 } else {
152 this._toDispose.add(o);
153 }
154
155 return o;
156 }
157}
158
159/**

Callers 12

executeQueuedCellsMethod · 0.95
activateMethod · 0.95
selectKernelAndStartFunction · 0.95
waitForKernelToBeReadyFunction · 0.95
crateMockedPythonApiFunction · 0.95
onDidCreateKernelMethod · 0.95
ignorePortForwardingFunction · 0.95
wrapAndReportProgressMethod · 0.95
constructorMethod · 0.95

Calls 2

warnMethod · 0.65
addMethod · 0.65

Tested by 1

crateMockedPythonApiFunction · 0.76