From 461d041a50ed648cad3a0e1a13dd864ccbd2729b Mon Sep 17 00:00:00 2001 From: Karl Burtram Date: Thu, 6 Sep 2018 14:09:34 -0700 Subject: [PATCH] Fix SQLPLAN custom editor support (#2439) --- src/vs/workbench/services/editor/browser/editorService.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/vs/workbench/services/editor/browser/editorService.ts b/src/vs/workbench/services/editor/browser/editorService.ts index 1779228f74..4303da43fd 100644 --- a/src/vs/workbench/services/editor/browser/editorService.ts +++ b/src/vs/workbench/services/editor/browser/editorService.ts @@ -29,6 +29,7 @@ import { coalesce } from 'vs/base/common/arrays'; import { isCodeEditor, isDiffEditor, ICodeEditor, IDiffEditor } from 'vs/editor/browser/editorBrowser'; import { IEditorGroupView, IEditorOpeningEvent, EditorGroupsServiceImpl, EditorServiceImpl } from 'vs/workbench/browser/parts/editor/editor'; import { IUriDisplayService } from 'vs/platform/uriDisplay/common/uriDisplay'; +import { convertEditorInput } from 'sql/parts/common/customInputConverter'; type ICachedEditorInput = ResourceEditorInput | IFileEditorInput | DataUriEditorInput; @@ -232,13 +233,18 @@ export class EditorService extends Disposable implements EditorServiceImpl { return this.doOpenEditor(targetGroup, editor, editorOptions); } + // {{SQL CARBON EDIT}} // Untyped Text Editor Support const textInput = editor; - const typedInput = this.createInput(textInput); + let typedInput = this.createInput(textInput); if (typedInput) { const editorOptions = TextEditorOptions.from(textInput); const targetGroup = this.findTargetGroup(typedInput, editorOptions, optionsOrGroup as IEditorGroup | GroupIdentifier); + // {{SQL CARBON EDIT}} + // Convert input into custom type if it's one of the ones we support + typedInput = convertEditorInput(typedInput, editorOptions, this.instantiationService); + return this.doOpenEditor(targetGroup, typedInput, editorOptions); }