Skip to content

Commit

Permalink
Merge branch 'main' into ElijahPepe/workbench-adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
ElijahPepe authored Mar 7, 2022
2 parents 3adad66 + a7c574d commit c926479
Show file tree
Hide file tree
Showing 28 changed files with 764 additions and 714 deletions.
10 changes: 9 additions & 1 deletion extensions/theme-defaults/themes/hc_light.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

"button.background": "#0F4A85",
"button.foreground": "#ffffff",
"button.border": "#0000",
"button.border": "#0F4A85",
"button.hoverBackground": "#0F4A85",
"button.secondaryBackground": "#0000",
"button.secondaryForeground": "#292929",
Expand Down Expand Up @@ -203,6 +203,7 @@
"editorBracketMatch.border": "#0F4A85",
"editor.foldBackground": "#0000",
"editorWhitespace.foreground": "#CCCCCC",
"editorUnnecessaryCode.border": "#0F4A85",

"editorWidget.foreground": "#292929",
"editorWidget.background": "#ffffff",
Expand All @@ -213,7 +214,10 @@
"peekViewResult.background": "#ffffff",
"peekViewResult.selectionBackground": "#ffffff",
"peekViewResult.selectionForeground": "#292929",
"peekViewTitleLabel.foreground": "#292929",
"peekViewTitleDescription.foreground": "#292929",
"peekViewResult.fileForeground": "#292929",
"peekViewResult.lineForeground": "#292929",

"panelTitle.inactiveForeground": "#292929",
"panel.border": "#0F4A85",
Expand Down Expand Up @@ -267,6 +271,7 @@
"breadcrumb.foreground": "#292929",

"terminal.foreground": "#292929",
"terminal.selectionBackground": "#f2f2f2",
"terminal.ansiBlack": "#292929",
"terminal.ansiBlue": "#0451a5",
"terminal.ansiBrightBlack": "#666666",
Expand All @@ -284,6 +289,9 @@
"terminal.ansiWhite": "#555555",
"terminal.ansiYellow": "#949800",

"testing.iconFailed":"#B5200D",
"testing.iconPassed": "#007100",

"gitDecoration.addedResourceForeground": "#374e06",
"gitDecoration.conflictingResourceForeground": "#ad0707",
"gitDecoration.deletedResourceForeground": "#ad0707",
Expand Down
5 changes: 4 additions & 1 deletion src/vs/workbench/api/browser/mainThreadCLICommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
*--------------------------------------------------------------------------------------------*/

import { Schemas } from 'vs/base/common/network';
import { isWeb } from 'vs/base/common/platform';
import { isString } from 'vs/base/common/types';
import { URI, UriComponents } from 'vs/base/common/uri';
import { localize } from 'vs/nls';
Expand Down Expand Up @@ -111,7 +112,9 @@ class RemoteExtensionCLIManagementService extends ExtensionManagementCLIService
}

