提交 dd20d8cb 编写于 作者: Y Yuki Ueda

delete mode change event

上级 08c50ca7
......@@ -21,8 +21,7 @@ import {ScrollableElement} from 'vs/base/browser/ui/scrollbar/scrollableElementI
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
import {IKeybindingContextKey, IKeybindingService} from 'vs/platform/keybinding/common/keybindingService';
import {ITelemetryService} from 'vs/platform/telemetry/common/telemetry';
import {EventType, IModeSupportChangedEvent} from 'vs/editor/common/editorCommon';
import {SuggestRegistry} from 'vs/editor/common/modes';
import {EventType} from 'vs/editor/common/editorCommon';
import {ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition} from 'vs/editor/browser/editorBrowser';
import {CONTEXT_SUGGESTION_SUPPORTS_ACCEPT_ON_KEY} from '../common/suggest';
import {CompletionItem, CompletionModel} from './completionModel';
......@@ -278,7 +277,6 @@ export class SuggestWidget implements IContentWidget, IDisposable {
private state: State;
private isAuto: boolean;
private shouldShowEmptySuggestionList: boolean;
private suggestionSupportsAutoAccept: IKeybindingContextKey<boolean>;
private loadingTimeout: number;
private currentSuggestionDetails: TPromise<void>;
......@@ -336,10 +334,6 @@ export class SuggestWidget implements IContentWidget, IDisposable {
this.list = new List(this.listElement, this.delegate, [renderer]);
this.toDispose = [
editor.addListener2(EventType.ModelChanged, () => this.onModelModeChanged()),
editor.addListener2(EventType.ModelModeChanged, () => this.onModelModeChanged()),
editor.addListener2(EventType.ModelModeSupportChanged, (e: IModeSupportChangedEvent) => e.suggestSupport && this.onModelModeChanged()),
SuggestRegistry.onDidChange(() => this.onModelModeChanged()),
editor.addListener2(EventType.EditorTextBlur, () => this.onEditorBlur()),
this.list.onSelectionChange(e => this.onListSelection(e)),
this.list.onFocusChange(e => this.onListFocus(e)),
......@@ -349,7 +343,6 @@ export class SuggestWidget implements IContentWidget, IDisposable {
this.model.onDidCancel(e => this.onDidCancel(e))
];
this.onModelModeChanged();
this.editor.addContentWidget(this);
this.setState(State.Hidden);
......@@ -476,9 +469,6 @@ export class SuggestWidget implements IContentWidget, IDisposable {
.then(() => this.currentSuggestionDetails = null);
}
private onModelModeChanged(): void {
this.shouldShowEmptySuggestionList = true;
}
private setState(state: State): void {
const stateChanged = this.state !== state;
......@@ -573,11 +563,7 @@ export class SuggestWidget implements IContentWidget, IDisposable {
if (e.auto) {
this.setState(State.Hidden);
} else {
if (this.shouldShowEmptySuggestionList) {
this.setState(State.Empty);
} else {
this.setState(State.Hidden);
}
this.setState(State.Empty);
}
this.completionModel = null;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册