From 27925289d4fd8d0d2c9ae560139bb8b2f671ccdd Mon Sep 17 00:00:00 2001 From: Matt Irvine Date: Wed, 19 Sep 2018 17:27:10 -0700 Subject: [PATCH] Scroll query editor when clicking batch links (#2644) --- src/sql/parts/query/editor/messagePanel.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/sql/parts/query/editor/messagePanel.ts b/src/sql/parts/query/editor/messagePanel.ts index 78ac60c5a6..45e08b3b28 100644 --- a/src/sql/parts/query/editor/messagePanel.ts +++ b/src/sql/parts/query/editor/messagePanel.ts @@ -29,6 +29,7 @@ import { isArray, isUndefinedOrNull } from 'vs/base/common/types'; import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { IEditor } from 'vs/editor/common/editorCommon'; +import { QueryInput } from 'sql/parts/query/common/queryInput'; export interface IResultMessageIntern extends IResultMessage { id?: string; @@ -302,14 +303,8 @@ export class MessageController extends WorkbenchTreeController { if (element.selection) { let selection: ISelectionData = element.selection; // this is a batch statement - let control = this.workbenchEditorService.activeControl.getControl() as IEditor; - control.setSelection({ - startColumn: selection.startColumn + 1, - endColumn: selection.endColumn + 1, - endLineNumber: selection.endLine + 1, - startLineNumber: selection.startLine + 1 - }); - control.focus(); + let input = this.workbenchEditorService.activeEditor as QueryInput; + input.updateSelection(selection); } return true;