Merge branch 'main' into merogge/kb

This commit is contained in:
Benjamin Pasero 2024-01-24 20:09:09 +01:00 committed by GitHub
commit cc5dd53402
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 58 additions and 33 deletions

View file

@ -490,7 +490,7 @@ export class PaneCompositeBar extends Disposable {
name: cachedViewContainer.name,
order: cachedViewContainer.order,
pinned: cachedViewContainer.pinned,
visible: cachedViewContainer.visible,
visible: cachedViewContainer.visible && !!this.getViewContainer(cachedViewContainer.id),
});
}

View file

@ -796,7 +796,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
@IInstantiationService instantiationService: IInstantiationService,
@ICodeEditorService private readonly codeEditorService: ICodeEditorService,
@IEditorService private readonly editorService: IEditorService,
@IHostService private readonly hostService: IHostService
@IHostService private readonly hostService: IHostService,
@IChatService private readonly chatService: IChatService
) {
super();
@ -811,6 +812,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
this.handleKeywordActivation();
}));
this._register(this.chatService.onDidRegisterProvider(() => this.updateConfiguration()));
this._register(this.speechService.onDidStartSpeechToTextSession(() => this.handleKeywordActivation()));
this._register(this.speechService.onDidEndSpeechToTextSession(() => this.handleKeywordActivation()));
@ -826,8 +829,8 @@ export class KeywordActivationContribution extends Disposable implements IWorkbe
}
private updateConfiguration(): void {
if (!this.speechService.hasSpeechProvider) {
return; // these settings require a speech provider
if (!this.speechService.hasSpeechProvider || this.chatService.getProviderInfos().length === 0) {
return; // these settings require a speech and chat provider
}
const registry = Registry.as<IConfigurationRegistry>(Extensions.Configuration);

View file

@ -457,7 +457,7 @@ export class BreakpointEditorContribution implements IBreakpointEditorContributi
));
actions.push(new Action(
'addTriggeredBreakpoint',
nls.localize('addTriggeredBreakpoint', "Add Triggered Breakpoint.."),
nls.localize('addTriggeredBreakpoint', "Add Triggered Breakpoint..."),
undefined,
true,
() => Promise.resolve(this.showBreakpointWidget(lineNumber, column, BreakpointWidgetContext.TRIGGER_POINT))

View file

@ -84,6 +84,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
private inputContainer!: HTMLElement;
private selectBreakpointContainer!: HTMLElement;
private input!: IActiveCodeEditor;
private selectBreakpointBox!: SelectBox;
private toDispose: lifecycle.IDisposable[];
private conditionInput = '';
private hitCountInput = '';
@ -205,7 +206,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
{ text: nls.localize('expression', "Expression") },
{ text: nls.localize('hitCount', "Hit Count") },
{ text: nls.localize('logMessage', "Log Message") },
{ text: nls.localize('triggeredBy', "Wait For Breakpoint") },
{ text: nls.localize('triggeredBy', "Wait for Breakpoint") },
], this.context, this.contextViewService, defaultSelectBoxStyles, { ariaLabel: nls.localize('breakpointType', 'Breakpoint Type') });
this.selectContainer = $('.breakpoint-select-container');
selectBox.render(dom.append(container, this.selectContainer));
@ -228,7 +229,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
this.updateContextInput();
// Due to an electron bug we have to do the timeout, otherwise we do not get focus
setTimeout(() => this.input.focus(), 150);
setTimeout(() => this.focusInput(), 150);
}
private createTriggerBreakpointInput(container: HTMLElement) {
@ -256,7 +257,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
], select);
});
const selectBreakpointBox = new SelectBox([{ text: nls.localize('triggerByLoading', 'Loading...'), isDisabled: true }], 0, this.contextViewService, defaultSelectBoxStyles, { ariaLabel: nls.localize('selectBreakpoint', 'Select breakpoint') });
const selectBreakpointBox = this.selectBreakpointBox = new SelectBox([{ text: nls.localize('triggerByLoading', 'Loading...'), isDisabled: true }], 0, this.contextViewService, defaultSelectBoxStyles, { ariaLabel: nls.localize('selectBreakpoint', 'Select breakpoint') });
selectBreakpointBox.onDidSelect(e => {
if (e.index === 0) {
this.triggeredByBreakpointInput = undefined;
@ -295,7 +296,7 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
this.setInputMode();
const value = this.getInputValue(this.breakpoint);
this.input.getModel().setValue(value);
this.input.focus();
this.focusInput();
}
}
@ -455,6 +456,14 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
this.dispose();
}
private focusInput() {
if (this.context === Context.TRIGGER_POINT) {
this.selectBreakpointBox.focus();
} else {
this.input.focus();
}
}
override dispose(): void {
super.dispose();
this.input.dispose();

View file

@ -31,6 +31,9 @@
margin-top: -1px;
}
.codicon-debug-breakpoint-conditional.codicon-debug-stackframe-focused::after,
.codicon-debug-breakpoint-conditional.codicon-debug-stackframe::after,
.codicon-debug-breakpoint.codicon-debug-stackframe-focused::after,
.codicon-debug-breakpoint.codicon-debug-stackframe::after {
content: '\eb8a';

View file

@ -21,10 +21,11 @@ import { IDiffEditorOptions } from 'vs/editor/common/config/editorOptions';
import { IResolvedTextEditorModel, ITextModelService } from 'vs/editor/common/services/resolverService';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfiguration';
import { localize } from 'vs/nls';
import { ConfirmResult } from 'vs/platform/dialogs/common/dialogs';
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IEditorConfiguration } from 'vs/workbench/browser/parts/editor/textEditor';
import { DEFAULT_EDITOR_ASSOCIATION, EditorInputCapabilities, EditorInputWithOptions, IEditorSerializer, IResourceMultiDiffEditorInput, ISaveOptions, IUntypedEditorInput } from 'vs/workbench/common/editor';
import { EditorInput } from 'vs/workbench/common/editor/editorInput';
import { EditorInput, IEditorCloseHandler } from 'vs/workbench/common/editor/editorInput';
import { MultiDiffEditorIcon } from 'vs/workbench/contrib/multiDiffEditor/browser/icons.contribution';
import { ConstResolvedMultiDiffSource, IMultiDiffSourceResolverService, IResolvedMultiDiffSource, MultiDiffEditorItem } from 'vs/workbench/contrib/multiDiffEditor/browser/multiDiffSourceResolverService';
import { ObservableLazyStatefulPromise } from 'vs/workbench/contrib/multiDiffEditor/browser/utils';
@ -255,6 +256,15 @@ export class MultiDiffEditorInput extends EditorInput implements ILanguageSuppor
}
return undefined;
}
override readonly closeHandler: IEditorCloseHandler = {
async confirm() {
return ConfirmResult.DONT_SAVE;
},
showConfirm() {
return false;
}
};
}
function isUriDirty(textFileService: ITextFileService, uri: URI) {

View file

@ -13286,6 +13286,29 @@ declare module 'vscode' {
*/
export function findFiles(include: GlobPattern, exclude?: GlobPattern | null, maxResults?: number, token?: CancellationToken): Thenable<Uri[]>;
/**
* Saves the editor identified by the given resource and returns the resulting resource or `undefined`
* if save was not successful or no editor with the given resource was found.
*
* **Note** that an editor with the provided resource must be opened in order to be saved.
*
* @param uri the associated uri for the opened editor to save.
* @returns A thenable that resolves when the save operation has finished.
*/
export function save(uri: Uri): Thenable<Uri | undefined>;
/**
* Saves the editor identified by the given resource to a new file name as provided by the user and
* returns the resulting resource or `undefined` if save was not successful or cancelled or no editor
* with the given resource was found.
*
* **Note** that an editor with the provided resource must be opened in order to be saved as.
*
* @param uri the associated uri for the opened editor to save as.
* @returns A thenable that resolves when the save-as operation has finished.
*/
export function saveAs(uri: Uri): Thenable<Uri | undefined>;
/**
* Save all dirty files.
*
@ -13649,29 +13672,6 @@ declare module 'vscode' {
* Event that fires when the current workspace has been trusted.
*/
export const onDidGrantWorkspaceTrust: Event<void>;
/**
* Saves the editor identified by the given resource and returns the resulting resource or `undefined`
* if save was not successful or no editor with the given resource was found.
*
* **Note** that an editor with the provided resource must be opened in order to be saved.
*
* @param uri the associated uri for the opened editor to save.
* @returns A thenable that resolves when the save operation has finished.
*/
export function save(uri: Uri): Thenable<Uri | undefined>;
/**
* Saves the editor identified by the given resource to a new file name as provided by the user and
* returns the resulting resource or `undefined` if save was not successful or cancelled or no editor
* with the given resource was found.
*
* **Note** that an editor with the provided resource must be opened in order to be saved as.
*
* @param uri the associated uri for the opened editor to save as.
* @returns A thenable that resolves when the save-as operation has finished.
*/
export function saveAs(uri: Uri): Thenable<Uri | undefined>;
}
/**