Skip to content

Commit

Permalink
Rebase against the upstream 2884984
Browse files Browse the repository at this point in the history
vscode-upstream-sha1: 2884984
  • Loading branch information
Eclipse Che Sync committed Jul 27, 2023
2 parents fded0f2 + 2884984 commit e7366a3
Show file tree
Hide file tree
Showing 17 changed files with 42 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ import { assertNoRpc, poll } from '../utils';
{ value: 'scoped~b2~', type: EnvironmentVariableMutatorType.Append, options: defaultOptions },
{ value: 'scoped~c2~', type: EnvironmentVariableMutatorType.Prepend, options: defaultOptions }
]);
deepStrictEqual(entries.map(v => v[0]), ['A', 'B', 'C']);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion code/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "che-code",
"version": "1.81.0",
"distro": "912d48f29160a34a4bfe3ebc36b01e5e47433efd",
"distro": "fe4596cd81d3633694661c9815a10a1bd30dbc3f",
"author": {
"name": "Microsoft Corporation"
},
Expand Down
4 changes: 2 additions & 2 deletions code/src/vs/workbench/api/common/extHostTerminalService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -992,9 +992,9 @@ class UnifiedEnvironmentVariableCollection {

public getVariableMap(scope: vscode.EnvironmentVariableScope | undefined): Map<string, vscode.EnvironmentVariableMutator> {
const map = new Map<string, vscode.EnvironmentVariableMutator>();
for (const [key, value] of this.map) {
for (const [_, value] of this.map) {
if (this.getScopeKey(value.scope) === this.getScopeKey(scope)) {
map.set(key, convertMutator(value));
map.set(value.variable, convertMutator(value));
}
}
return map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,16 @@ class HoverAccessibleViewContribution extends Disposable {
const codeEditorService = accessor.get(ICodeEditorService);
const editor = codeEditorService.getActiveCodeEditor() || codeEditorService.getFocusedCodeEditor();
const editorHoverContent = editor ? ModesHoverController.get(editor)?.getWidgetContent() ?? undefined : undefined;
if (!editorHoverContent) {
if (!editor || !editorHoverContent) {
return false;
}
this._options.language = editor?.getModel()?.getLanguageId() ?? undefined;
accessibleViewService.show({
verbositySettingKey: AccessibilityVerbositySettingId.Hover,
provideContent() { return editorHoverContent; },
onClose() { },
onClose() {
ModesHoverController.get(editor)?.focus();
},
options: this._options
});
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ class AccessibleView extends Disposable {
this._configurationService.updateValue(settingKey, false);
}
provider.onKeyDown?.(e);
// e.stopPropagation();
}));
disposableStore.add(this._editorWidget.onKeyDown((e) => {
if (e.keyCode === KeyCode.Escape) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,17 @@ export class ChatAccessibilityService extends Disposable implements IChatAccessi
const isPanelChat = typeof response !== 'string';
this._responsePendingAudioCue?.dispose();
this._runOnceScheduler?.cancel();
if (this._lastResponse === response?.toString()) {
const responseContent = typeof response === 'string' ? response : response?.response.value;
if (this._lastResponse === responseContent) {
return;
}
this._lastResponse = response?.toString();
this._audioCueService.playAudioCue(AudioCue.chatResponseReceived, true);
this._hasReceivedRequest = false;
if (!response) {
return;
}
const errorDetails = isPanelChat && response.errorDetails ? ` ${response.errorDetails.message}` : '';
const content = isPanelChat ? response.response.value : response;
status(content + errorDetails);
this._lastResponse = responseContent;
status(responseContent + errorDetails);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

.chat-slash-command-content-widget {
padding: 0.1em 0.3em;
top: 7px !important;
border-radius: 2px;
background-color: var(--vscode-textCodeBlock-background);
color: var(--vscode-textLink-foreground);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export class NotebookCellOutline implements IOutline<OutlineEntry> {
this._onDidChange.dispose();
this._dispoables.dispose();
this._entriesDisposables.dispose();
this._outlineProvider?.dispose();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ export class NotebookTextDiffEditor extends EditorPane implements INotebookTextD
height: this._dimension!.height,
fontInfo: this._fontInfo!,
scrollHeight: this._list?.getScrollHeight() ?? 0,
stickyHeight: 0,
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ import { AccessibilityHelpAction, AccessibleViewAction } from 'vs/workbench/cont
import { NOTEBOOK_IS_ACTIVE_EDITOR, NOTEBOOK_OUTPUT_FOCUSED } from 'vs/workbench/contrib/notebook/common/notebookContextKeys';
import { runAccessibilityHelpAction, showAccessibleOutput } from 'vs/workbench/contrib/notebook/browser/notebookAccessibility';
import { IAccessibleViewService } from 'vs/workbench/contrib/accessibility/browser/accessibleView';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';

/*--------------------------------------------------------------------------------------------- */

Expand Down Expand Up @@ -699,7 +700,9 @@ class NotebookAccessibleViewContribution extends Disposable {
const editorService = accessor.get(IEditorService);

return showAccessibleOutput(accessibleViewService, editorService);
}, NOTEBOOK_OUTPUT_FOCUSED));
},
ContextKeyExpr.and(NOTEBOOK_OUTPUT_FOCUSED, ContextKeyExpr.equals('resourceExtname', '.ipynb'))
));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
private _notebookTopToolbarContainer!: HTMLElement;
private _notebookTopToolbar!: NotebookEditorWorkbenchToolbar;
private _notebookStickyScrollContainer!: HTMLElement;
private _notebookStickyScroll!: NotebookStickyScroll;
private _notebookOverviewRulerContainer!: HTMLElement;
private _notebookOverviewRuler!: NotebookOverviewRuler;
private _body!: HTMLElement;
Expand Down Expand Up @@ -324,7 +325,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD

this._register(this.instantiationService.createInstance(NotebookEditorContextKeys, this));

this._notebookOutline = this.instantiationService.createInstance(NotebookCellOutlineProvider, this, OutlineTarget.QuickPick);
this._notebookOutline = this._register(this.instantiationService.createInstance(NotebookCellOutlineProvider, this, OutlineTarget.QuickPick));

this._register(notebookKernelService.onDidChangeSelectedNotebooks(e => {
if (isEqual(e.notebook, this.viewModel?.uri)) {
Expand Down Expand Up @@ -1046,7 +1047,7 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
}

private _registerNotebookStickyScroll() {
this._register(this.instantiationService.createInstance(NotebookStickyScroll, this._notebookStickyScrollContainer, this, this._notebookOutline, this._list));
this._notebookStickyScroll = this._register(this.instantiationService.createInstance(NotebookStickyScroll, this._notebookStickyScrollContainer, this, this._notebookOutline, this._list));
}

private _updateOutputRenderers() {
Expand Down Expand Up @@ -2601,7 +2602,8 @@ export class NotebookEditorWidget extends Disposable implements INotebookEditorD
width: this._dimension?.width ?? 0,
height: this._dimension?.height ?? 0,
scrollHeight: this._list?.getScrollHeight() ?? 0,
fontInfo: this._fontInfo!
fontInfo: this._fontInfo!,
stickyHeight: this._notebookStickyScroll?.getCurrentStickyHeight() ?? 0
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface NotebookLayoutInfo {
height: number;
scrollHeight: number;
fontInfo: FontInfo;
stickyHeight: number;
}

export interface CellViewModelStateChangeEvent {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ export function registerCellToolbarStickyScroll(notebookEditor: INotebookEditor,
if (cell.isInputCollapsed) {
element.style.top = '';
} else {
const stickyHeight = notebookEditor.getLayoutInfo().stickyHeight;
const scrollTop = notebookEditor.scrollTop;
const elementTop = notebookEditor.getAbsoluteTopOfElement(cell);
const diff = scrollTop - elementTop + extraOffset;
const diff = scrollTop - elementTop + extraOffset + stickyHeight;
const maxTop = cell.layoutInfo.editorHeight + cell.layoutInfo.statusBarHeight - 45; // subtract roughly the height of the execution order label plus padding
const top = maxTop > 20 ? // Don't move the run button if it can only move a very short distance
clamp(min, diff, maxTop) :
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,12 @@ export class CellTitleToolbarPart extends CellOverlayPart {
return this._view;
}

const toolbar = this.instantiationService.createInstance(WorkbenchToolBar, this.toolbarContainer, {
const toolbar = this._register(this.instantiationService.createInstance(WorkbenchToolBar, this.toolbarContainer, {
actionViewItemProvider: action => {
return createActionViewItem(this.instantiationService, action);
},
renderDropdownAsChildElement: true
});
}));

const deleteToolbar = this._register(this.instantiationService.invokeFunction(accessor => createDeleteToolbar(accessor, this.toolbarContainer, 'cell-delete-toolbar')));
if (model.deleteActions.primary.length !== 0 || model.deleteActions.secondary.length !== 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ export class NotebookCellOutlineProvider {

dispose(): void {
// selectionListener.clear();
this._entriesDisposables.dispose();
this._dispoables.dispose();
}

Expand Down Expand Up @@ -329,6 +330,11 @@ export class NotebookCellOutlineProvider {
};
if (this._configurationService.getValue(OutlineConfigKeys.problemsEnabled)) {
markerServiceListener.value = this._markerService.onMarkerChanged(e => {
if (notebookEditorWidget.isDisposed) {
console.error('notebook editor is disposed');
return;
}

if (e.some(uri => notebookEditorWidget.getCellsInRange().some(cell => isEqual(cell.uri, uri)))) {
doUpdateMarker(false);
this._onDidChange.fire({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ export class NotebookStickyScroll extends Disposable {
return this.domNode;
}

getCurrentStickyHeight() {
return this.currentStickyLines.size * 22;
}

constructor(
private readonly domNode: HTMLElement,
private readonly notebookEditor: INotebookEditor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1012,8 +1012,10 @@ export function compressOutputItemStreams(outputs: Uint8Array[]) {
}
}

const didCompression = compressStreamBuffer(buffers);
const data = formatStreamText(VSBuffer.concat(buffers.map(buffer => VSBuffer.wrap(buffer))));
let didCompression = compressStreamBuffer(buffers);
const concatenated = VSBuffer.concat(buffers.map(buffer => VSBuffer.wrap(buffer)));
const data = formatStreamText(concatenated);
didCompression = didCompression || data.byteLength !== concatenated.byteLength;
return { data, didCompression };
}

Expand Down

0 comments on commit e7366a3

Please sign in to comment.