From ca4f18dca9ea0bcfb82d58952fae604c2f02c7f7 Mon Sep 17 00:00:00 2001 From: Peng Lyu Date: Thu, 17 May 2018 10:18:55 -0700 Subject: [PATCH] remove unsed command service and reorder constructor paramaters. --- .../electron-browser/commentThreadWidget.ts | 17 ++++++----------- .../commentsEditorContribution.ts | 12 +++++------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts index 1c4f82ceaf3..cc85b12ebf1 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentThreadWidget.ts @@ -18,7 +18,6 @@ import { ICodeEditor, IEditorMouseEvent, MouseTargetType } from 'vs/editor/brows import * as modes from 'vs/editor/common/modes'; import { peekViewBorder } from 'vs/editor/contrib/referenceSearch/referencesWidget'; 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 { ITheme, IThemeService } from 'vs/platform/theme/common/themeService'; import { renderMarkdown } from 'vs/base/browser/htmlContentRenderer'; @@ -107,7 +106,6 @@ export class ReviewZoneWidget extends ZoneWidget { private _toggleAction: Action; private _commentThread: modes.CommentThread; private _commentGlyph: CommentGlyphWidget; - private _replyCommand: modes.Command; private _owner: number; private _decorationIDs: string[]; private _localToDispose: IDisposable[]; @@ -120,23 +118,20 @@ export class ReviewZoneWidget extends ZoneWidget { } constructor( - @IInstantiationService private instantiationService: IInstantiationService, - @IModeService private modeService: IModeService, - @IModelService private modelService: IModelService, + private instantiationService: IInstantiationService, + private modeService: IModeService, + private modelService: IModelService, + private themeService: IThemeService, + private commentService: ICommentService, editor: ICodeEditor, owner: number, commentThread: modes.CommentThread, - replyCommand: modes.Command, - options: IOptions = {}, - private readonly themeService: IThemeService, - private readonly commandService: ICommandService, - private readonly commentService: ICommentService + options: IOptions = {} ) { super(editor, options); this._resizeObserver = null; this._owner = owner; this._commentThread = commentThread; - this._replyCommand = replyCommand; this._isCollapsed = commentThread.collapsibleState !== modes.CommentThreadCollapsibleState.Expanded; this._decorationIDs = []; this._localToDispose = []; diff --git a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts b/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts index 796b974d4fb..57abbdb42a3 100644 --- a/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts +++ b/src/vs/workbench/parts/comments/electron-browser/commentsEditorContribution.ts @@ -18,7 +18,6 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModel'; import * as modes from 'vs/editor/common/modes'; import { peekViewEditorBackground, peekViewResultsBackground, peekViewResultsSelectionBackground } from 'vs/editor/contrib/referenceSearch/referencesWidget'; 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 { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiation/common/instantiation'; import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRegistry'; @@ -79,7 +78,6 @@ export class ReviewController implements IEditorContribution { editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService, @IThemeService private themeService: IThemeService, - @ICommandService private commandService: ICommandService, @ICommentService private commentService: ICommentService, @INotificationService private notificationService: INotificationService, @IInstantiationService private instantiationService: IInstantiationService, @@ -119,7 +117,7 @@ export class ReviewController implements IEditorContribution { this._commentInfos.forEach(info => { 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); this._commentWidgets.push(zoneWidget); }); @@ -214,7 +212,7 @@ export class ReviewController implements IEditorContribution { } }); 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); this._commentWidgets.push(zoneWidget); this._commentInfos.filter(info => info.owner === e.owner)[0].threads.push(thread); @@ -231,7 +229,7 @@ export class ReviewController implements IEditorContribution { // add new comment this._reviewPanelVisible.set(true); 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, resource: null, comments: [], @@ -243,7 +241,7 @@ export class ReviewController implements IEditorContribution { }, reply: replyCommand, collapsibleState: CommentThreadCollapsibleState.Expanded, - }, replyCommand, {}, this.themeService, this.commandService, this.commentService); + }, {}); this._newCommentWidget.onDidClose(e => { this._newCommentWidget = null; @@ -356,7 +354,7 @@ export class ReviewController implements IEditorContribution { this._commentInfos.forEach(info => { 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); this._commentWidgets.push(zoneWidget); }); -- GitLab