Merge from vscode 709a07d51919d3266ca71699c6ddfb2d3547c0e1 (#6575)

This commit is contained in:
Chris LaFreniere
2019-08-02 21:06:44 -07:00
committed by GitHub
parent 402b50c03b
commit 62d2fb534d
103 changed files with 726 additions and 374 deletions

View File

@@ -587,7 +587,7 @@ export class CustomMenubarControl extends MenubarControl {
this.updateService.checkForUpdates({ windowId }));
case StateType.CheckingForUpdates:
return new Action('update.checking', nls.localize('checkingForUpdates', "Checking For Updates..."), undefined, false);
return new Action('update.checking', nls.localize('checkingForUpdates', "Checking for Updates..."), undefined, false);
case StateType.AvailableForDownload:
return new Action('update.downloadNow', nls.localize({ key: 'download now', comment: ['&& denotes a mnemonic'] }, "D&&ownload Now"), undefined, true, () =>

View File

@@ -76,8 +76,8 @@ export class CustomTreeViewPanel extends ViewletPanel {
this.treeView.show(container);
}
layoutBody(size: number): void {
this.treeView.layout(size);
layoutBody(height: number, width: number): void {
this.treeView.layout(height, width);
}
getActions(): IAction[] {
@@ -329,11 +329,11 @@ export class CustomTreeView extends Disposable implements ITreeView {
this._onDidChangeVisibility.fire(this.isVisible);
}
focus(): void {
focus(reveal: boolean = true): void {
if (this.tree && this.root.children && this.root.children.length > 0) {
// Make sure the current selected element is revealed
const selectedElement = this.tree.getSelection()[0];
if (selectedElement) {
if (selectedElement && reveal) {
this.tree.reveal(selectedElement, 0.5);
}
@@ -384,7 +384,8 @@ export class CustomTreeView extends Disposable implements ITreeView {
expandOnlyOnTwistieClick: (e: ITreeItem) => !!e.command,
collapseByDefault: (e: ITreeItem): boolean => {
return e.collapsibleState !== TreeItemCollapsibleState.Expanded;
}
},
multipleSelectionSupport: false
}));
aligner.tree = this.tree;
@@ -480,14 +481,14 @@ export class CustomTreeView extends Disposable implements ITreeView {
this.markdownResult = this.markdownRenderer.render(this._messageValue);
DOM.append(this.messageElement, this.markdownResult.element);
}
this.layout(this._size);
this.layout(this._height, this._width);
}
}
private hideMessage(): void {
this.resetMessageElement();
DOM.addClass(this.messageElement, 'hide');
this.layout(this._size);
this.layout(this._height, this._width);
}
private resetMessageElement(): void {
@@ -498,14 +499,16 @@ export class CustomTreeView extends Disposable implements ITreeView {
DOM.clearNode(this.messageElement);
}
private _size: number;
layout(size: number) {
if (size) {
this._size = size;
const treeSize = size - DOM.getTotalHeight(this.messageElement);
this.treeContainer.style.height = treeSize + 'px';
private _height: number;
private _width: number;
layout(height: number, width: number) {
if (height && width) {
this._height = height;
this._width = width;
const treeHeight = height - DOM.getTotalHeight(this.messageElement);
this.treeContainer.style.height = treeHeight + 'px';
if (this.tree) {
this.tree.layout(treeSize);
this.tree.layout(treeHeight, width);
}
}
}
@@ -595,10 +598,11 @@ export class CustomTreeView extends Disposable implements ITreeView {
if (this.tree) {
this.refreshing = true;
await Promise.all(elements.map(element => this.tree.updateChildren(element, true)));
elements.map(element => this.tree.rerender(element));
this.refreshing = false;
this.updateContentAreas();
if (this.focused) {
this.focus();
this.focus(false);
}
}
}

View File

@@ -104,6 +104,7 @@
.customview-tree .monaco-list .monaco-list-row {
padding-right: 12px;
padding-left: 0px;
}
.customview-tree .monaco-list .monaco-list-row .custom-view-tree-node-item {

View File

@@ -556,7 +556,8 @@ export class PersistentContributableViewsModel extends ContributableViewsModel {
visibleGlobal: undefined,
visibleWorkspace: isUndefined(workspaceViewState.isHidden) ? undefined : !workspaceViewState.isHidden,
collapsed: workspaceViewState.collapsed,
order: workspaceViewState.order
order: workspaceViewState.order,
size: workspaceViewState.size
});
}

View File

@@ -118,7 +118,8 @@ class CodeRendererMain extends Disposable {
const environmentService = new BrowserWorkbenchEnvironmentService({
workspaceId: payload.id,
remoteAuthority: this.configuration.remoteAuthority,
webviewEndpoint: this.configuration.webviewEndpoint
webviewEndpoint: this.configuration.webviewEndpoint,
connectionToken: this.configuration.connectionToken
});
serviceCollection.set(IWorkbenchEnvironmentService, environmentService);
@@ -131,7 +132,7 @@ class CodeRendererMain extends Disposable {
serviceCollection.set(IRemoteAuthorityResolverService, remoteAuthorityResolverService);
// Signing
const signService = new SignService(this.configuration.connectionToken);
const signService = new SignService(environmentService.configuration.connectionToken);
serviceCollection.set(ISignService, signService);
// Remote Agent

View File

@@ -37,6 +37,7 @@ import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteA
// tslint:disable-next-line: import-patterns
import { IExperimentService, IExperiment, ExperimentActionType, ExperimentState } from 'vs/workbench/contrib/experiments/common/experimentService';
import { ExtensionHostDebugChannelClient, ExtensionHostDebugBroadcastChannel } from 'vs/platform/debug/common/extensionHostDebugIpc';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
//#region Extension Tips
@@ -303,7 +304,8 @@ export class SimpleWindowService extends Disposable implements IWindowService {
@IConfigurationService private readonly configurationService: IConfigurationService,
@IStorageService private readonly storageService: IStorageService,
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
@ILogService private readonly logService: ILogService
@ILogService private readonly logService: ILogService,
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService
) {
super();
@@ -499,7 +501,7 @@ export class SimpleWindowService extends Disposable implements IWindowService {
for (let i = 0; i < _uris.length; i++) {
const uri = _uris[i];
if ('folderUri' in uri) {
const newAddress = `${document.location.origin}/?folder=${uri.folderUri.path}`;
const newAddress = `${document.location.origin}/?folder=${uri.folderUri.path}${this.workbenchEnvironmentService.configuration.connectionToken ? `&tkn=${this.workbenchEnvironmentService.configuration.connectionToken}` : ''}`;
if (openFolderInNewWindow) {
window.open(newAddress);
} else {
@@ -618,6 +620,10 @@ export class SimpleWindowsService implements IWindowsService {
readonly onWindowUnmaximize: Event<number> = Event.None;
readonly onRecentlyOpenedChange: Event<void> = Event.None;
constructor(
@IWorkbenchEnvironmentService private readonly workbenchEnvironmentService: IWorkbenchEnvironmentService
) {
}
isFocused(_windowId: number): Promise<boolean> {
return Promise.resolve(true);
}
@@ -788,6 +794,9 @@ export class SimpleWindowsService implements IWindowsService {
newAddress += `&ibe=${encodeURIComponent(ibe)}`;
}
// add connection token
newAddress += `${this.workbenchEnvironmentService.configuration.connectionToken ? `tkn=${this.workbenchEnvironmentService.configuration.connectionToken}` : ''}`;
window.open(newAddress);
return Promise.resolve();

View File

@@ -237,7 +237,7 @@ import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform'
'workbench.useExperimentalGridLayout': {
'type': 'boolean',
'description': nls.localize('workbench.useExperimentalGridLayout', "Enables the grid layout for the workbench. This setting may enable additional layout options for workbench components."),
'default': true,
'default': false,
'scope': ConfigurationScope.APPLICATION
}
}
@@ -360,4 +360,4 @@ import { isMacintosh, isWindows, isLinux, isWeb } from 'vs/base/common/platform'
}
}
});
})();
})();

View File

@@ -79,11 +79,25 @@ export class Workbench extends Layout {
setUnexpectedErrorHandler(error => this.handleUnexpectedError(error, logService));
// Inform user about loading issues from the loader
interface AnnotatedLoadingError extends Error {
phase: 'loading';
moduleId: string;
neededBy: string[];
}
interface AnnotatedFactoryError extends Error {
phase: 'factory';
moduleId: string;
}
interface AnnotatedValidationError extends Error {
phase: 'configuration';
}
type AnnotatedError = AnnotatedLoadingError | AnnotatedFactoryError | AnnotatedValidationError;
(<any>window).require.config({
onError: (err: { errorCode: string; }) => {
if (err.errorCode === 'load') {
onError: (err: AnnotatedError) => {
if (err.phase === 'loading') {
onUnexpectedError(new Error(localize('loaderErrorNative', "Failed to load a required file. Please restart the application to try again. Details: {0}", JSON.stringify(err))));
}
console.error(err);
}
});
}