提交 ca4f18dc 编写于 作者: P Peng Lyu

remove unsed command service and reorder constructor paramaters.

上级 41f17221
...@@ -18,7 +18,6 @@ import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/brows ...@@ -18,7 +18,6 @@ import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/brows
import * as modes from 'vs/editor/common/modes'; import * as modes from 'vs/editor/common/modes';
import { peekViewBorder } from 'vs/editor/contrib/referenceSearch/referencesWidget'; import { peekViewBorder } from 'vs/editor/contrib/referenceSearch/referencesWidget';
import { IOptions, ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget'; import { IOptions, ZoneWidget } from 'vs/editor/contrib/zoneWidget/zoneWidget';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { attachButtonStyler } from 'vs/platform/theme/common/styler'; import { attachButtonStyler } from 'vs/platform/theme/common/styler';
import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; import { ITheme, IThemeService } from 'vs/platform/theme/common/themeService';
import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer'; import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer';
...@@ -107,7 +106,6 @@ export class ReviewZoneWidget extends ZoneWidget { ...@@ -107,7 +106,6 @@ export class ReviewZoneWidget extends ZoneWidget {
private _toggleAction: Action; private _toggleAction: Action;
private _commentThread: modes.CommentThread; private _commentThread: modes.CommentThread;
private _commentGlyph: CommentGlyphWidget; private _commentGlyph: CommentGlyphWidget;
private _replyCommand: modes.Command;
private _owner: number; private _owner: number;
private _decorationIDs: string[]; private _decorationIDs: string[];
private _localToDispose: IDisposable[]; private _localToDispose: IDisposable[];
...@@ -120,23 +118,20 @@ export class ReviewZoneWidget extends ZoneWidget { ...@@ -120,23 +118,20 @@ export class ReviewZoneWidget extends ZoneWidget {
} }
constructor( constructor(
@IInstantiationService private instantiationService: IInstantiationService, private instantiationService: IInstantiationService,
@IModeService private modeService: IModeService, private modeService: IModeService,
@IModelService private modelService: IModelService, private modelService: IModelService,
private themeService: IThemeService,
private commentService: ICommentService,
editor: ICodeEditor, editor: ICodeEditor,
owner: number, owner: number,
commentThread: modes.CommentThread, commentThread: modes.CommentThread,
replyCommand: modes.Command, options: IOptions = {}
options: IOptions = {},
private readonly themeService: IThemeService,
private readonly commandService: ICommandService,
private readonly commentService: ICommentService
) { ) {
super(editor, options); super(editor, options);
this._resizeObserver = null; this._resizeObserver = null;
this._owner = owner; this._owner = owner;
this._commentThread = commentThread; this._commentThread = commentThread;
this._replyCommand = replyCommand;
this._isCollapsed = commentThread.collapsibleState !== modes.CommentThreadCollapsibleState.Expanded; this._isCollapsed = commentThread.collapsibleState !== modes.CommentThreadCollapsibleState.Expanded;
this._decorationIDs = []; this._decorationIDs = [];
this._localToDispose = []; this._localToDispose = [];
......
...@@ -18,7 +18,6 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; ...@@ -18,7 +18,6 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModel';
import * as modes from 'vs/editor/common/modes'; import * as modes from 'vs/editor/common/modes';
import { peekViewEditorBackground, peekViewResultsBackground, peekViewResultsSelectionBackground } from 'vs/editor/contrib/referenceSearch/referencesWidget'; import { peekViewEditorBackground, peekViewResultsBackground, peekViewResultsSelectionBackground } from 'vs/editor/contrib/referenceSearch/referencesWidget';
import * as nls from 'vs/nls'; import * as nls from 'vs/nls';
import { ICommandService } from 'vs/platform/commands/common/commands';
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey'; import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry';
...@@ -79,7 +78,6 @@ export class ReviewController implements IEditorContribution { ...@@ -79,7 +78,6 @@ export class ReviewController implements IEditorContribution {
editor: ICodeEditor, editor: ICodeEditor,
@IContextKeyService contextKeyService: IContextKeyService, @IContextKeyService contextKeyService: IContextKeyService,
@IThemeService private themeService: IThemeService, @IThemeService private themeService: IThemeService,
@ICommandService private commandService: ICommandService,
@ICommentService private commentService: ICommentService, @ICommentService private commentService: ICommentService,
@INotificationService private notificationService: INotificationService, @INotificationService private notificationService: INotificationService,
@IInstantiationService private instantiationService: IInstantiationService, @IInstantiationService private instantiationService: IInstantiationService,
...@@ -119,7 +117,7 @@ export class ReviewController implements IEditorContribution { ...@@ -119,7 +117,7 @@ export class ReviewController implements IEditorContribution {
this._commentInfos.forEach(info => { this._commentInfos.forEach(info => {
info.threads.forEach(thread => { info.threads.forEach(thread => {
let zoneWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.editor, info.owner, thread, info.reply, {}, this.themeService, this.commandService, this.commentService); let zoneWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.themeService, this.commentService, this.editor, info.owner, thread, {});
zoneWidget.display(thread.range.startLineNumber); zoneWidget.display(thread.range.startLineNumber);
this._commentWidgets.push(zoneWidget); this._commentWidgets.push(zoneWidget);
}); });
...@@ -214,7 +212,7 @@ export class ReviewController implements IEditorContribution { ...@@ -214,7 +212,7 @@ export class ReviewController implements IEditorContribution {
} }
}); });
added.forEach(thread => { added.forEach(thread => {
let zoneWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.editor, e.owner, thread, thread.reply, {}, this.themeService, this.commandService, this.commentService); let zoneWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.themeService, this.commentService, this.editor, e.owner, thread, {});
zoneWidget.display(thread.range.startLineNumber); zoneWidget.display(thread.range.startLineNumber);
this._commentWidgets.push(zoneWidget); this._commentWidgets.push(zoneWidget);
this._commentInfos.filter(info => info.owner === e.owner)[0].threads.push(thread); this._commentInfos.filter(info => info.owner === e.owner)[0].threads.push(thread);
...@@ -231,7 +229,7 @@ export class ReviewController implements IEditorContribution { ...@@ -231,7 +229,7 @@ export class ReviewController implements IEditorContribution {
// add new comment // add new comment
this._reviewPanelVisible.set(true); this._reviewPanelVisible.set(true);
const { replyCommand, ownerId } = newCommentInfo; const { replyCommand, ownerId } = newCommentInfo;
this._newCommentWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.editor, ownerId, { this._newCommentWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.themeService, this.commentService, this.editor, ownerId, {
threadId: null, threadId: null,
resource: null, resource: null,
comments: [], comments: [],
...@@ -243,7 +241,7 @@ export class ReviewController implements IEditorContribution { ...@@ -243,7 +241,7 @@ export class ReviewController implements IEditorContribution {
}, },
reply: replyCommand, reply: replyCommand,
collapsibleState: CommentThreadCollapsibleState.Expanded, collapsibleState: CommentThreadCollapsibleState.Expanded,
}, replyCommand, {}, this.themeService, this.commandService, this.commentService); }, {});
this._newCommentWidget.onDidClose(e => { this._newCommentWidget.onDidClose(e => {
this._newCommentWidget = null; this._newCommentWidget = null;
...@@ -356,7 +354,7 @@ export class ReviewController implements IEditorContribution { ...@@ -356,7 +354,7 @@ export class ReviewController implements IEditorContribution {
this._commentInfos.forEach(info => { this._commentInfos.forEach(info => {
info.threads.forEach(thread => { info.threads.forEach(thread => {
let zoneWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.editor, info.owner, thread, info.reply, {}, this.themeService, this.commandService, this.commentService); let zoneWidget = new ReviewZoneWidget(this.instantiationService, this.modeService, this.modelService, this.themeService, this.commentService, this.editor, info.owner, thread, {});
zoneWidget.display(thread.range.startLineNumber); zoneWidget.display(thread.range.startLineNumber);
this._commentWidgets.push(zoneWidget); this._commentWidgets.push(zoneWidget);
}); });
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册