|
@@ -290,18 +290,19 @@ export class DocumentManager implements IDisposable {
|
|
|
widgetName = 'default'
|
|
|
): IDocumentWidget | undefined {
|
|
|
let newPath = PathExt.normalize(path);
|
|
|
+ let widgetNames = [widgetName];
|
|
|
if (widgetName === 'default') {
|
|
|
- let factory = this.registry.defaultWidgetFactory(newPath);
|
|
|
- if (!factory) {
|
|
|
- return undefined;
|
|
|
- }
|
|
|
- widgetName = factory.name;
|
|
|
+ widgetNames = this.registry
|
|
|
+ .preferredWidgetFactories(newPath)
|
|
|
+ .map(f => f.name);
|
|
|
}
|
|
|
|
|
|
for (let context of this._contextsForPath(newPath)) {
|
|
|
- let widget = this._widgetManager.findWidget(context, widgetName);
|
|
|
- if (widget) {
|
|
|
- return widget;
|
|
|
+ for (const widgetName of widgetNames) {
|
|
|
+ let widget = this._widgetManager.findWidget(context, widgetName);
|
|
|
+ if (widget) {
|
|
|
+ return widget;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return undefined;
|