Skip to content

Commit

Permalink
More explicit names
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbvz committed Sep 11, 2019
1 parent 6cd0bf4 commit 17e4073
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/vs/workbench/contrib/customEditor/browser/customEditors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export class CustomEditorService implements ICustomEditorService {
});
}

public getCustomEditorsForResource(resource: URI): readonly CustomEditorInfo[] {
public getContributedCustomEditors(resource: URI): readonly CustomEditorInfo[] {
return this.customEditors.filter(customEditor =>
customEditor.selector.some(selector => matches(selector, resource)));
}
Expand All @@ -60,7 +60,7 @@ export class CustomEditorService implements ICustomEditorService {
options?: ITextEditorOptions,
group?: IEditorGroup,
): Promise<IEditor | undefined> {
const preferredEditors = await this.getCustomEditorsForResource(resource);
const preferredEditors = this.getContributedCustomEditors(resource);
const defaultEditorId = 'default';
const pick = await this.quickInputService.pick([
{
Expand Down Expand Up @@ -120,7 +120,7 @@ export class CustomEditorContribution implements IWorkbenchContribution {
this.editorService.overrideOpenEditor((editor, options, group) => this.onEditorOpening(editor, options, group));
}

private getConfiguredCustomEditor(resource: URI): string | undefined {
private getUserConfiguredCustomEditor(resource: URI): string | undefined {
const config = this.configurationService.getValue<CustomEditorsAssociations>(customEditorsAssociationsKey) || [];
const match = find(config, association => matches(association, resource));
return match ? match.viewType : undefined;
Expand All @@ -140,8 +140,8 @@ export class CustomEditorContribution implements IWorkbenchContribution {
return;
}

const userConfiguredViewType = this.getConfiguredCustomEditor(resource);
const customEditors = this.customEditorService.getCustomEditorsForResource(resource);
const userConfiguredViewType = this.getUserConfiguredCustomEditor(resource);
const customEditors = this.customEditorService.getContributedCustomEditors(resource);

if (!userConfiguredViewType) {
if (!customEditors.length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const ICustomEditorService = createDecorator<ICustomEditorService>('custo
export interface ICustomEditorService {
_serviceBrand: any;

getCustomEditorsForResource(resource: URI): readonly CustomEditorInfo[];
getContributedCustomEditors(resource: URI): readonly CustomEditorInfo[];

openWith(resource: URI, customEditorViewType: string, options?: ITextEditorOptions, group?: IEditorGroup): Promise<IEditor | undefined>;
promptOpenWith(resource: URI, options?: ITextEditorOptions, group?: IEditorGroup): Promise<IEditor | undefined>;
Expand Down

0 comments on commit 17e4073

Please sign in to comment.