Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463 (#7206)

* Merge from vscode 64980ea1f3f532c82bb6c28d27bba9ef2c5b4463

* fix config changes

* fix strictnull checks
This commit is contained in:
Anthony Dresser
2019-09-15 22:38:26 -07:00
committed by GitHub
parent fa6c52699e
commit ea0f9e6ce9
1226 changed files with 21541 additions and 17633 deletions

View File

@@ -301,7 +301,7 @@ export class ExtensionEditor extends BaseEditor {
return disposables;
}
async setInput(input: ExtensionsInput, options: EditorOptions, token: CancellationToken): Promise<void> {
async setInput(input: ExtensionsInput, options: EditorOptions | undefined, token: CancellationToken): Promise<void> {
if (this.template) {
await this.updateTemplate(input, this.template);
}

View File

@@ -75,7 +75,7 @@ function caseInsensitiveGet<T>(obj: { [key: string]: T }, key: string): T | unde
export class ExtensionTipsService extends Disposable implements IExtensionTipsService {
_serviceBrand: any;
_serviceBrand: undefined;
private _fileBasedRecommendations: { [id: string]: { recommendedTime: number, sources: ExtensionRecommendationSource[] }; } = Object.create(null);
private _recommendations: string[] = []; // {{SQL CARBON EDIT}}
@@ -651,16 +651,18 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
}
});
forEach(this.productService.extensionImportantTips, entry => {
let { key: id, value } = entry;
const { pattern } = value;
let ids = this._availableRecommendations[pattern];
if (!ids) {
this._availableRecommendations[pattern] = [id.toLowerCase()];
} else {
ids.push(id.toLowerCase());
}
});
if (this.productService.extensionImportantTips) {
forEach(this.productService.extensionImportantTips, entry => {
let { key: id, value } = entry;
const { pattern } = value;
let ids = this._availableRecommendations[pattern];
if (!ids) {
this._availableRecommendations[pattern] = [id.toLowerCase()];
} else {
ids.push(id.toLowerCase());
}
});
}
const allRecommendations: string[] = flatten((Object.keys(this._availableRecommendations).map(key => this._availableRecommendations[key])));
@@ -713,7 +715,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
let { key: pattern, value: ids } = entry;
if (match(pattern, model.uri.toString())) {
for (let id of ids) {
if (caseInsensitiveGet(this.productService.extensionImportantTips, id)) {
if (this.productService.extensionImportantTips && caseInsensitiveGet(this.productService.extensionImportantTips, id)) {
recommendationsToSuggest.push(id);
}
const filedBasedRecommendation = this._fileBasedRecommendations[id.toLowerCase()] || { recommendedTime: now, sources: [] };
@@ -767,7 +769,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
}
const id = recommendationsToSuggest[0];
const entry = caseInsensitiveGet(this.productService.extensionImportantTips, id);
const entry = this.productService.extensionImportantTips ? caseInsensitiveGet(this.productService.extensionImportantTips, id) : undefined;
if (!entry) {
return false;
}
@@ -996,7 +998,7 @@ export class ExtensionTipsService extends Disposable implements IExtensionTipsSe
* If user has any of the tools listed in this.productService.exeBasedExtensionTips, fetch corresponding recommendations
*/
private async fetchExecutableRecommendations(important: boolean): Promise<void> {
if (isWeb) {
if (isWeb || !this.productService.exeBasedExtensionTips) {
return;
}

View File

@@ -1629,7 +1629,7 @@ export class ShowRecommendedExtensionsAction extends Action {
return this.viewletService.openViewlet(VIEWLET_ID, true)
.then(viewlet => viewlet as IExtensionsViewlet)
.then(viewlet => {
viewlet.search('@recommended ');
viewlet.search('@recommended ', true);
viewlet.focus();
});
}
@@ -3121,7 +3121,7 @@ export class InstallLocalExtensionsInRemoteAction extends Action {
get label(): string {
if (this.extensionManagementServerService.remoteExtensionManagementServer) {
return localize('select and install local extensions', "Install Local Extensions in {0}...", this.extensionManagementServerService.remoteExtensionManagementServer.label);
return localize('select and install local extensions', "Install Local Extensions in '{0}'...", this.extensionManagementServerService.remoteExtensionManagementServer.label);
}
return '';
}
@@ -3166,7 +3166,7 @@ export class InstallLocalExtensionsInRemoteAction extends Action {
const localExtensionsToInstall = await this.queryExtensionsToInstall();
quickPick.busy = false;
if (localExtensionsToInstall.length) {
quickPick.title = localize('install local extensions title', "Install Local Extensions in {0}", this.extensionManagementServerService.remoteExtensionManagementServer!.label);
quickPick.title = localize('install local extensions title', "Install Local Extensions in '{0}'", this.extensionManagementServerService.remoteExtensionManagementServer!.label);
quickPick.placeholder = localize('select extensions to install', "Select extensions to install");
quickPick.canSelectMany = true;
localExtensionsToInstall.sort((e1, e2) => e1.displayName.localeCompare(e2.displayName));

View File

@@ -198,6 +198,7 @@ export class ExtensionsTree extends WorkbenchAsyncDataTree<IExtensionData, IExte
};
super(
'ExtensionsTree',
container,
delegate,
renderers,

View File

@@ -59,11 +59,6 @@ import { RemoteNameContext } from 'vs/workbench/browser/contextkeys';
import { ILabelService } from 'vs/platform/label/common/label';
import { MementoObject } from 'vs/workbench/common/memento';
interface SearchInputEvent extends Event {
target: HTMLInputElement;
immediate?: boolean;
}
const NonEmptyWorkspaceContext = new RawContextKey<boolean>('nonEmptyWorkspace', false);
const DefaultViewsContext = new RawContextKey<boolean>('defaultExtensionViews', true);
const SearchMarketplaceExtensionsContext = new RawContextKey<boolean>('searchMarketplaceExtensions', false);
@@ -494,12 +489,13 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
return this.secondaryActions;
}
search(value: string): void {
search(value: string, refresh: boolean = false): void {
if (this.searchBox) {
const event = new Event('input', { bubbles: true }) as SearchInputEvent;
event.immediate = true;
this.searchBox.setValue(value);
if (this.searchBox.getValue() !== value) {
this.searchBox.setValue(value);
} else if (refresh) {
this.doSearch();
}
}
}

View File

@@ -125,12 +125,12 @@ export class ExtensionsListView extends ViewletPanel {
const delegate = new Delegate();
const extensionsViewState = new ExtensionsViewState();
const renderer = this.instantiationService.createInstance(Renderer, extensionsViewState);
this.list = this.instantiationService.createInstance(WorkbenchPagedList, extensionsList, delegate, [renderer], {
this.list = this.instantiationService.createInstance(WorkbenchPagedList, 'Extensions', extensionsList, delegate, [renderer], {
ariaLabel: localize('extensions', "Extensions"),
multipleSelectionSupport: false,
setRowLineHeight: false,
horizontalScrolling: false
}) as WorkbenchPagedList<IExtension>;
});
this._register(this.list.onContextMenu(e => this.onContextMenu(e), this));
this._register(this.list.onFocusChange(e => extensionsViewState.onFocusChange(coalesce(e.elements)), this));
this._register(this.list);

View File

@@ -170,8 +170,8 @@ export class TooltipWidget extends ExtensionWidget {
if (!this.extension) {
return '';
}
if (this.tooltipAction.tooltip) {
return this.tooltipAction.tooltip;
if (this.tooltipAction.label) {
return this.tooltipAction.label;
}
return this.recommendationWidget.tooltip;
}

View File

@@ -489,7 +489,7 @@ class Extensions extends Disposable {
export class ExtensionsWorkbenchService extends Disposable implements IExtensionsWorkbenchService, IURLHandler {
private static readonly SyncPeriod = 1000 * 60 * 60 * 12; // 12 hours
_serviceBrand: any;
_serviceBrand: undefined;
private readonly localExtensions: Extensions | null = null;
private readonly remoteExtensions: Extensions | null = null;

View File

@@ -1 +0,0 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M7.065 13H15v2H2.056v-2h5.009zm3.661-12H7.385L8.44 2.061 7.505 3H15V1h-4.274zM3.237 9H2.056v2H15V9H3.237zm4.208-4l.995 1-.995 1H15V5H7.445z" fill="#C5C5C5"/><path d="M5.072 4.03L7.032 6 5.978 7.061l-1.96-1.97-1.961 1.97L1 6l1.96-1.97L1 2.061 2.056 1l1.96 1.97L5.977 1l1.057 1.061L5.072 4.03z" fill="#F48771"/></svg>

Before

Width:  |  Height:  |  Size: 419 B