protected override validateExtensionKind(manifest: IExtensionManifest, output: CLIOutput): boolean {
if (!this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest)) {
if (!this._extensionManifestPropertiesService.canExecuteOnWorkspace(manifest)
// Web extensions installed on remote can be run in web worker extension host
&& !(isWeb && this._extensionManifestPropertiesService.canExecuteOnWeb(manifest))) {
output.log(localize('cannot be installed', "Cannot install the '{0}' extension because it is declared to not run in this setup.", getExtensionId(manifest.publisher, manifest.name)));
return false;
}
Expand Down
25 changes: 19 additions & 6 deletions src/vs/workbench/browser/parts/editor/textResourceEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export class TextResourceEditor extends AbstractTextResourceEditor {
}

if (e.range.startLineNumber !== 1 || e.range.startColumn !== 1) {
return; // only when pasting into first line, first column (= empty document)
return; // document had existing content before the pasted text, don't override.
}

if (codeEditor.getOption(EditorOption.readOnly)) {
Expand All @@ -180,29 +180,42 @@ export class TextResourceEditor extends AbstractTextResourceEditor {
return; // require a live model
}

const pasteIsWholeContents = textModel.getLineCount() === e.range.endLineNumber && textModel.getLineMaxColumn(e.range.endLineNumber) === e.range.endColumn;
if (!pasteIsWholeContents) {
return; // document had existing content after the pasted text, don't override.
}

const currentLanguageId = textModel.getLanguageId();
if (currentLanguageId !== PLAINTEXT_LANGUAGE_ID) {
return; // require current languageId to be unspecific
}

let candidateLanguageId: string | undefined = undefined;
let candidateLanguage: { id: string; source: 'event' | 'guess' } | undefined = undefined;

// A languageId is provided via the paste event so text was copied using
// VSCode. As such we trust this languageId and use it if specific
if (e.languageId) {
candidateLanguageId = e.languageId;
candidateLanguage = { id: e.languageId, source: 'event' };
}

// A languageId was not provided, so the data comes from outside VSCode
// We can still try to guess a good languageId from the first line if
// the paste changed the first line
else {
candidateLanguageId = withNullAsUndefined(this.languageService.guessLanguageIdByFilepathOrFirstLine(textModel.uri, textModel.getLineContent(1).substr(0, ModelConstants.FIRST_LINE_DETECTION_LENGTH_LIMIT)));
const guess = withNullAsUndefined(this.languageService.guessLanguageIdByFilepathOrFirstLine(textModel.uri, textModel.getLineContent(1).substr(0, ModelConstants.FIRST_LINE_DETECTION_LENGTH_LIMIT)));
if (guess) {
candidateLanguage = { id: guess, source: 'guess' };
}
}

// Finally apply languageId to model if specified
if (candidateLanguageId !== PLAINTEXT_LANGUAGE_ID) {
this.modelService.setMode(textModel, this.languageService.createById(candidateLanguageId));
if (candidateLanguage && candidateLanguage.id !== PLAINTEXT_LANGUAGE_ID) {
if (this.input instanceof UntitledTextEditorInput && candidateLanguage.source === 'event') {
// High confidence, set language id at TextEditorModel level to block future auto-detection
this.input.model.setLanguageId(candidateLanguage.id);
} else {
this.modelService.setMode(textModel, this.languageService.createById(candidateLanguage.id));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
transition: background-color 0.35s ease-out;
}

.monaco-workbench .part.statusbar:focus {
outline-color: var(--statusbar-focusborder);
}

.monaco-workbench .part.statusbar.status-border-top::after {
content: '';
position: absolute;
Expand Down
11 changes: 9 additions & 2 deletions src/vs/workbench/browser/parts/statusbar/statusbarPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { StatusbarAlignment, IStatusbarService, IStatusbarEntry, IStatusbarEntry
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IAction, Separator, toAction } from 'vs/base/common/actions';
import { IThemeService, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_FOREGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND, STATUS_BAR_ITEM_FOCUS_BORDER } from 'vs/workbench/common/theme';
import { STATUS_BAR_BACKGROUND, STATUS_BAR_FOREGROUND, STATUS_BAR_NO_FOLDER_BACKGROUND, STATUS_BAR_ITEM_HOVER_BACKGROUND, STATUS_BAR_ITEM_ACTIVE_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_FOREGROUND, STATUS_BAR_PROMINENT_ITEM_BACKGROUND, STATUS_BAR_PROMINENT_ITEM_HOVER_BACKGROUND, STATUS_BAR_BORDER, STATUS_BAR_NO_FOLDER_FOREGROUND, STATUS_BAR_NO_FOLDER_BORDER, STATUS_BAR_ITEM_COMPACT_HOVER_BACKGROUND, STATUS_BAR_ITEM_FOCUS_BORDER, STATUS_BAR_FOCUS_BORDER } from 'vs/workbench/common/theme';
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
import { contrastBorder, activeContrastBorder } from 'vs/platform/theme/common/colorRegistry';
import { EventHelper, createStyleSheet, addDisposableListener, EventType, clearNode } from 'vs/base/browser/dom';
Expand Down Expand Up @@ -521,12 +521,19 @@ export class StatusbarPart extends Part implements IStatusbarService {

// Colors and focus outlines via dynamic stylesheet

const statusBarFocusColor = this.getColor(STATUS_BAR_FOCUS_BORDER);

if (!this.styleElement) {
this.styleElement = createStyleSheet(container);
}

this.styleElement.textContent = `
/* Focus outline */
/* Status bar focus outline */
.monaco-workbench .part.statusbar:focus {
outline-color: ${statusBarFocusColor};
}
/* Status bar item focus outline */
.monaco-workbench .part.statusbar > .items-container > .statusbar-item a:focus-visible:not(.disabled) {
outline: 1px solid ${this.getColor(activeContrastBorder) ?? itemBorderColor};
outline-offset: ${borderColor ? '-2px' : '-1px'};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ registerAction2(class extends ViewAction<IMarkersView> {
keybinding: {
when: Constants.MarkerViewFilterFocusContextKey,
weight: KeybindingWeight.WorkbenchContrib,
primary: KeyCode.Escape
},
viewId: Constants.MARKERS_VIEW_ID
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,18 +411,13 @@ export class MarkersFilterActionViewItem extends BaseActionViewItem {
if (event.equals(KeyCode.Space)
|| event.equals(KeyCode.LeftArrow)
|| event.equals(KeyCode.RightArrow)
|| event.equals(KeyCode.Escape)
) {
event.stopPropagation();
}
}

private onInputKeyDown(event: StandardKeyboardEvent, filterInputBox: HistoryInputBox) {
let handled = false;
if (event.equals(KeyCode.Escape)) {
this.clearFilterText();
handled = true;
}
if (event.equals(KeyCode.Tab)) {
this.actionbar?.focus();
handled = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
visibility: hidden;
}

.monaco-workbench .notebookOverlay .simple-fr-find-part-wrapper.visible {
z-index: 100;
}

.monaco-workbench .simple-fr-find-part {
/* visibility: hidden; Use visibility to maintain flex layout while hidden otherwise interferes with transition */
z-index: 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,6 @@
position: relative;
}

.monaco-workbench .notebook-text-diff-editor .cell-body .output-view-container .output-plaintext {
white-space: pre;
overflow-x: hidden;
}

.monaco-workbench .notebook-text-diff-editor .cell-body.left .output-view-container .output-inner-container,
.monaco-workbench .notebook-text-diff-editor .cell-body.right .output-view-container .output-inner-container {
width: 100%;
Expand Down
Loading

0 comments on commit c926479

Please sign in to comment.