Skip to content

Commit

Permalink
Comments for different extension views
Browse files Browse the repository at this point in the history
  • Loading branch information
ramya-rao-a committed Nov 16, 2018
1 parent a6b8074 commit f8a46bc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
ViewsRegistry.registerViews(viewDescriptors);
}

// View used for any kind of searching
private createMarketPlaceExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.listView';
return {
Expand All @@ -123,6 +124,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
};
}

// Separate view for enabled extensions required as we need to show enabled, disabled and recommended sections
// in the default view when there is no search text, but user has installed extensions.
private createEnabledExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.enabledExtensionList';
return {
Expand All @@ -137,6 +140,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
};
}

// Separate view for disabled extensions required as we need to show enabled, disabled and recommended sections
// in the default view when there is no search text, but user has installed extensions.
private createDisabledExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.disabledExtensionList';
return {
Expand All @@ -152,6 +157,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
};
}

// Separate view for popular extensions required as we need to show popular and recommended sections
// in the default view when there is no search text, and user has no installed extensions.
private createPopularExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.popularExtensionsList';
return {
Expand All @@ -176,6 +183,9 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
}];
}

// Separate view for recommended extensions required as we need to show it along with other views when there is no search text.
// When user has installed extensions, this is shown along with the views for enabled & disabled extensions
// When user has no installed extensions, this is shown along with the view for popular extensions
private createDefaultRecommendedExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.recommendedList';
return {
Expand All @@ -190,6 +200,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
};
}

// Separate view for recommedations that are not workspace recommendations.
// Shown along with view for workspace recommendations, when using the command that shows recommendations
private createOtherRecommendedExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.otherrecommendedList';
return {
Expand All @@ -204,6 +216,8 @@ export class ExtensionsViewletViewsContribution implements IWorkbenchContributio
};
}

// Separate view for workspace recommendations.
// Shown along with view for other recommendations, when using the command that shows recommendations
private createWorkspaceRecommendedExtensionsListViewDescriptor(): IViewDescriptor {
const id = 'extensions.workspaceRecommendedList';
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ export class ExtensionsListView extends ViewletPanel {
return extensions;
}

// Get All types of recommendations, trimmed to show a max of 8 at any given time
private getAllRecommendationsModel(query: Query, options: IQueryOptions): Promise<IPagedModel<IExtension>> {
const value = query.value.replace(/@recommended:all/g, '').replace(/@recommended/g, '').trim().toLowerCase();

Expand Down Expand Up @@ -472,6 +473,7 @@ export class ExtensionsListView extends ViewletPanel {
return new PagedModel([]);
}

// Get All types of recommendations other than Workspace recommendations, trimmed to show a max of 8 at any given time
private getRecommendationsModel(query: Query, options: IQueryOptions): Promise<IPagedModel<IExtension>> {
const value = query.value.replace(/@recommended/g, '').trim().toLowerCase();

Expand Down

0 comments on commit f8a46bc

Please sign in to comment.