mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 14:31:31 +01:00
editor - conditionally show editor open errors in a modal dialog
This commit is contained in:
@@ -9,7 +9,7 @@ import { isUndefinedOrNull, withNullAsUndefined, assertIsDefined } from 'vs/base
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IDisposable, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IEditor as ICodeEditor, IEditorViewState, ScrollType, IDiffEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, IResourceInput, EditorActivation } from 'vs/platform/editor/common/editor';
|
||||
import { IEditorModel, IEditorOptions, ITextEditorOptions, IBaseResourceInput, IResourceInput, EditorActivation, EditorOpenContext } from 'vs/platform/editor/common/editor';
|
||||
import { IInstantiationService, IConstructorSignature0, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { RawContextKey, ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
@@ -775,6 +775,18 @@ export class EditorOptions implements IEditorOptions {
|
||||
*/
|
||||
ignoreOverrides: boolean | undefined;
|
||||
|
||||
/**
|
||||
* A optional hint to signal in which context the editor opens.
|
||||
*
|
||||
* If configured to be `EditorOpenContext.USER`, this hint can be
|
||||
* used in various places to control the experience. For example,
|
||||
* if the editor to open fails with an error, a notification could
|
||||
* inform about this in a modal dialog. If the editor opened through
|
||||
* some background task, the notification would show in the background,
|
||||
* not as a modal dialog.
|
||||
*/
|
||||
context: EditorOpenContext | undefined;
|
||||
|
||||
/**
|
||||
* Overwrites option values from the provided bag.
|
||||
*/
|
||||
@@ -819,6 +831,10 @@ export class EditorOptions implements IEditorOptions {
|
||||
this.ignoreOverrides = options.ignoreOverrides;
|
||||
}
|
||||
|
||||
if (typeof options.context === 'number') {
|
||||
this.context = options.context;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user