Add editor contribution tests (#8784)

* wip

* rewrite association

* fix tests

* add more tests

* fix tests

* fix more tests

* fix tests
This commit is contained in:
Anthony Dresser
2020-01-10 18:57:47 -08:00
committed by GitHub
parent 0059ffb777
commit 2f6c944317
16 changed files with 421 additions and 75 deletions

View File

@@ -3,13 +3,12 @@
* 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 { QueryPlanInput, QueryPlanConverter } 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
@@ -23,7 +22,4 @@ 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);
.registerLanguageAssociation(QueryPlanConverter.languages, QueryPlanConverter);