mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
Merge branch 'main' into tyriar/204965
This commit is contained in:
commit
5d92626966
|
@ -11,12 +11,12 @@
|
|||
"--vscode-activityBar-inactiveForeground",
|
||||
"--vscode-activityBarBadge-background",
|
||||
"--vscode-activityBarBadge-foreground",
|
||||
"--vscode-activityBarTop-activeBackground",
|
||||
"--vscode-activityBarTop-activeBorder",
|
||||
"--vscode-activityBarTop-background",
|
||||
"--vscode-activityBarTop-dropBorder",
|
||||
"--vscode-activityBarTop-foreground",
|
||||
"--vscode-activityBarTop-inactiveForeground",
|
||||
"--vscode-activityBarTop-background",
|
||||
"--vscode-activityBarTop-activeBackground",
|
||||
"--vscode-badge-background",
|
||||
"--vscode-badge-foreground",
|
||||
"--vscode-banner-background",
|
||||
|
@ -261,6 +261,10 @@
|
|||
"--vscode-editorMarkerNavigationInfo-headerBackground",
|
||||
"--vscode-editorMarkerNavigationWarning-background",
|
||||
"--vscode-editorMarkerNavigationWarning-headerBackground",
|
||||
"--vscode-editorMultiCursor-primary-background",
|
||||
"--vscode-editorMultiCursor-primary-foreground",
|
||||
"--vscode-editorMultiCursor-secondary-background",
|
||||
"--vscode-editorMultiCursor-secondary-foreground",
|
||||
"--vscode-editorOverviewRuler-addedForeground",
|
||||
"--vscode-editorOverviewRuler-background",
|
||||
"--vscode-editorOverviewRuler-border",
|
||||
|
@ -557,11 +561,11 @@
|
|||
"--vscode-sideBar-border",
|
||||
"--vscode-sideBar-dropBackground",
|
||||
"--vscode-sideBar-foreground",
|
||||
"--vscode-sideBarActivityBarTop-border",
|
||||
"--vscode-sideBarSectionHeader-background",
|
||||
"--vscode-sideBarSectionHeader-border",
|
||||
"--vscode-sideBarSectionHeader-foreground",
|
||||
"--vscode-sideBarTitle-foreground",
|
||||
"--vscode-sideBarActivityBarTop-border",
|
||||
"--vscode-sideBySideEditor-horizontalBorder",
|
||||
"--vscode-sideBySideEditor-verticalBorder",
|
||||
"--vscode-simpleFindWidget-sashBorder",
|
||||
|
@ -702,11 +706,17 @@
|
|||
"--vscode-testing-coveredBorder",
|
||||
"--vscode-testing-coveredGutterBackground",
|
||||
"--vscode-testing-iconErrored",
|
||||
"--vscode-testing-iconErrored-retired",
|
||||
"--vscode-testing-iconFailed",
|
||||
"--vscode-testing-iconFailed-retired",
|
||||
"--vscode-testing-iconPassed",
|
||||
"--vscode-testing-iconPassed-retired",
|
||||
"--vscode-testing-iconQueued",
|
||||
"--vscode-testing-iconQueued-retired",
|
||||
"--vscode-testing-iconSkipped",
|
||||
"--vscode-testing-iconSkipped-retired",
|
||||
"--vscode-testing-iconUnset",
|
||||
"--vscode-testing-iconUnset-retired",
|
||||
"--vscode-testing-message-error-decorationForeground",
|
||||
"--vscode-testing-message-error-lineBackground",
|
||||
"--vscode-testing-message-info-decorationForeground",
|
||||
|
@ -720,7 +730,6 @@
|
|||
"--vscode-testing-uncoveredBorder",
|
||||
"--vscode-testing-uncoveredBranchBackground",
|
||||
"--vscode-testing-uncoveredGutterBackground",
|
||||
"--vscode-testing-uncoveredGutterBackground",
|
||||
"--vscode-textBlockQuote-background",
|
||||
"--vscode-textBlockQuote-border",
|
||||
"--vscode-textCodeBlock-background",
|
||||
|
|
|
@ -118,7 +118,7 @@ async function startPreloadWorkspaceContentsIfNeeded(context: vscode.ExtensionCo
|
|||
return;
|
||||
}
|
||||
|
||||
const workspaceUri = vscode.workspace.workspaceFolders?.[0].uri;
|
||||
const workspaceUri = vscode.workspace.workspaceFolders?.at(0)?.uri;
|
||||
if (!workspaceUri || workspaceUri.scheme !== 'vscode-vfs' || !workspaceUri.authority.startsWith('github')) {
|
||||
logger.info(`Skipped loading workspace contents for repository ${workspaceUri?.toString()}`);
|
||||
return;
|
||||
|
|
|
@ -164,6 +164,9 @@ export class PostEditWidgetManager<T extends DocumentPasteEdit | DocumentOnDropE
|
|||
}
|
||||
|
||||
const resolvedEdit = await resolve(edit, token);
|
||||
if (token.isCancellationRequested) {
|
||||
return;
|
||||
}
|
||||
|
||||
const combinedWorkspaceEdit = createCombinedWorkspaceEdit(model.uri, ranges, resolvedEdit);
|
||||
|
||||
|
@ -174,6 +177,7 @@ export class PostEditWidgetManager<T extends DocumentPasteEdit | DocumentOnDropE
|
|||
options: { description: 'paste-line-suffix', stickiness: TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges }
|
||||
}]);
|
||||
|
||||
this._editor.focus();
|
||||
let editResult: IBulkEditResult;
|
||||
let editRange: Range | null;
|
||||
try {
|
||||
|
@ -183,6 +187,10 @@ export class PostEditWidgetManager<T extends DocumentPasteEdit | DocumentOnDropE
|
|||
model.deltaDecorations(editTrackingDecoration, []);
|
||||
}
|
||||
|
||||
if (token.isCancellationRequested) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (canShowWidget && editResult.isApplied && edits.allEdits.length > 1) {
|
||||
this.show(editRange ?? primaryRange, edits, async (newEditIndex) => {
|
||||
const model = this._editor.getModel();
|
||||
|
|
|
@ -331,7 +331,7 @@ registerEditorCommand(new CommandCtor({
|
|||
handler: ctrl => ctrl.next(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 30,
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyCode.Tab
|
||||
}
|
||||
}));
|
||||
|
@ -341,7 +341,7 @@ registerEditorCommand(new CommandCtor({
|
|||
handler: ctrl => ctrl.prev(),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 30,
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.Shift | KeyCode.Tab
|
||||
}
|
||||
}));
|
||||
|
@ -351,7 +351,7 @@ registerEditorCommand(new CommandCtor({
|
|||
handler: ctrl => ctrl.cancel(true),
|
||||
kbOpts: {
|
||||
weight: KeybindingWeight.EditorContrib + 30,
|
||||
kbExpr: EditorContextKeys.editorTextFocus,
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyCode.Escape,
|
||||
secondary: [KeyMod.Shift | KeyCode.Escape]
|
||||
}
|
||||
|
|
|
@ -333,6 +333,7 @@ function removePropertiesWithPossibleUserInfo(property: string): string {
|
|||
{ label: 'Slack Token', regex: /xox[pbar]\-[A-Za-z0-9]/ },
|
||||
{ label: 'GitHub Token', regex: /(gh[psuro]_[a-zA-Z0-9]{36}|github_pat_[a-zA-Z0-9]{22}_[a-zA-Z0-9]{59})/ },
|
||||
{ label: 'Generic Secret', regex: /(key|token|sig|secret|signature|password|passwd|pwd|android:value)[^a-zA-Z0-9]/i },
|
||||
{ label: 'CLI Credentials', regex: /((login|psexec|(certutil|psexec)\.exe).{1,50}(\s-u(ser(name)?)?\s+.{3,100})?\s-(admin|user|vm|root)?p(ass(word)?)?\s+["']?[^$\-\/\s]|(^|[\s\r\n\\])net(\.exe)?.{1,5}(user\s+|share\s+\/user:| user -? secrets ? set) \s + [^ $\s \/])/ },
|
||||
{ label: 'Email', regex: /@[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+/ } // Regex which matches @*.site
|
||||
];
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity'
|
|||
import { IWorkspaceEditDto, IWorkspaceFileEditDto, MainContext, MainThreadBulkEditsShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { ResourceNotebookCellEdit } from 'vs/workbench/contrib/bulkEdit/browser/bulkCellEdits';
|
||||
import { IExtHostContext, extHostNamedCustomer } from 'vs/workbench/services/extensions/common/extHostCustomers';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadBulkEdits)
|
||||
|
@ -26,8 +27,8 @@ export class MainThreadBulkEdits implements MainThreadBulkEditsShape {
|
|||
|
||||
dispose(): void { }
|
||||
|
||||
$tryApplyWorkspaceEdit(dto: IWorkspaceEditDto, undoRedoGroupId?: number, isRefactoring?: boolean): Promise<boolean> {
|
||||
const edits = reviveWorkspaceEditDto(dto, this._uriIdentService);
|
||||
$tryApplyWorkspaceEdit(dto: SerializableObjectWithBuffers<IWorkspaceEditDto>, undoRedoGroupId?: number, isRefactoring?: boolean): Promise<boolean> {
|
||||
const edits = reviveWorkspaceEditDto(dto.value, this._uriIdentService);
|
||||
return this._bulkEditService.apply(edits, { undoRedoGroupId, respectAutoSaveConfig: isRefactoring }).then((res) => res.isApplied, err => {
|
||||
this._logService.warn(`IGNORING workspace edit: ${err}`);
|
||||
return false;
|
||||
|
|
|
@ -262,7 +262,7 @@ export interface ITextDocumentShowOptions {
|
|||
}
|
||||
|
||||
export interface MainThreadBulkEditsShape extends IDisposable {
|
||||
$tryApplyWorkspaceEdit(workspaceEditDto: IWorkspaceEditDto, undoRedoGroupId?: number, respectAutoSaveConfig?: boolean): Promise<boolean>;
|
||||
$tryApplyWorkspaceEdit(workspaceEditDto: SerializableObjectWithBuffers<IWorkspaceEditDto>, undoRedoGroupId?: number, respectAutoSaveConfig?: boolean): Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface MainThreadTextEditorsShape extends IDisposable {
|
||||
|
|
|
@ -8,6 +8,7 @@ import { MainContext, MainThreadBulkEditsShape } from 'vs/workbench/api/common/e
|
|||
import { ExtHostDocumentsAndEditors } from 'vs/workbench/api/common/extHostDocumentsAndEditors';
|
||||
import { IExtHostRpcService } from 'vs/workbench/api/common/extHostRpcService';
|
||||
import { WorkspaceEdit } from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
import type * as vscode from 'vscode';
|
||||
|
||||
export class ExtHostBulkEdits {
|
||||
|
@ -28,7 +29,7 @@ export class ExtHostBulkEdits {
|
|||
}
|
||||
|
||||
applyWorkspaceEdit(edit: vscode.WorkspaceEdit, extension: IExtensionDescription, metadata: vscode.WorkspaceEditMetadata | undefined): Promise<boolean> {
|
||||
const dto = WorkspaceEdit.from(edit, this._versionInformationProvider);
|
||||
const dto = new SerializableObjectWithBuffers(WorkspaceEdit.from(edit, this._versionInformationProvider));
|
||||
return this._proxy.$tryApplyWorkspaceEdit(dto, undefined, metadata?.isRefactoring ?? false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ import type * as vscode from 'vscode';
|
|||
import { LinkedList } from 'vs/base/common/linkedList';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IExtensionDescription } from 'vs/platform/extensions/common/extensions';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
|
||||
type Listener = [Function, any, IExtensionDescription];
|
||||
|
||||
|
@ -165,7 +166,7 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
|
|||
}
|
||||
|
||||
if (version === document.version) {
|
||||
return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(dto);
|
||||
return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new SerializableObjectWithBuffers(dto));
|
||||
}
|
||||
|
||||
return Promise.reject(new Error('concurrent_edits'));
|
||||
|
|
|
@ -13,6 +13,7 @@ import { ExtHostNotebookController } from 'vs/workbench/api/common/extHostNotebo
|
|||
import { TextDocumentSaveReason, WorkspaceEdit as WorksapceEditConverter } from 'vs/workbench/api/common/extHostTypeConverters';
|
||||
import { WorkspaceEdit } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { SaveReason } from 'vs/workbench/common/editor';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
import { NotebookDocumentWillSaveEvent } from 'vscode';
|
||||
|
||||
interface IExtensionListener<E> {
|
||||
|
@ -90,6 +91,6 @@ export class ExtHostNotebookDocumentSaveParticipant implements ExtHostNotebookDo
|
|||
dto.edits = dto.edits.concat(edits);
|
||||
}
|
||||
|
||||
return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(dto);
|
||||
return this._mainThreadBulkEdits.$tryApplyWorkspaceEdit(new SerializableObjectWithBuffers(dto));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import { NullLogService } from 'vs/platform/log/common/log';
|
|||
import { ExtHostBulkEdits } from 'vs/workbench/api/common/extHostBulkEdits';
|
||||
import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
|
||||
suite('ExtHostBulkEdits.applyWorkspaceEdit', () => {
|
||||
|
||||
|
@ -25,8 +26,8 @@ suite('ExtHostBulkEdits.applyWorkspaceEdit', () => {
|
|||
|
||||
const rpcProtocol = new TestRPCProtocol();
|
||||
rpcProtocol.set(MainContext.MainThreadBulkEdits, new class extends mock<MainThreadBulkEditsShape>() {
|
||||
override $tryApplyWorkspaceEdit(_workspaceResourceEdits: IWorkspaceEditDto): Promise<boolean> {
|
||||
workspaceResourceEdits = _workspaceResourceEdits;
|
||||
override $tryApplyWorkspaceEdit(_workspaceResourceEdits: SerializableObjectWithBuffers<IWorkspaceEditDto>): Promise<boolean> {
|
||||
workspaceResourceEdits = _workspaceResourceEdits.value;
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -16,6 +16,7 @@ import { mock } from 'vs/base/test/common/mock';
|
|||
import { NullLogService } from 'vs/platform/log/common/log';
|
||||
import { nullExtensionDescription } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { ensureNoDisposablesAreLeakedInTestSuite } from 'vs/base/test/common/utils';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
|
||||
function timeout(n: number) {
|
||||
return new Promise(resolve => setTimeout(resolve, n));
|
||||
|
@ -257,8 +258,8 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
|||
|
||||
let dto: IWorkspaceEditDto;
|
||||
const participant = new ExtHostDocumentSaveParticipant(nullLogService, documents, new class extends mock<MainThreadTextEditorsShape>() {
|
||||
$tryApplyWorkspaceEdit(_edits: IWorkspaceEditDto) {
|
||||
dto = _edits;
|
||||
$tryApplyWorkspaceEdit(_edits: SerializableObjectWithBuffers<IWorkspaceEditDto>) {
|
||||
dto = _edits.value;
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
});
|
||||
|
@ -281,8 +282,8 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
|||
|
||||
let edits: IWorkspaceEditDto;
|
||||
const participant = new ExtHostDocumentSaveParticipant(nullLogService, documents, new class extends mock<MainThreadTextEditorsShape>() {
|
||||
$tryApplyWorkspaceEdit(_edits: IWorkspaceEditDto) {
|
||||
edits = _edits;
|
||||
$tryApplyWorkspaceEdit(_edits: SerializableObjectWithBuffers<IWorkspaceEditDto>) {
|
||||
edits = _edits.value;
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
});
|
||||
|
@ -318,9 +319,9 @@ suite('ExtHostDocumentSaveParticipant', () => {
|
|||
test('event delivery, two listeners -> two document states', () => {
|
||||
|
||||
const participant = new ExtHostDocumentSaveParticipant(nullLogService, documents, new class extends mock<MainThreadTextEditorsShape>() {
|
||||
$tryApplyWorkspaceEdit(dto: IWorkspaceEditDto) {
|
||||
$tryApplyWorkspaceEdit(dto: SerializableObjectWithBuffers<IWorkspaceEditDto>) {
|
||||
|
||||
for (const edit of dto.edits) {
|
||||
for (const edit of dto.value.edits) {
|
||||
|
||||
const uri = URI.revive((<IWorkspaceTextEditDto>edit).resource);
|
||||
const { text, range } = (<IWorkspaceTextEditDto>edit).textEdit;
|
||||
|
|
|
@ -48,6 +48,7 @@ import { BulkEditService } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditS
|
|||
import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
import { LabelService } from 'vs/workbench/services/label/common/labelService';
|
||||
import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
|
||||
|
@ -204,7 +205,7 @@ suite('MainThreadEditors', () => {
|
|||
// Act as if the user edited the model
|
||||
model.applyEdits([EditOperation.insert(new Position(0, 0), 'something')]);
|
||||
|
||||
return bulkEdits.$tryApplyWorkspaceEdit({ edits: [workspaceResourceEdit] }).then((result) => {
|
||||
return bulkEdits.$tryApplyWorkspaceEdit(new SerializableObjectWithBuffers({ edits: [workspaceResourceEdit] })).then((result) => {
|
||||
assert.strictEqual(result, false);
|
||||
});
|
||||
});
|
||||
|
@ -230,11 +231,11 @@ suite('MainThreadEditors', () => {
|
|||
}
|
||||
};
|
||||
|
||||
const p1 = bulkEdits.$tryApplyWorkspaceEdit({ edits: [workspaceResourceEdit1] }).then((result) => {
|
||||
const p1 = bulkEdits.$tryApplyWorkspaceEdit(new SerializableObjectWithBuffers({ edits: [workspaceResourceEdit1] })).then((result) => {
|
||||
// first edit request succeeds
|
||||
assert.strictEqual(result, true);
|
||||
});
|
||||
const p2 = bulkEdits.$tryApplyWorkspaceEdit({ edits: [workspaceResourceEdit2] }).then((result) => {
|
||||
const p2 = bulkEdits.$tryApplyWorkspaceEdit(new SerializableObjectWithBuffers({ edits: [workspaceResourceEdit2] })).then((result) => {
|
||||
// second edit request fails
|
||||
assert.strictEqual(result, false);
|
||||
});
|
||||
|
@ -242,13 +243,13 @@ suite('MainThreadEditors', () => {
|
|||
});
|
||||
|
||||
test(`applyWorkspaceEdit with only resource edit`, () => {
|
||||
return bulkEdits.$tryApplyWorkspaceEdit({
|
||||
return bulkEdits.$tryApplyWorkspaceEdit(new SerializableObjectWithBuffers({
|
||||
edits: [
|
||||
{ oldResource: resource, newResource: resource, options: undefined },
|
||||
{ oldResource: undefined, newResource: resource, options: undefined },
|
||||
{ oldResource: resource, newResource: undefined, options: undefined }
|
||||
]
|
||||
}).then((result) => {
|
||||
})).then((result) => {
|
||||
assert.strictEqual(result, true);
|
||||
assert.strictEqual(movedResources.get(resource), resource);
|
||||
assert.strictEqual(createdResources.has(resource), true);
|
||||
|
|
|
@ -106,6 +106,38 @@
|
|||
padding-left: 10px;
|
||||
}
|
||||
|
||||
/* Tab Background Color in/active group/tab */
|
||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab {
|
||||
background-color: var(--vscode-tab-unfocusedInactiveBackground);
|
||||
}
|
||||
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab {
|
||||
background-color: var(--vscode-tab-inactiveBackground);
|
||||
}
|
||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active {
|
||||
background-color: var(--vscode-tab-unfocusedActiveBackground);
|
||||
}
|
||||
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active {
|
||||
background-color: var(--vscode-tab-activeBackground);
|
||||
}
|
||||
|
||||
/* Tab Foreground Color in/active group/tab */
|
||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab {
|
||||
color: var(--vscode-tab-unfocusedInactiveForeground);
|
||||
}
|
||||
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab {
|
||||
color: var(--vscode-tab-inactiveForeground);
|
||||
}
|
||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab.active {
|
||||
color: var(--vscode-tab-unfocusedActiveForeground);
|
||||
}
|
||||
.monaco-workbench .part.editor > .content .editor-group-container.active > .title .tabs-container > .tab.active {
|
||||
color: var(--vscode-tab-activeForeground);
|
||||
}
|
||||
|
||||
.monaco-workbench .part.editor > .content .editor-group-container > .title .tabs-container > .tab:not(.active) {
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.monaco-workbench .part.editor > .content .editor-group-container > .title > .tabs-and-actions-container.wrapping .tabs-container > .tab:last-child {
|
||||
margin-right: var(--last-tab-margin-right); /* when tabs wrap, we need a margin away from the absolute positioned editor actions */
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElemen
|
|||
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { getOrSet } from 'vs/base/common/map';
|
||||
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, WORKBENCH_BACKGROUND, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_ACTIVE_MODIFIED_BORDER, TAB_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_HOVER_FOREGROUND, TAB_UNFOCUSED_HOVER_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BORDER, TAB_LAST_PINNED_BORDER } from 'vs/workbench/common/theme';
|
||||
import { TAB_INACTIVE_BACKGROUND, TAB_ACTIVE_BACKGROUND, TAB_BORDER, EDITOR_DRAG_AND_DROP_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER, TAB_HOVER_BACKGROUND, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BORDER, EDITOR_GROUP_HEADER_TABS_BACKGROUND, WORKBENCH_BACKGROUND, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_ACTIVE_MODIFIED_BORDER, TAB_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_ACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_MODIFIED_BORDER, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_HOVER_FOREGROUND, TAB_UNFOCUSED_HOVER_FOREGROUND, EDITOR_GROUP_HEADER_TABS_BORDER, TAB_LAST_PINNED_BORDER } from 'vs/workbench/common/theme';
|
||||
import { activeContrastBorder, contrastBorder, editorBackground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { ResourcesDropHandler, DraggedEditorIdentifier, DraggedEditorGroupIdentifier, extractTreeDropData, isWindowDraggedOver } from 'vs/workbench/browser/dnd';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
|
@ -1504,55 +1504,23 @@ export class MultiEditorTabsControl extends EditorTabsControl {
|
|||
|
||||
private doRedrawTabActive(isGroupActive: boolean, allowBorderTop: boolean, editor: EditorInput, tabContainer: HTMLElement, tabActionBar: ActionBar): void {
|
||||
|
||||
// Tab is active
|
||||
if (this.tabsModel.isActive(editor)) {
|
||||
const isActive = this.tabsModel.isActive(editor);
|
||||
|
||||
// Container
|
||||
tabContainer.classList.add('active');
|
||||
tabContainer.setAttribute('aria-selected', 'true');
|
||||
tabContainer.tabIndex = 0; // Only active tab can be focused into
|
||||
tabContainer.style.backgroundColor = this.getColor(isGroupActive ? TAB_ACTIVE_BACKGROUND : TAB_UNFOCUSED_ACTIVE_BACKGROUND) || '';
|
||||
tabContainer.classList.toggle('active', isActive);
|
||||
tabContainer.setAttribute('aria-selected', isActive ? 'true' : 'false');
|
||||
tabContainer.tabIndex = isActive ? 0 : -1; // Only active tab can be focused into
|
||||
tabActionBar.setFocusable(isActive);
|
||||
|
||||
if (isActive) {
|
||||
// Set border BOTTOM if theme defined color
|
||||
const activeTabBorderColorBottom = this.getColor(isGroupActive ? TAB_ACTIVE_BORDER : TAB_UNFOCUSED_ACTIVE_BORDER);
|
||||
if (activeTabBorderColorBottom) {
|
||||
tabContainer.classList.add('tab-border-bottom');
|
||||
tabContainer.style.setProperty('--tab-border-bottom-color', activeTabBorderColorBottom.toString());
|
||||
} else {
|
||||
tabContainer.classList.remove('tab-border-bottom');
|
||||
tabContainer.style.removeProperty('--tab-border-bottom-color');
|
||||
}
|
||||
tabContainer.classList.toggle('tab-border-bottom', !!activeTabBorderColorBottom);
|
||||
tabContainer.style.setProperty('--tab-border-bottom-color', activeTabBorderColorBottom?.toString() ?? '');
|
||||
|
||||
// Set border TOP if theme defined color
|
||||
const activeTabBorderColorTop = allowBorderTop ? this.getColor(isGroupActive ? TAB_ACTIVE_BORDER_TOP : TAB_UNFOCUSED_ACTIVE_BORDER_TOP) : undefined;
|
||||
if (activeTabBorderColorTop) {
|
||||
tabContainer.classList.add('tab-border-top');
|
||||
tabContainer.style.setProperty('--tab-border-top-color', activeTabBorderColorTop.toString());
|
||||
} else {
|
||||
tabContainer.classList.remove('tab-border-top');
|
||||
tabContainer.style.removeProperty('--tab-border-top-color');
|
||||
}
|
||||
|
||||
// Label
|
||||
tabContainer.style.color = this.getColor(isGroupActive ? TAB_ACTIVE_FOREGROUND : TAB_UNFOCUSED_ACTIVE_FOREGROUND) || '';
|
||||
|
||||
// Actions
|
||||
tabActionBar.setFocusable(true);
|
||||
}
|
||||
|
||||
// Tab is inactive
|
||||
else {
|
||||
|
||||
// Container
|
||||
tabContainer.classList.remove('active');
|
||||
tabContainer.setAttribute('aria-selected', 'false');
|
||||
tabContainer.tabIndex = -1; // Only active tab can be focused into
|
||||
tabContainer.style.backgroundColor = this.getColor(isGroupActive ? TAB_INACTIVE_BACKGROUND : TAB_UNFOCUSED_INACTIVE_BACKGROUND) || '';
|
||||
tabContainer.style.boxShadow = '';
|
||||
|
||||
// Label
|
||||
tabContainer.style.color = this.getColor(isGroupActive ? TAB_INACTIVE_FOREGROUND : TAB_UNFOCUSED_INACTIVE_FOREGROUND) || '';
|
||||
|
||||
// Actions
|
||||
tabActionBar.setFocusable(false);
|
||||
tabContainer.classList.toggle('tab-border-top', !!activeTabBorderColorTop);
|
||||
tabContainer.style.setProperty('--tab-border-top-color', activeTabBorderColorTop?.toString() ?? '');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -209,7 +209,11 @@ export class InteractiveEditorInput extends EditorInput implements ICompositeNot
|
|||
return undefined; // save cancelled
|
||||
}
|
||||
|
||||
return await this._editorModelReference.saveAs(target);
|
||||
const saved = await this._editorModelReference.saveAs(target);
|
||||
if (saved && 'resource' in saved && saved.resource) {
|
||||
this._notebookService.getNotebookTextModel(saved.resource)?.dispose();
|
||||
}
|
||||
return saved;
|
||||
}
|
||||
|
||||
override matches(otherInput: EditorInput | IUntypedEditorInput): boolean {
|
||||
|
|
|
@ -82,6 +82,7 @@ import { Button, ButtonWithDescription, ButtonWithDropdown } from 'vs/base/brows
|
|||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { RepositoryContextKeys } from 'vs/workbench/contrib/scm/browser/scmViewService';
|
||||
import { DragAndDropController } from 'vs/editor/contrib/dnd/browser/dnd';
|
||||
import { CopyPasteController } from 'vs/editor/contrib/dropOrPasteInto/browser/copyPasteController';
|
||||
import { DropIntoEditorController } from 'vs/editor/contrib/dropOrPasteInto/browser/dropIntoEditorController';
|
||||
import { MessageController } from 'vs/editor/contrib/message/browser/messageController';
|
||||
import { defaultButtonStyles, defaultCountBadgeStyles } from 'vs/platform/theme/browser/defaultStyles';
|
||||
|
@ -2494,6 +2495,7 @@ class SCMInputWidget {
|
|||
ColorDetector.ID,
|
||||
ContextMenuController.ID,
|
||||
DragAndDropController.ID,
|
||||
CopyPasteController.ID,
|
||||
DropIntoEditorController.ID,
|
||||
LinkDetector.ID,
|
||||
MenuPreventer.ID,
|
||||
|
@ -2505,7 +2507,7 @@ class SCMInputWidget {
|
|||
InlineCompletionsController.ID,
|
||||
CodeActionController.ID,
|
||||
FormatOnType.ID,
|
||||
EditorDictation.ID
|
||||
EditorDictation.ID,
|
||||
])
|
||||
};
|
||||
|
||||
|
@ -2532,6 +2534,11 @@ class SCMInputWidget {
|
|||
}, 0);
|
||||
}));
|
||||
|
||||
this.disposables.add(this.inputEditor.onDidBlurEditorWidget(() => {
|
||||
CopyPasteController.get(this.inputEditor)?.clearWidgets();
|
||||
DropIntoEditorController.get(this.inputEditor)?.clearWidgets();
|
||||
}));
|
||||
|
||||
const firstLineKey = this.contextKeyService.createKey<boolean>('scmInputIsInFirstPosition', false);
|
||||
const lastLineKey = this.contextKeyService.createKey<boolean>('scmInputIsInLastPosition', false);
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ export function gitCreatePr(): ITerminalQuickFixInternalOptions {
|
|||
},
|
||||
commandExitResult: 'success',
|
||||
getQuickFixes: (matchResult: ITerminalCommandMatchResult) => {
|
||||
const link = matchResult?.outputMatch?.regexMatch?.groups?.link;
|
||||
const link = matchResult?.outputMatch?.regexMatch?.groups?.link?.trimEnd();
|
||||
if (!link) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -556,6 +556,7 @@ export class UserDataProfileImportExportService extends Disposable implements IU
|
|||
try {
|
||||
await this.doExportProfile(userDataProfilesExportState);
|
||||
} catch (error) {
|
||||
exportAction.enabled = true;
|
||||
this.notificationService.error(error);
|
||||
throw error;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue