This adds an `assertHeap` function that can be used in tests. It
takes a heap snapshot, and asserts the state of classes in memory. This
works in Node and the Electron sandbox, but is a no-op in the browser.
Snapshots are process asynchronously and will report failures at the end
of the suite.
This method should be used sparingly (e.g. once at the end of a suite to
ensure nothing leaked before), as gathering a heap snapshot is fairly
slow, at least until V8 11.5.130 (https://v8.dev/blog/speeding-up-v8-heap-snapshots).
When used, the function will ensure the test has a minimum timeout
duration of 20s to avoid immediate failures.
It takes options containing a mapping of class names, and assertion functions
to run on the number of retained instances of that class. For example:
```ts
assertSnapshot({
classes: {
ShouldNeverLeak: count => assert.strictEqual(count, 0),
SomeSingleton: count => assert(count <= 1),
}
});
```
Closes https://github.com/microsoft/vscode/issues/191920
* demo
* wip
* polish
* allow to toggle
* compile
* enable devtools
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* Avoid using global document, global window
* Fix exception caused by reading the size of the newly created window before it is available
* cleanup
* make it more useful
* apply zoom
* first cut editor parts
* cleanup
* scaffold some services
* preserve view state
* simple label distinction
* introduce accessor
* support dnd
* fix open editors view
* share window options
* cleanup
* 💄
* 💄
* 💄
* 💄
* cleanup on unload
* add todo
* stylescleanup
* avoid instanceof checks
* share more styles
* revert changes partially
* fix custom menus
* more alignment to main window
* codicon does not seem to be needed anymore
* no need for isHTMLElement
* fix icon error on macOS
* prevent `document.createElement`
* close child window when main window closes
* better active groups tracking
* cleanup
* pass along editor parts viewer
* eslint rule for instanceof checks
* add dom tests
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
* cleanup
---------
Co-authored-by: Alex Dima <alexdima@microsoft.com>
* Add an id to responses that comes from the provider
* Add event fired when the user performs actions on interactive session responses
* Only show user action buttons when the provider has added a response ID
Resubmission of #157532 with the following changes:
- Use `eslint-plugin-local` instead of `yarn` link to run our plugins
- Move our plugins to a top level `.eslintplugin` dir (as required by `eslint-plugin-local`)
- Update all names to `local/`
* Run our custom eslint rules using ts-node
Use `ts-node` to run our custom eslint rules. This lets us delete the pre-compiled js. It also means you can don't have to compile the rules while editing them
As part of this change, I've also switched us to using an eslint plugin instead of a rulesDir. This is now the preferred way to ship custom rules
* Fix two more disables
* Move ts-node to project root
* Enable transpileOnly