Merge remote-tracking branch 'origin/main' into tyriar/terminal_layout
This commit is contained in:
commit
854f7f23ff
|
@ -300,7 +300,7 @@ export class Model implements IRemoteSourceProviderRegistry, IPushErrorHandlerRe
|
|||
const repository = new Repository(this.git.open(repositoryRoot, dotGit), this, this, this.globalState, this.outputChannel);
|
||||
|
||||
this.open(repository);
|
||||
await repository.status();
|
||||
repository.status(); // do not await this, we want SCM to know about the repo asap
|
||||
} catch (ex) {
|
||||
// noop
|
||||
this.outputChannel.appendLine(`Opening repository for path='${repoPath}' failed; ex=${ex}`);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "code-oss-dev",
|
||||
"version": "1.63.0",
|
||||
"distro": "f4a21145f5ec390f681f48c7140bf4f60d2987ac",
|
||||
"distro": "58644f0352f74eff29f9d920573b8e6fffb1cfac",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
},
|
||||
|
|
|
@ -163,7 +163,6 @@ export class Sash extends Disposable {
|
|||
|
||||
private el: HTMLElement;
|
||||
private layoutProvider: ISashLayoutProvider;
|
||||
private hidden: boolean;
|
||||
private orientation!: Orientation;
|
||||
private size: number;
|
||||
private hoverDelay = globalHoverDelay;
|
||||
|
@ -317,7 +316,6 @@ export class Sash extends Disposable {
|
|||
|
||||
this._register(onDidChangeHoverDelay.event(delay => this.hoverDelay = delay));
|
||||
|
||||
this.hidden = false;
|
||||
this.layoutProvider = layoutProvider;
|
||||
|
||||
this.orthogonalStartSash = options.orthogonalStartSash;
|
||||
|
@ -504,22 +502,6 @@ export class Sash extends Disposable {
|
|||
}
|
||||
}
|
||||
|
||||
show(): void {
|
||||
this.hidden = false;
|
||||
this.el.style.removeProperty('display');
|
||||
this.el.setAttribute('aria-hidden', 'false');
|
||||
}
|
||||
|
||||
hide(): void {
|
||||
this.hidden = true;
|
||||
this.el.style.display = 'none';
|
||||
this.el.setAttribute('aria-hidden', 'true');
|
||||
}
|
||||
|
||||
isHidden(): boolean {
|
||||
return this.hidden;
|
||||
}
|
||||
|
||||
private getOrthogonalSash(e: PointerEvent): Sash | undefined {
|
||||
if (!e.target || !(e.target instanceof HTMLElement)) {
|
||||
return undefined;
|
||||
|
|
|
@ -9,7 +9,7 @@ import { IListOptions, IListOptionsUpdate, IListStyles, List } from 'vs/base/bro
|
|||
import { ISplitViewDescriptor, IView, Orientation, SplitView } from 'vs/base/browser/ui/splitview/splitview';
|
||||
import { ITableColumn, ITableContextMenuEvent, ITableEvent, ITableGestureEvent, ITableMouseEvent, ITableRenderer, ITableTouchEvent, ITableVirtualDelegate } from 'vs/base/browser/ui/table/table';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ScrollbarVisibility, ScrollEvent } from 'vs/base/common/scrollable';
|
||||
import { ISpliceable } from 'vs/base/common/sequence';
|
||||
import { IThemable } from 'vs/base/common/styler';
|
||||
|
@ -148,9 +148,11 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
|||
readonly domNode: HTMLElement;
|
||||
private splitview: SplitView;
|
||||
private list: List<TRow>;
|
||||
private columnLayoutDisposable: IDisposable;
|
||||
private cachedHeight: number = 0;
|
||||
private styleElement: HTMLStyleElement;
|
||||
protected readonly disposables = new DisposableStore();
|
||||
|
||||
private cachedWidth: number = 0;
|
||||
private cachedHeight: number = 0;
|
||||
|
||||
get onDidChangeFocus(): Event<ITableEvent<TRow>> { return this.list.onDidChangeFocus; }
|
||||
get onDidChangeSelection(): Event<ITableEvent<TRow>> { return this.list.onDidChangeSelection; }
|
||||
|
@ -196,21 +198,27 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
|||
views: headers.map(view => ({ size: view.column.weight, view }))
|
||||
};
|
||||
|
||||
this.splitview = new SplitView(this.domNode, {
|
||||
this.splitview = this.disposables.add(new SplitView(this.domNode, {
|
||||
orientation: Orientation.HORIZONTAL,
|
||||
scrollbarVisibility: ScrollbarVisibility.Hidden,
|
||||
getSashOrthogonalSize: () => this.cachedHeight,
|
||||
descriptor
|
||||
});
|
||||
}));
|
||||
|
||||
this.splitview.el.style.height = `${virtualDelegate.headerRowHeight}px`;
|
||||
this.splitview.el.style.lineHeight = `${virtualDelegate.headerRowHeight}px`;
|
||||
|
||||
const renderer = new TableListRenderer(columns, renderers, i => this.splitview.getViewSize(i));
|
||||
this.list = new List(user, this.domNode, asListVirtualDelegate(virtualDelegate), [renderer], _options);
|
||||
this.list = this.disposables.add(new List(user, this.domNode, asListVirtualDelegate(virtualDelegate), [renderer], _options));
|
||||
|
||||
this.columnLayoutDisposable = Event.any(...headers.map(h => h.onDidLayout))
|
||||
(([index, size]) => renderer.layoutColumn(index, size));
|
||||
Event.any(...headers.map(h => h.onDidLayout))
|
||||
(([index, size]) => renderer.layoutColumn(index, size), null, this.disposables);
|
||||
|
||||
this.splitview.onDidSashReset(index => {
|
||||
const totalWeight = columns.reduce((r, c) => r + c.weight, 0);
|
||||
const size = columns[index].weight / totalWeight * this.cachedWidth;
|
||||
this.splitview.resizeView(index, size);
|
||||
}, null, this.disposables);
|
||||
|
||||
this.styleElement = createStyleSheet(this.domNode);
|
||||
this.style({});
|
||||
|
@ -248,6 +256,7 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
|||
height = height ?? getContentHeight(this.domNode);
|
||||
width = width ?? getContentWidth(this.domNode);
|
||||
|
||||
this.cachedWidth = width;
|
||||
this.cachedHeight = height;
|
||||
this.splitview.layout(width);
|
||||
|
||||
|
@ -337,8 +346,6 @@ export class Table<TRow> implements ISpliceable<TRow>, IThemable, IDisposable {
|
|||
}
|
||||
|
||||
dispose(): void {
|
||||
this.splitview.dispose();
|
||||
this.list.dispose();
|
||||
this.columnLayoutDisposable.dispose();
|
||||
this.disposables.dispose();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -491,7 +491,6 @@ export abstract class ZoneWidget implements IHorizontalSashLayoutProvider {
|
|||
this._resizeSash = this._disposables.add(new Sash(this.domNode, this, { orientation: Orientation.HORIZONTAL }));
|
||||
|
||||
if (!this.options.isResizeable) {
|
||||
this._resizeSash.hide();
|
||||
this._resizeSash.state = SashState.Disabled;
|
||||
}
|
||||
|
||||
|
|
|
@ -484,7 +484,6 @@ export class WorkbenchTable<TRow> extends Table<TRow> {
|
|||
private horizontalScrolling: boolean | undefined;
|
||||
private _styler: IDisposable | undefined;
|
||||
private _useAltAsMultipleSelectionModifier: boolean;
|
||||
private readonly disposables: DisposableStore;
|
||||
private navigator: TableResourceNavigator<TRow>;
|
||||
get onDidOpen(): Event<IOpenEvent<TRow | undefined>> { return this.navigator.onDidOpen; }
|
||||
|
||||
|
@ -513,7 +512,6 @@ export class WorkbenchTable<TRow> extends Table<TRow> {
|
|||
}
|
||||
);
|
||||
|
||||
this.disposables = new DisposableStore();
|
||||
this.disposables.add(workbenchListOptionsDisposable);
|
||||
|
||||
this.contextKeyService = createScopedContextKeyService(contextKeyService, this);
|
||||
|
|
|
@ -15,7 +15,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
|
|||
import { IFileService, whenProviderRegistered } from 'vs/platform/files/common/files';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { IOutputChannelRegistry, Extensions as OutputExt } from 'vs/workbench/services/output/common/output';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { Disposable, toDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ILogService, LogLevel } from 'vs/platform/log/common/log';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { isWeb } from 'vs/base/common/platform';
|
||||
|
@ -24,8 +24,9 @@ import { LogsDataCleaner } from 'vs/workbench/contrib/logs/common/logsDataCleane
|
|||
import { IOutputService } from 'vs/workbench/contrib/output/common/output';
|
||||
import { supportsTelemetry } from 'vs/platform/telemetry/common/telemetryUtils';
|
||||
import { IProductService } from 'vs/platform/product/common/productService';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { getErrorMessage } from 'vs/base/common/errors';
|
||||
import { createCancelablePromise, timeout } from 'vs/base/common/async';
|
||||
import { canceled, getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
|
||||
const workbenchActionsRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchActionExtensions.WorkbenchActions);
|
||||
workbenchActionsRegistry.registerWorkbenchAction(SyncActionDescriptor.from(SetLogLevelAction), 'Developer: Set Log Level...', CATEGORIES.Developer.value);
|
||||
|
@ -99,24 +100,31 @@ class LogOutputChannels extends Disposable implements IWorkbenchContribution {
|
|||
await whenProviderRegistered(file, this.fileService);
|
||||
const outputChannelRegistry = Registry.as<IOutputChannelRegistry>(OutputExt.OutputChannels);
|
||||
try {
|
||||
await this.whenFileExists(file, 1);
|
||||
const promise = createCancelablePromise(token => this.whenFileExists(file, 1, token));
|
||||
this._register(toDisposable(() => promise.cancel()));
|
||||
await promise;
|
||||
outputChannelRegistry.registerChannel({ id, label, file, log: true });
|
||||
} catch (error) {
|
||||
this.logService.error('Error while registering log channel', file.toString(), getErrorMessage(error));
|
||||
if (!isPromiseCanceledError(error)) {
|
||||
this.logService.error('Error while registering log channel', file.toString(), getErrorMessage(error));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private async whenFileExists(file: URI, trial: number): Promise<void> {
|
||||
private async whenFileExists(file: URI, trial: number, token: CancellationToken): Promise<void> {
|
||||
const exists = await this.fileService.exists(file);
|
||||
if (exists) {
|
||||
return;
|
||||
}
|
||||
if (token.isCancellationRequested) {
|
||||
throw canceled();
|
||||
}
|
||||
if (trial > 10) {
|
||||
throw new Error(`Timed out while waiting for file to be created`);
|
||||
}
|
||||
this.logService.debug(`[Registering Log Channel] File does not exist. Waiting for 1s to retry.`, file.toString());
|
||||
await timeout(1000);
|
||||
await this.whenFileExists(file, trial + 1);
|
||||
await timeout(1000, token);
|
||||
await this.whenFileExists(file, trial + 1, token);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
|||
import { SCMMenus } from 'vs/workbench/contrib/scm/browser/menus';
|
||||
import { IStorageService, StorageScope, StorageTarget } from 'vs/platform/storage/common/storage';
|
||||
import { debounce } from 'vs/base/common/decorators';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
|
||||
function getProviderStorageKey(provider: ISCMProvider): string {
|
||||
return `${provider.contextValue}:${provider.label}${provider.rootUri ? `:${provider.rootUri.toString()}` : ''}`;
|
||||
|
@ -100,8 +99,7 @@ export class SCMViewService implements ISCMViewService {
|
|||
constructor(
|
||||
@ISCMService private readonly scmService: ISCMService,
|
||||
@IInstantiationService instantiationService: IInstantiationService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@ILogService private readonly logService: ILogService
|
||||
@IStorageService private readonly storageService: IStorageService
|
||||
) {
|
||||
this.menus = instantiationService.createInstance(SCMMenus);
|
||||
|
||||
|
@ -123,8 +121,6 @@ export class SCMViewService implements ISCMViewService {
|
|||
}
|
||||
|
||||
private onDidAddRepository(repository: ISCMRepository): void {
|
||||
this.logService.trace('SCMViewService#onDidAddRepository', getProviderStorageKey(repository.provider));
|
||||
|
||||
if (!this.didFinishLoading) {
|
||||
this.eventuallyFinishLoading();
|
||||
}
|
||||
|
@ -135,8 +131,6 @@ export class SCMViewService implements ISCMViewService {
|
|||
const index = this.previousState.all.indexOf(getProviderStorageKey(repository.provider));
|
||||
|
||||
if (index === -1) { // saw a repo we did not expect
|
||||
this.logService.trace('SCMViewService#onDidAddRepository', 'This is a new repository, so we stop the heuristics');
|
||||
|
||||
const added: ISCMRepository[] = [];
|
||||
for (const repo of this.scmService.repositories) { // all should be visible
|
||||
if (!this._visibleRepositoriesSet.has(repo)) {
|
||||
|
@ -179,8 +173,6 @@ export class SCMViewService implements ISCMViewService {
|
|||
}
|
||||
|
||||
private onDidRemoveRepository(repository: ISCMRepository): void {
|
||||
this.logService.trace('SCMViewService#onDidRemoveRepository', getProviderStorageKey(repository.provider));
|
||||
|
||||
if (!this.didFinishLoading) {
|
||||
this.eventuallyFinishLoading();
|
||||
}
|
||||
|
@ -257,7 +249,6 @@ export class SCMViewService implements ISCMViewService {
|
|||
|
||||
@debounce(2000)
|
||||
private eventuallyFinishLoading(): void {
|
||||
this.logService.trace('SCMViewService#eventuallyFinishLoading');
|
||||
this.finishLoading();
|
||||
}
|
||||
|
||||
|
@ -266,7 +257,6 @@ export class SCMViewService implements ISCMViewService {
|
|||
return;
|
||||
}
|
||||
|
||||
this.logService.trace('SCMViewService#finishLoading');
|
||||
this.didFinishLoading = true;
|
||||
this.previousState = undefined;
|
||||
}
|
||||
|
|
|
@ -166,8 +166,8 @@ export class NativeDialogHandler implements IDialogHandler {
|
|||
const osProps = await this.nativeHostService.getOSProperties();
|
||||
|
||||
const detailString = (useAgo: boolean): string => {
|
||||
return localize({ key: 'aboutDetail', comment: ['Electron, Chrome, Node.js and V8 are product names that need no translation'] },
|
||||
"Version: {0}\nCommit: {1}\nDate: {2}\nElectron: {3}\nChrome: {4}\nNode.js: {5}\nV8: {6}\nOS: {7}",
|
||||
return localize({ key: 'aboutDetail', comment: ['Electron, Chromium, Node.js and V8 are product names that need no translation'] },
|
||||
"Version: {0}\nCommit: {1}\nDate: {2}\nElectron: {3}\nChromium: {4}\nNode.js: {5}\nV8: {6}\nOS: {7}",
|
||||
version,
|
||||
this.productService.commit || 'Unknown',
|
||||
this.productService.date ? `${this.productService.date}${useAgo ? ' (' + fromNow(new Date(this.productService.date), true) + ')' : ''}` : 'Unknown',
|
||||
|
|
Loading…
Reference in a new issue