Skip to content

Commit

Permalink
Adding the Editor Action Bar (#5181)
Browse files Browse the repository at this point in the history
  • Loading branch information
softwarenerd authored Oct 29, 2024
1 parent 8724eef commit 7a6c8c1
Show file tree
Hide file tree
Showing 15 changed files with 876 additions and 169 deletions.
2 changes: 2 additions & 0 deletions build/lib/stylelint/vscode-known-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -522,8 +522,10 @@
"--vscode-pickerGroup-border",
"--vscode-pickerGroup-foreground",
"--vscode-ports-iconRunningProcessForeground",
"--positronActionBar-disabledForeground",
"--positronActionBar-foreground",
"--positronActionBar-hoverBackground",
"--positronActionBar-iconSize",
"--positronActionBar-textInputBackground",
"--positronActionBar-textInputSelectionBackground",
"--positronActionBar-textInputSelectionForeground",
Expand Down
81 changes: 81 additions & 0 deletions src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,12 @@ export interface IEditorOptions {
* Control the behavior of sticky scroll options
*/
stickyScroll?: IEditorStickyScrollOptions;
// --- Start Positron ---
/**
* Control the behavior and rendering of the editor action bar.
*/
actionBar?: IEditorActionBarOptions;
// --- End Positron ---
/**
* Control the behavior and rendering of the minimap.
*/
Expand Down Expand Up @@ -3068,6 +3074,75 @@ class EditorLineHeight extends EditorFloatOption<EditorOption.lineHeight> {

//#endregion

// --- Start Positron ---
//#region action bar

/**
* Configuration options for editor action bar.
*/
export interface IEditorActionBarOptions {
/**
* Enable the editor action bar.
* Defaults to false.
*/
enabled?: boolean;
}

/**
* @internal
*/
export type EditorActionBarOptions = Readonly<Required<IEditorActionBarOptions>>;

/**
* EditorActionBar class.
*/
class EditorActionBar extends BaseEditorOption<EditorOption.actionBar, IEditorActionBarOptions, EditorActionBarOptions> {
/**
* Constructor.
*/
constructor() {
/**
* Default options for the editor action bar.
*/
const defaults: EditorActionBarOptions = {
enabled: false,
};

// Call the base class's constructor.
super(
EditorOption.actionBar,
'actionBar',
defaults,
{
'editor.actionBar.enabled': {
type: 'boolean',
default: defaults.enabled,
description: nls.localize('actionBar.enabled', "Controls whether the action bar is shown."),

}
}
);
}

/**
* Validates an input object as an instance of EditorActionBarOptions.
* @param _input The input object to validate.
* @returns The validated EditorActionBarOptions object.
*/
public validate(_input: any): EditorActionBarOptions {
if (!_input || typeof _input !== 'object') {
return this.defaultValue;
}
const input = _input as IEditorActionBarOptions;
return {
enabled: boolean(input.enabled, this.defaultValue.enabled),
};
}
}

//#endregion
// --- End Positron ---

//#region minimap

/**
Expand Down Expand Up @@ -5404,6 +5479,9 @@ export const enum EditorOption {
linkedEditing,
links,
matchBrackets,
// --- Start Positron ---
actionBar,
// --- End Positron ---
minimap,
mouseStyle,
mouseWheelScrollSensitivity,
Expand Down Expand Up @@ -5859,6 +5937,9 @@ export const EditorOptions = {
['always', 'near', 'never'] as const,
{ description: nls.localize('matchBrackets', "Highlight matching brackets.") }
)),
// --- Start Positron ---
actionBar: register(new EditorActionBar()),
// --- End Positron ---
minimap: register(new EditorMinimap()),
mouseStyle: register(new EditorStringEnumOption(
EditorOption.mouseStyle, 'mouseStyle',
Expand Down
161 changes: 81 additions & 80 deletions src/vs/editor/common/standalone/standaloneEnums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,86 +246,87 @@ export enum EditorOption {
linkedEditing = 70,
links = 71,
matchBrackets = 72,
minimap = 73,
mouseStyle = 74,
mouseWheelScrollSensitivity = 75,
mouseWheelZoom = 76,
multiCursorMergeOverlapping = 77,
multiCursorModifier = 78,
multiCursorPaste = 79,
multiCursorLimit = 80,
occurrencesHighlight = 81,
overviewRulerBorder = 82,
overviewRulerLanes = 83,
padding = 84,
pasteAs = 85,
parameterHints = 86,
peekWidgetDefaultFocus = 87,
placeholder = 88,
definitionLinkOpensInPeek = 89,
quickSuggestions = 90,
quickSuggestionsDelay = 91,
readOnly = 92,
readOnlyMessage = 93,
renameOnType = 94,
renderControlCharacters = 95,
renderFinalNewline = 96,
renderLineHighlight = 97,
renderLineHighlightOnlyWhenFocus = 98,
renderValidationDecorations = 99,
renderWhitespace = 100,
revealHorizontalRightPadding = 101,
roundedSelection = 102,
rulers = 103,
scrollbar = 104,
scrollBeyondLastColumn = 105,
scrollBeyondLastLine = 106,
scrollPredominantAxis = 107,
selectionClipboard = 108,
selectionHighlight = 109,
selectOnLineNumbers = 110,
showFoldingControls = 111,
showUnused = 112,
snippetSuggestions = 113,
smartSelect = 114,
smoothScrolling = 115,
stickyScroll = 116,
stickyTabStops = 117,
stopRenderingLineAfter = 118,
suggest = 119,
suggestFontSize = 120,
suggestLineHeight = 121,
suggestOnTriggerCharacters = 122,
suggestSelection = 123,
tabCompletion = 124,
tabIndex = 125,
unicodeHighlighting = 126,
unusualLineTerminators = 127,
useShadowDOM = 128,
useTabStops = 129,
wordBreak = 130,
wordSegmenterLocales = 131,
wordSeparators = 132,
wordWrap = 133,
wordWrapBreakAfterCharacters = 134,
wordWrapBreakBeforeCharacters = 135,
wordWrapColumn = 136,
wordWrapOverride1 = 137,
wordWrapOverride2 = 138,
wrappingIndent = 139,
wrappingStrategy = 140,
showDeprecated = 141,
inlayHints = 142,
editorClassName = 143,
pixelRatio = 144,
tabFocusMode = 145,
layoutInfo = 146,
wrappingInfo = 147,
defaultColorDecorators = 148,
colorDecoratorsActivatedOn = 149,
inlineCompletionsAccessibilityVerbose = 150,
quickSuggestionsMinimumLength = 151,
tabSuggest = 152
actionBar = 73,
minimap = 74,
mouseStyle = 75,
mouseWheelScrollSensitivity = 76,
mouseWheelZoom = 77,
multiCursorMergeOverlapping = 78,
multiCursorModifier = 79,
multiCursorPaste = 80,
multiCursorLimit = 81,
occurrencesHighlight = 82,
overviewRulerBorder = 83,
overviewRulerLanes = 84,
padding = 85,
pasteAs = 86,
parameterHints = 87,
peekWidgetDefaultFocus = 88,
placeholder = 89,
definitionLinkOpensInPeek = 90,
quickSuggestions = 91,
quickSuggestionsDelay = 92,
readOnly = 93,
readOnlyMessage = 94,
renameOnType = 95,
renderControlCharacters = 96,
renderFinalNewline = 97,
renderLineHighlight = 98,
renderLineHighlightOnlyWhenFocus = 99,
renderValidationDecorations = 100,
renderWhitespace = 101,
revealHorizontalRightPadding = 102,
roundedSelection = 103,
rulers = 104,
scrollbar = 105,
scrollBeyondLastColumn = 106,
scrollBeyondLastLine = 107,
scrollPredominantAxis = 108,
selectionClipboard = 109,
selectionHighlight = 110,
selectOnLineNumbers = 111,
showFoldingControls = 112,
showUnused = 113,
snippetSuggestions = 114,
smartSelect = 115,
smoothScrolling = 116,
stickyScroll = 117,
stickyTabStops = 118,
stopRenderingLineAfter = 119,
suggest = 120,
suggestFontSize = 121,
suggestLineHeight = 122,
suggestOnTriggerCharacters = 123,
suggestSelection = 124,
tabCompletion = 125,
tabIndex = 126,
unicodeHighlighting = 127,
unusualLineTerminators = 128,
useShadowDOM = 129,
useTabStops = 130,
wordBreak = 131,
wordSegmenterLocales = 132,
wordSeparators = 133,
wordWrap = 134,
wordWrapBreakAfterCharacters = 135,
wordWrapBreakBeforeCharacters = 136,
wordWrapColumn = 137,
wordWrapOverride1 = 138,
wordWrapOverride2 = 139,
wrappingIndent = 140,
wrappingStrategy = 141,
showDeprecated = 142,
inlayHints = 143,
editorClassName = 144,
pixelRatio = 145,
tabFocusMode = 146,
layoutInfo = 147,
wrappingInfo = 148,
defaultColorDecorators = 149,
colorDecoratorsActivatedOn = 150,
inlineCompletionsAccessibilityVerbose = 151,
quickSuggestionsMinimumLength = 152,
tabSuggest = 153
}

/**
Expand Down
Loading

0 comments on commit 7a6c8c1

Please sign in to comment.