Merge from vscode 011858832762aaff245b2336fb1c38166e7a10fb (#4663)

This commit is contained in:
Anthony Dresser
2019-03-22 13:07:54 -07:00
committed by GitHub
parent f5c9174c2f
commit 4a87a24235
296 changed files with 2531 additions and 2472 deletions

View File

@@ -30,7 +30,7 @@ export class Query {
return [];
}
if (subcommands[command]) {
return subcommands[command].map(subcommand => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`);
return subcommands[command].map((subcommand: string) => `@${command}:${subcommand}${subcommand === '' ? '' : ' '}`);
}
else {
return [`@${command} `];

View File

@@ -51,7 +51,7 @@ import { KeybindingParser } from 'vs/base/common/keybindingParser';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions';
import { getDefaultValue } from 'vs/platform/configuration/common/configurationRegistry';
import { isUndefined } from 'vs/base/common/types';
import { isUndefined, withUndefinedAsNull } from 'vs/base/common/types';
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
// {{SQL CARBON EDIT}}
@@ -258,7 +258,7 @@ export class ExtensionEditor extends BaseEditor {
if (action instanceof ExtensionEditorDropDownAction) {
return action.createActionItem();
}
return null;
return undefined;
}
});
@@ -729,7 +729,7 @@ export class ExtensionEditor extends BaseEditor {
constructor(extension: IExtension, parent?: IExtensionData) {
this.extension = extension;
this.parent = parent || null;
this.parent = withUndefinedAsNull(parent);
}
get hasChildren(): boolean {

View File

@@ -161,12 +161,14 @@ export class ExtensionsListView extends ViewletPanel {
case 'name': options = assign(options, { sortBy: SortBy.Title }); break;
}
const successCallback = model => {
const successCallback = (model: IPagedModel<IExtension>) => {
this.queryRequest = null;
this.setModel(model);
return model;
};
const errorCallback = e => {
const errorCallback = (e: Error) => {
const model = new PagedModel([]);
if (!isPromiseCanceledError(e)) {
this.queryRequest = null;
@@ -534,7 +536,7 @@ export class ExtensionsListView extends ViewletPanel {
return Promise.all([othersPromise, workspacePromise])
.then(([others, workspaceRecommendations]) => {
fileBasedRecommendations = fileBasedRecommendations.filter(x => workspaceRecommendations.every(({ extensionId }) => x.extensionId !== extensionId));
others = others.filter(x => x => workspaceRecommendations.every(({ extensionId }) => x.extensionId !== extensionId));
others = others.filter(x => workspaceRecommendations.every(({ extensionId }) => x.extensionId !== extensionId));
const names = this.getTrimmedRecommendations(local, value, fileBasedRecommendations, others, []);
const recommendationsWithReason = this.tipsService.getAllRecommendationsWithReason();

View File

@@ -12,7 +12,7 @@ import { localize } from 'vs/nls';
import { IExtensionManagementServerService, IExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionManagement';
import { ILabelService } from 'vs/platform/label/common/label';
import { extensionButtonProminentBackground, extensionButtonProminentForeground } from 'vs/workbench/contrib/extensions/electron-browser/extensionsActions';
import { IThemeService } from 'vs/platform/theme/common/themeService';
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
import { STATUS_BAR_HOST_NAME_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_FOREGROUND } from 'vs/workbench/common/theme';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { REMOTE_HOST_SCHEME } from 'vs/platform/remote/common/remoteHosts';
@@ -178,7 +178,7 @@ export class RecommendationWidget extends ExtensionWidget {
this.element = append(this.parent, $('div.bookmark'));
const recommendation = append(this.element, $('.recommendation'));
append(recommendation, $('span.octicon.octicon-star'));
const applyBookmarkStyle = (theme) => {
const applyBookmarkStyle = (theme: ITheme) => {
const bgColor = theme.getColor(extensionButtonProminentBackground);
const fgColor = theme.getColor(extensionButtonProminentForeground);
recommendation.style.borderTopColor = bgColor ? bgColor.toString() : 'transparent';

View File

@@ -69,9 +69,9 @@ suite('ExtensionsWorkbenchServiceTest', () => {
instantiationService.stub(ISharedProcessService, TestSharedProcessService);
instantiationService.stub(IWorkspaceContextService, new TestContextService());
instantiationService.stub(IConfigurationService, {
instantiationService.stub(IConfigurationService, <Partial<IConfigurationService>>{
onDidChangeConfiguration: () => { return undefined!; },
getValue: (key?) => {
getValue: (key?: string) => {
return (key === AutoCheckUpdatesConfigurationKey || key === AutoUpdateConfigurationKey) ? true : undefined;
}
});