mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-03-30 16:50:30 -04:00
Merge from vscode 1fbacccbc900bb59ba8a8f26a4128d48a1c97842
This commit is contained in:
@@ -32,6 +32,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur
|
||||
import { IViewDescriptor, IViewDescriptorService } from 'vs/workbench/common/views';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
export interface ISpliceEvent<T> {
|
||||
index: number;
|
||||
@@ -186,12 +187,16 @@ export class MainPane extends ViewPane {
|
||||
@IViewDescriptorService viewDescriptorService: IViewDescriptorService,
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IMenuService private readonly menuService: IMenuService,
|
||||
@IConfigurationService configurationService: IConfigurationService
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
@IThemeService themeService: IThemeService,
|
||||
) {
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
const delegate = new ProvidersListDelegate();
|
||||
const renderer = this.instantiationService.createInstance(ProviderRenderer);
|
||||
const identityProvider = { getId: (r: ISCMRepository) => r.provider.id };
|
||||
|
||||
@@ -63,8 +63,11 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { format } from 'vs/base/common/strings';
|
||||
import { inputPlaceholderForeground, inputValidationInfoBorder, inputValidationWarningBorder, inputValidationErrorBorder, inputValidationInfoBackground, inputValidationInfoForeground, inputValidationWarningBackground, inputValidationWarningForeground, inputValidationErrorBackground, inputValidationErrorForeground, inputBackground, inputForeground, inputBorder, focusBorder } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { SuggestController } from 'vs/editor/contrib/suggest/suggestController';
|
||||
import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
type TreeElement = ISCMResourceGroup | IResourceNode<ISCMResource, ISCMResourceGroup> | ISCMResource;
|
||||
|
||||
@@ -612,6 +615,8 @@ export class RepositoryPane extends ViewPane {
|
||||
protected contextKeyService: IContextKeyService;
|
||||
private commitTemplate = '';
|
||||
|
||||
isEmpty() { return true; }
|
||||
|
||||
constructor(
|
||||
readonly repository: ISCMRepository,
|
||||
options: IViewPaneOptions,
|
||||
@@ -629,8 +634,9 @@ export class RepositoryPane extends ViewPane {
|
||||
@IMenuService protected menuService: IMenuService,
|
||||
@IStorageService private storageService: IStorageService,
|
||||
@IModelService private modelService: IModelService,
|
||||
@IOpenerService openerService: IOpenerService,
|
||||
) {
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService);
|
||||
super(options, keybindingService, contextMenuService, configurationService, contextKeyService, viewDescriptorService, instantiationService, openerService, themeService);
|
||||
|
||||
this.menus = instantiationService.createInstance(SCMMenus, this.repository.provider);
|
||||
this._register(this.menus);
|
||||
@@ -663,6 +669,8 @@ export class RepositoryPane extends ViewPane {
|
||||
}
|
||||
|
||||
protected renderBody(container: HTMLElement): void {
|
||||
super.renderBody(container);
|
||||
|
||||
const focusTracker = trackFocus(container);
|
||||
this._register(focusTracker.onDidFocus(() => this.repository.focus()));
|
||||
this._register(focusTracker);
|
||||
@@ -721,16 +729,15 @@ export class RepositoryPane extends ViewPane {
|
||||
fontFamily: ' -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "Ubuntu", "Droid Sans", sans-serif',
|
||||
wrappingStrategy: 'advanced',
|
||||
wrappingIndent: 'none',
|
||||
// suggest: {
|
||||
// showWords: false
|
||||
// }
|
||||
padding: { top: 3, bottom: 3 },
|
||||
suggest: { showWords: false }
|
||||
};
|
||||
|
||||
const codeEditorWidgetOptions: ICodeEditorWidgetOptions = {
|
||||
isSimpleWidget: true,
|
||||
contributions: EditorExtensionsRegistry.getSomeEditorContributions([
|
||||
// SuggestController.ID,
|
||||
// SnippetController2.ID,
|
||||
SuggestController.ID,
|
||||
SnippetController2.ID,
|
||||
MenuPreventer.ID,
|
||||
SelectionClipboardContributionID,
|
||||
ContextMenuController.ID,
|
||||
@@ -761,10 +768,6 @@ export class RepositoryPane extends ViewPane {
|
||||
this.inputModel = this.modelService.getModel(uri) || this.modelService.createModel('', null, uri);
|
||||
this.inputEditor.setModel(this.inputModel);
|
||||
|
||||
this.inputEditor.changeViewZones(accessor => {
|
||||
accessor.addZone({ afterLineNumber: 0, domNode: $('div'), heightInPx: 3 });
|
||||
});
|
||||
|
||||
this._register(this.inputEditor.onDidChangeCursorPosition(triggerValidation));
|
||||
|
||||
// Keep model in sync with API
|
||||
@@ -844,7 +847,7 @@ export class RepositoryPane extends ViewPane {
|
||||
|
||||
this._register(Event.chain(this.tree.onDidOpen)
|
||||
.map(e => e.elements[0])
|
||||
.filter(e => !!e && !isSCMResourceGroup(e) && !ResourceTree.isResourceNode(e))
|
||||
.filter<ISCMResource>((e): e is ISCMResource => !!e && !isSCMResourceGroup(e) && !ResourceTree.isResourceNode(e))
|
||||
.on(this.open, this));
|
||||
|
||||
this._register(Event.chain(this.tree.onDidPin)
|
||||
@@ -916,7 +919,7 @@ export class RepositoryPane extends ViewPane {
|
||||
removeClass(this.inputContainer, 'hidden');
|
||||
|
||||
const editorContentHeight = this.inputEditor.getContentHeight();
|
||||
const editorHeight = Math.min(editorContentHeight + 3, 134);
|
||||
const editorHeight = Math.min(editorContentHeight, 134);
|
||||
this.inputEditor.layout({ height: editorHeight, width: width! - 12 - 16 - 2 });
|
||||
|
||||
this.validationContainer.style.top = `${editorHeight + 1}px`;
|
||||
@@ -997,7 +1000,7 @@ export class RepositoryPane extends ViewPane {
|
||||
}
|
||||
}
|
||||
|
||||
private onListContextMenu(e: ITreeContextMenuEvent<TreeElement>): void {
|
||||
private onListContextMenu(e: ITreeContextMenuEvent<TreeElement | null>): void {
|
||||
if (!e.element) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { RepositoryPane, RepositoryViewDescriptor } from 'vs/workbench/contrib/scm/browser/repositoryPane';
|
||||
import { MainPaneDescriptor, MainPane, IViewModel } from 'vs/workbench/contrib/scm/browser/mainPane';
|
||||
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
|
||||
import type { IAddedViewDescriptorRef } from 'vs/workbench/browser/parts/views/views';
|
||||
import type { IAddedViewDescriptorRef, IViewDescriptorRef } from 'vs/workbench/browser/parts/views/views';
|
||||
import { debounce } from 'vs/base/common/decorators';
|
||||
|
||||
export interface ISpliceEvent<T> {
|
||||
@@ -169,7 +169,7 @@ export class SCMViewPaneContainer extends ViewPaneContainer implements IViewMode
|
||||
}
|
||||
}
|
||||
|
||||
private onDidHideView(e: IAddedViewDescriptorRef[]): void {
|
||||
private onDidHideView(e: IViewDescriptorRef[]): void {
|
||||
for (const ref of e) {
|
||||
if (ref.viewDescriptor instanceof RepositoryViewDescriptor) {
|
||||
ref.viewDescriptor.repository.setSelected(false);
|
||||
|
||||
Reference in New Issue
Block a user