mirror of
https://github.com/microsoft/vscode.git
synced 2026-10-10 04:30:15 +01:00
Use ?. in a few more places
This commit is contained in:
1 parent
5f43e66c4d
commit
8fcd2e659e
2 files changed
+3
-5
No files matched your search
@@ -152,7 +152,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
|
||||
|
||||
for (const handler of this.openEditorHandlers) {
|
||||
const result = handler(event.editor, event.options, group);
|
||||
const override = result ? result.override : undefined;
|
||||
const override = result?.override;
|
||||
if (override) {
|
||||
event.prevent((() => override.then(editor => withNullAsUndefined(editor))));
|
||||
break;
|
||||
@@ -161,9 +161,7 @@ export class EditorService extends Disposable implements EditorServiceImpl {
|
||||
}
|
||||
|
||||
get activeControl(): IVisibleEditor | undefined {
|
||||
const activeGroup = this.editorGroupService.activeGroup;
|
||||
|
||||
return activeGroup ? activeGroup.activeControl : undefined;
|
||||
return this.editorGroupService.activeGroup?.activeControl;
|
||||
}
|
||||
|
||||
get activeTextEditorWidget(): ICodeEditor | IDiffEditor | undefined {
|
||||
|
||||
@@ -482,7 +482,7 @@ export class HistoryService extends Disposable implements IHistoryService {
|
||||
}
|
||||
|
||||
private handleEditorEventInHistory(editor?: IBaseEditor): void {
|
||||
const input = editor ? editor.input : undefined;
|
||||
const input = editor?.input;
|
||||
|
||||
// Ensure we have at least a name to show and not configured to exclude input
|
||||
if (!input || !input.getName() || !this.include(input)) {
|
||||
|
||||
Reference in new issue
Block a user