mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-18 01:25:37 -05:00
* update how we handle editors * small edit * handle changing languages * implement generic language association * implement notebook serializers * fix tests * formatting * update how we handle editors * small edit * handle changing languages * implement generic language association * implement notebook serializers * fix tests * formatting * fix broken * fix compile * fix tests * add back in removed note book contributions * fix layering * fix compile errors * fix workbench * fix hanging promises * idk why these changed * fix change * add comments to language change code * fix a few bugs * add query plan association
30 lines
1.6 KiB
TypeScript
30 lines
1.6 KiB
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { QueryPlanInput } from 'sql/workbench/contrib/queryPlan/common/queryPlanInput';
|
|
import { EditorDescriptor, IEditorRegistry, Extensions } from 'vs/workbench/browser/editor';
|
|
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
|
import { Registry } from 'vs/platform/registry/common/platform';
|
|
import { QueryPlanEditor } from 'sql/workbench/contrib/queryPlan/browser/queryPlanEditor';
|
|
import { ILanguageAssociationRegistry, Extensions as LanguageAssociationExtensions } from 'sql/workbench/common/languageAssociation';
|
|
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
|
|
|
// Query Plan editor registration
|
|
|
|
const queryPlanEditorDescriptor = new EditorDescriptor(
|
|
QueryPlanEditor,
|
|
QueryPlanEditor.ID,
|
|
'QueryPlan'
|
|
);
|
|
|
|
Registry.as<IEditorRegistry>(Extensions.Editors)
|
|
.registerEditor(queryPlanEditorDescriptor, [new SyncDescriptor(QueryPlanInput)]);
|
|
|
|
Registry.as<ILanguageAssociationRegistry>(LanguageAssociationExtensions.LanguageAssociations)
|
|
.registerLanguageAssociation('sqlplan', (accessor, editor) => {
|
|
const instantiationService = accessor.get(IInstantiationService);
|
|
return instantiationService.createInstance(QueryPlanInput, editor.getResource());
|
|
}, (editor: QueryPlanInput) => undefined);
|