Commit Graph

226 Commits

Author SHA1 Message Date
Daniel Imms
30e78576e7 Support for OSC52 clipboard access
Fixes #193508
2024-06-04 11:32:59 -07:00
Benjamin Pasero
00f0f260b9 esm - remove graceful-fs (#214164)
* esm - remove `graceful-fs`

This module was used to patch `fs`, which is not supported in ESM. Besides, it makes us behave different from standard node.js that has meanwhile evolved from the time where `graceful-fs` was created.

* update comment

* update comment

* use more `fs.promises`

* 💄
2024-06-04 09:27:08 +02:00
Benjamin Pasero
0cb971b634 aux window - support Firefox (#213769)
* aux window - support Firefox

* add more

* only use workaround for FF

* enable issue repoter again

* .
2024-05-29 00:46:24 -07:00
Alexandru Dima
c70ad34882 Adopt ensureNoDisposablesAreLeakedInTestSuite (#213557)
Adopt ensureNoDisposablesAreLeakedInTestSuite (#200091)
2024-05-27 15:16:03 +02:00
Matt Bierner
001929db91 Add eslint rule for disallowing dangerous type assertions (#211669)
This adds a new (off by default) eslint rule that disables two specific types of dangerous type assertions:

```ts
<Type>{...};
{...} as Type;
```

These are bad because they can easily hide missing properties and strictness errors

Right now just adding this rule but will assign out fixes to owners in different areas of the code
2024-04-30 11:27:22 -07:00
Daniel Imms
febfca1337 Remove canvas references in build/lint 2024-04-26 10:34:28 -07:00
Matt Bierner
ae91138701 Add eslint rule for potentially unsafe disposable patterns (#209555)
`DisposableStore`/`MutableDisposable` properties should almost always be `readonly`. Otherwise it's easy to accidentally overwrite the property and leak the previous value. This commonly happens with code such as:

```ts
class Foo {
     private disposables = new DisposableStore();

     bar() {
         this.disposables = new DisposableStore(); // leaks old values
         ...
     }
```

This change adds an eslint rule to enforce this and adopts `readonly` for the caught cases. I only needed to add 2 suppression comments, which seems like an acceptable tradeoff for helping catch a common mistake
2024-04-04 10:34:45 -07:00
Matt Bierner
1e765ade0e Fix injected services becoming public by mistake (#209513)
* Fix injected services becoming public by mistake

Fixes cases of `@IFooService readonly foo: IFooService`. This makes the service public, which is likely not expected and also means we can't mangle it

* Fix name

* Remove unused props
2024-04-04 08:06:16 +02:00
Daniel Imms
156db3ec27 Remove xterm triggerDataEvent private API usage 2024-04-01 09:56:15 -07:00
Logan Ramos
9243c3db85 Ensure no disposables leak (#209040) 2024-03-28 18:30:08 +01:00
Henning Dieterichs
bf01138b14 Adresses #200091 2024-03-27 10:46:42 +01:00
Peng Lyu
cfa5001723 Allow type imports only in webview preloads (#204639) 2024-02-07 10:00:30 -08:00
Ulugbek Abdullaev
d112117119 add ensureNoDisposablesAreLeakedInTestSuite() to tests 2024-01-31 15:04:23 +01:00
Ulugbek Abdullaev
95722d2256 add ensureNoDisposablesAreLeakedInTestSuite() to tests 2024-01-31 12:23:19 +01:00
Johannes Rieken
fa558765b1 Joh/spatial-pig (#203535)
* more `ensureNoDisposablesAreLeakedInTestSuite`

* adopt `ensureNoDisposablesAreLeakedInTestSuite` for api command tests
2024-01-26 16:19:08 +01:00
Johannes Rieken
fb5a1aca6d add more leakage checks in tests (#203525)
re https://github.com/microsoft/vscode/issues/200091
2024-01-26 13:59:40 +01:00
Johannes Rieken
2d0b92d89b some ensureNoDisposablesAreLeakedInTestSuite (#203026)
* some `ensureNoDisposablesAreLeakedInTestSuite`

https://github.com/microsoft/vscode/issues/200091

* update eslint file
2024-01-22 16:46:40 +01:00
Matt Bierner
0cd38c74e6 Add more ensureNoDisposablesAreLeakedInTestSuite (#202292)
For #200091
2024-01-18 19:46:25 +01:00
Benjamin Pasero
bc94d88d66 Adopt ensureNoDisposablesAreLeakedInTestSuite round 2 (#200091) (#202399) 2024-01-13 21:20:02 +01:00
Logan Ramos
753024143d Adopt ensureNoDisposablesAreLeakedInTestSuite (#202245) 2024-01-11 15:14:42 +01:00
Sandeep Somavarapu
573c43c196 #200091 adopt ensureNoDisposablesAreLeakedInTestSuite (#202241) 2024-01-11 14:13:57 +01:00
Martin Aeschlimann
c30c5b3e55 Adopt ensureNoDisposablesAreLeakedInTestSuite round 2 (#202230) 2024-01-11 11:13:26 +01:00
Connor Peet
7dab57d216 ensureNoDisposables leaked in base/common code (#202175)
* ensureNoDisposables leaked in base/common code

* more
2024-01-10 19:28:26 +01:00
Sandeep Somavarapu
6bf996da2b adopt ensureNoDisposablesAreLeakedInTestSuite (#202121)
#200091 adopt ensureNoDisposablesAreLeakedInTestSuite
2024-01-10 07:32:20 +01:00
Aaron Munger
8371e4a567 easy no leak test cases (#201017)
* easy no leak cases

* remove unused function
2023-12-15 13:53:43 -08:00
Andrea Mah
d260879c50 ensureNoDisposablesAreLeakedInTestSuite for workbench search (#201019) 2023-12-15 13:26:23 -08:00
Tyler James Leonhardt
42dce49ee9 more ensureNoDisposablesAreLeakedInTestSuite (#200878)
ref https://github.com/microsoft/vscode/issues/200091
2023-12-14 20:21:53 +01:00
Johannes Rieken
5bf577b08a make sure super.dispose is called inside overridden dispose methods (#200342) 2023-12-08 13:45:44 +01:00
Raymond Zhao
182f5125f2 test: add ensureNoDisposablesAreLeakedInTestSuite (#200183)
* test: add ensureNoDisposablesAreLeakedInTestSuite

* fix: register moar disposables

* chore: adjust some registrations

* chore: preferencesService is a singleton

* fix: revert to registering the input within the singleton

* make TestEditorService disposable and dispose its inputs

* rm leak

---------

Co-authored-by: Connor Peet <connor@peet.io>
2023-12-07 12:24:02 -08:00
Daniel Imms
93b02ca945 Adopt no leaks util in more tests
Part of #200091
2023-12-07 09:00:56 -08:00
Justin Chen
733d76ddd3 Adopting noDisposablesAreLeakedInTestsSuite for Issue Reporter tests (#200200)
added noDisposablesLeakedinTests
2023-12-06 15:31:01 -08:00
Connor Peet
7f359c6e9b eng: adopt ensureNoDisposablesAreLeakedInTestSuite (#200173)
Also includes debug code. I verified the issue we hit before (#192653) didn't regress
2023-12-06 11:49:44 -08:00
Ladislau Szomoru
7ac853f140 Engineering - adopt ensureNoDisposablesAreLeakedInTestSuite() in workspace trust tests (#200160) 2023-12-06 17:58:21 +01:00
Logan Ramos
e2f7dc558d Adopt ensureNoDisposablesAreLeakedInTestSuite in my tests (#200153)
* Adopt ensureNoDisposablesAreLeakedInTestSuite in my tests

* Update eslint
2023-12-06 17:35:42 +01:00
Benjamin Pasero
a187ad1ca3 end - adopt more ensureNoDisposablesAreLeakedInTestSuite (#200145) 2023-12-06 16:01:23 +01:00
Benjamin Pasero
5455d20ce1 debt - adopt ensureNoDisposablesAreLeakedInTestSuite in more tests (#200116)
* debt - adopt `ensureNoDisposablesAreLeakedInTestSuite` in more tests

* .

* .

* .
2023-12-06 12:09:11 +01:00
Benjamin Simmonds
52ca689ee7 ensureNoDisposablesAreLeakedInTestSuite (#200115)
* ensureNoDisposablesAreLeakedInTestSuite

* 💄
2023-12-06 11:51:56 +01:00
Tyler James Leonhardt
5196dddde0 Low hanging fruit of onboarding to ensureNoDisposablesAreLeakedInTestSuite (#200100)
ref https://github.com/microsoft/vscode/issues/200091
2023-12-05 21:53:40 -08:00
Connor Peet
16c469a671 eng: add a lint rule for ensureNoDisposablesAreLeakedInTestSuite (#200089)
Adds a lint rule that ensures ensureNoDisposablesAreLeakedInTestSuite
is called in suites. It grandfathers in existing files that were lacking
the call entirely.

This PR also includes manual fixes to files that used the function
already but were missing it in one or more suites, which the lint rule
detects.
2023-12-05 14:35:27 -08:00
Benjamin Pasero
f07a79042a aux window - fix broken ESLint validation pattern (#199204) 2023-11-27 19:55:29 +01:00
Connor Peet
a0b548807a eng: add assertHeap method for memory assertions (#198334)
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
2023-11-15 10:41:22 -08:00
Benjamin Pasero
cb9c48673f aux window - reduce deprecated $window usages (#197800)
* aux window - reduce deprecated $window usages

* aux window - reduce deprecated $window usages

* aux window - reduce deprecated $window usages

* aux window - reduce deprecated $window usages
2023-11-09 09:09:02 +01:00
Benjamin Pasero
f346494c77 aux window - cleanup eslint rules (#197763) 2023-11-09 05:55:21 +01:00
Benjamin Pasero
c90951b147 aux window - less global document usages (#197701)
* aux window - less global `document` usages

* aux window - less global `document` usages

* aux window - less global `document` usages
2023-11-08 08:39:04 +01:00
Benjamin Pasero
3453c4f9f0 aux window - avoid/flag more globals (#197614)
* aux window - avoid/flag more globals

* fix access from worker

* allow `queueMicrotask`

* more adoptions

* fix build

* avoid $globalThis
2023-11-07 12:52:20 +01:00
Benjamin Pasero
9050cd7553 aux window - reduce global access to window (#197538) 2023-11-06 18:06:36 +01:00
Daniel Imms
3a351bdc29 Move to xterm scoped image addon 2023-11-01 14:47:59 -07:00
Daniel Imms
9d1bc6ae59 Move to scoped xterm.js packages
xterm-addon-image is excluded currently as there are some publishing
issues.

See xtermjs/xterm.js#4859
2023-11-01 12:15:41 -07:00
Connor Peet
331e445eff eng: add a basic 'must use result' and ensure assertSnapshot result is used (#194744)
* eng: add a basic 'must use result' and ensure assertSnapshot result is used

Fixes #194570

* fix found lint
2023-10-03 20:08:56 +01:00
Benjamin Pasero
73cc570f58 Allow for multiple editor parts (#193425)
* 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>
2023-10-03 12:20:06 +02:00