mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Use optional chaining for more method calls (#156938)
This rewrites code such as:
```ts
if (thing) {
thing.method();
}
```
To the more concise:
```ts
thing?.method();
```
This was done using a simple find replace. I tried to keep the change pretty conservative so it only touches simple cases like above
This commit is contained in:
@@ -1130,9 +1130,7 @@ class InlineCompletionAdapter extends InlineCompletionAdapterBase {
|
||||
let disposableStore: DisposableStore | undefined = undefined;
|
||||
const pid = this._references.createReferenceId({
|
||||
dispose() {
|
||||
if (disposableStore) {
|
||||
disposableStore.dispose();
|
||||
}
|
||||
disposableStore?.dispose();
|
||||
},
|
||||
items: normalizedResult
|
||||
});
|
||||
@@ -1236,9 +1234,7 @@ class InlineCompletionAdapterNew extends InlineCompletionAdapterBase {
|
||||
let disposableStore: DisposableStore | undefined = undefined;
|
||||
const pid = this._references.createReferenceId({
|
||||
dispose() {
|
||||
if (disposableStore) {
|
||||
disposableStore.dispose();
|
||||
}
|
||||
disposableStore?.dispose();
|
||||
},
|
||||
items: normalizedResult
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user