Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: bump vscode to 1.80.0 #504

Merged
merged 3 commits into from
Jul 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vscode-web/.VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.78.2
1.80.0
171 changes: 158 additions & 13 deletions vscode-web/src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

import * as nls from 'vs/nls';
import * as arrays from 'vs/base/common/arrays';
import { IMarkdownString } from 'vs/base/common/htmlContent';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import * as objects from 'vs/base/common/objects';
import * as platform from 'vs/base/common/platform';
import { ScrollbarVisibility } from 'vs/base/common/scrollable';
import { FontInfo } from 'vs/editor/common/config/fontInfo';
import { Constants } from 'vs/base/common/uint';
import { FontInfo } from 'vs/editor/common/config/fontInfo';
import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';
import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/core/wordHelper';
import { IDocumentDiffProvider } from 'vs/editor/common/diff/documentDiffProvider';
import * as nls from 'vs/nls';
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
import { IConfigurationPropertySchema } from 'vs/platform/configuration/common/configurationRegistry';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import * as arrays from 'vs/base/common/arrays';
import * as objects from 'vs/base/common/objects';
import { EDITOR_MODEL_DEFAULTS } from 'vs/editor/common/core/textModelDefaults';
import { IDocumentDiffProvider } from 'vs/editor/common/diff/documentDiffProvider';

//#region typed options

Expand Down Expand Up @@ -151,6 +152,10 @@ export interface IEditorOptions {
* Defaults to false.
*/
readOnly?: boolean;
/**
* The message to display when the editor is readonly.
*/
readOnlyMessage?: IMarkdownString;
/**
* Should the textarea used for input use the DOM `readonly` attribute.
* Defaults to false.
Expand Down Expand Up @@ -349,6 +354,10 @@ export interface IEditorOptions {
* Enable inline color decorators and color picker rendering.
*/
colorDecorators?: boolean;
/**
* Controls what is the condition to spawn a color picker from a color dectorator
*/
colorDecoratorsActivatedOn?: 'clickAndHover' | 'click' | 'hover';
/**
* Controls the max number of color decorators that can be rendered in an editor at once.
*/
Expand Down Expand Up @@ -707,6 +716,11 @@ export interface IEditorOptions {
*/
dropIntoEditor?: IDropIntoEditorOptions;

/**
* Controls support for changing how content is pasted into the editor.
*/
pasteAs?: IPasteAsOptions;

/**
* Controls whether the editor receives tabs or defers them to the workbench for navigation.
*/
Expand Down Expand Up @@ -789,6 +803,25 @@ export interface IDiffEditorBaseOptions {
* Whether the diff editor aria label should be verbose.
*/
accessibilityVerbose?: boolean;

experimental?: {
/**
* Defaults to false.
*/
collapseUnchangedRegions?: boolean;
/**
* Defaults to false.
*/
showMoves?: boolean;

showEmptyDecorations?: boolean;
};

/**
* Is the diff editor inside another editor
* Defaults to false
*/
isInEmbeddedEditor?: boolean;
}

/**
Expand Down Expand Up @@ -3434,6 +3467,30 @@ class EditorRulers extends BaseEditorOption<EditorOption.rulers, (number | IRule

//#endregion

//#region readonly

/**
* Configuration options for readonly message
*/
class ReadonlyMessage extends BaseEditorOption<EditorOption.readOnlyMessage, IMarkdownString | undefined, IMarkdownString | undefined> {
constructor() {
const defaults = undefined;

super(
EditorOption.readOnlyMessage, 'readOnlyMessage', defaults
);
}

public validate(_input: any): IMarkdownString | undefined {
if (!_input || typeof _input !== 'object') {
return this.defaultValue;
}
return _input as IMarkdownString;
}
}

//#endregion

//#region scrollbar

/**
Expand Down Expand Up @@ -4282,7 +4339,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptio
const defaults: InternalSuggestOptions = {
insertMode: 'insert',
filterGraceful: true,
snippetsPreventQuickSuggestions: true,
snippetsPreventQuickSuggestions: false,
localityBonus: false,
shareSuggestSelections: false,
selectionMode: 'always',
Expand Down Expand Up @@ -4604,6 +4661,7 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, ISuggestOptio

export interface ISmartSelectOptions {
selectLeadingAndTrailingWhitespace?: boolean;
selectSubwords?: boolean;
}

/**
Expand All @@ -4617,13 +4675,19 @@ class SmartSelect extends BaseEditorOption<EditorOption.smartSelect, ISmartSelec
super(
EditorOption.smartSelect, 'smartSelect',
{
selectLeadingAndTrailingWhitespace: true
selectLeadingAndTrailingWhitespace: true,
selectSubwords: true,
},
{
'editor.smartSelect.selectLeadingAndTrailingWhitespace': {
description: nls.localize('selectLeadingAndTrailingWhitespace', "Whether leading and trailing whitespace should always be selected."),
default: true,
type: 'boolean'
},
'editor.smartSelect.selectSubwords': {
description: nls.localize('selectSubwords', "Whether subwords (like 'foo' in 'fooBar' or 'foo_bar') should be selected."),
default: true,
type: 'boolean'
}
}
);
Expand All @@ -4634,7 +4698,8 @@ class SmartSelect extends BaseEditorOption<EditorOption.smartSelect, ISmartSelec
return this.defaultValue;
}
return {
selectLeadingAndTrailingWhitespace: boolean((input as ISmartSelectOptions).selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace)
selectLeadingAndTrailingWhitespace: boolean((input as ISmartSelectOptions).selectLeadingAndTrailingWhitespace, this.defaultValue.selectLeadingAndTrailingWhitespace),
selectSubwords: boolean((input as ISmartSelectOptions).selectSubwords, this.defaultValue.selectSubwords),
};
}
}
Expand Down Expand Up @@ -4805,6 +4870,73 @@ class EditorDropIntoEditor extends BaseEditorOption<EditorOption.dropIntoEditor,

//#endregion

//#region pasteAs

/**
* Configuration options for editor pasting as into behavior
*/
export interface IPasteAsOptions {
/**
* Enable paste as functionality in editors.
* Defaults to true.
*/
enabled?: boolean;

/**
* Controls if a widget is shown after a drop.
* Defaults to 'afterPaste'.
*/
showPasteSelector?: 'afterPaste' | 'never';
}

/**
* @internal
*/
export type EditorPasteAsOptions = Readonly<Required<IPasteAsOptions>>;

class EditorPasteAs extends BaseEditorOption<EditorOption.pasteAs, IPasteAsOptions, EditorPasteAsOptions> {

constructor() {
const defaults: EditorPasteAsOptions = { enabled: true, showPasteSelector: 'afterPaste' };
super(
EditorOption.pasteAs, 'pasteAs', defaults,
{
'editor.pasteAs.enabled': {
type: 'boolean',
default: defaults.enabled,
markdownDescription: nls.localize('pasteAs.enabled', "Controls whether you can paste content in different ways."),
},
'editor.pasteAs.showPasteSelector': {
type: 'string',
markdownDescription: nls.localize('pasteAs.showPasteSelector', "Controls if a widget is shown when pasting content in to the editor. This widget lets you control how the file is pasted."),
enum: [
'afterPaste',
'never'
],
enumDescriptions: [
nls.localize('pasteAs.showPasteSelector.afterPaste', "Show the paste selector widget after content is pasted into the editor."),
nls.localize('pasteAs.showPasteSelector.never', "Never show the paste selector widget. Instead the default pasting behavior is always used."),
],
default: 'afterPaste',
},
}
);
}

public validate(_input: any): EditorPasteAsOptions {
if (!_input || typeof _input !== 'object') {
return this.defaultValue;
}
const input = _input as IPasteAsOptions;
return {
enabled: boolean(input.enabled, this.defaultValue.enabled),
showPasteSelector: stringSet(input.showPasteSelector, this.defaultValue.showPasteSelector, ['afterPaste', 'never']),
};
}
}

//#endregion

const DEFAULT_WINDOWS_FONT_FAMILY = 'Consolas, \'Courier New\', monospace';
const DEFAULT_MAC_FONT_FAMILY = 'Menlo, Monaco, \'Courier New\', monospace';
const DEFAULT_LINUX_FONT_FAMILY = '\'Droid Sans Mono\', \'monospace\', monospace';
Expand Down Expand Up @@ -4917,12 +5049,14 @@ export const enum EditorOption {
overviewRulerBorder,
overviewRulerLanes,
padding,
pasteAs,
parameterHints,
peekWidgetDefaultFocus,
definitionLinkOpensInPeek,
quickSuggestions,
quickSuggestionsDelay,
readOnly,
readOnlyMessage,
renameOnType,
renderControlCharacters,
renderFinalNewline,
Expand Down Expand Up @@ -4977,7 +5111,8 @@ export const enum EditorOption {
tabFocusMode,
layoutInfo,
wrappingInfo,
defaultColorDecorators
defaultColorDecorators,
colorDecoratorsActivatedOn
}

export const EditorOptions = {
Expand Down Expand Up @@ -5008,9 +5143,9 @@ export const EditorOptions = {
EditorOption.ariaLabel, 'ariaLabel', nls.localize('editorViewAccessibleLabel', "Editor content")
)),
screenReaderAnnounceInlineSuggestion: register(new EditorBooleanOption(
EditorOption.screenReaderAnnounceInlineSuggestion, 'screenReaderAnnounceInlineSuggestion', false,
EditorOption.screenReaderAnnounceInlineSuggestion, 'screenReaderAnnounceInlineSuggestion', true,
{
description: nls.localize('screenReaderAnnounceInlineSuggestion', "Control whether inline suggestions are announced by a screen reader. Note that this does not work on macOS with VoiceOver."),
description: nls.localize('screenReaderAnnounceInlineSuggestion', "Control whether inline suggestions are announced by a screen reader."),
tags: ['accessibility']
}
)),
Expand Down Expand Up @@ -5126,6 +5261,14 @@ export const EditorOptions = {
EditorOption.colorDecorators, 'colorDecorators', true,
{ description: nls.localize('colorDecorators', "Controls whether the editor should render the inline color decorators and color picker.") }
)),
colorDecoratorActivatedOn: register(new EditorStringEnumOption(EditorOption.colorDecoratorsActivatedOn, 'colorDecoratorsActivatedOn', 'clickAndHover' as 'clickAndHover' | 'hover' | 'click', ['clickAndHover', 'hover', 'click'] as const, {
enumDescriptions: [
nls.localize('editor.colorDecoratorActivatedOn.clickAndHover', "Make the color picker appear both on click and hover of the color decorator"),
nls.localize('editor.colorDecoratorActivatedOn.hover', "Make the color picker appear on hover of the color decorator"),
nls.localize('editor.colorDecoratorActivatedOn.click', "Make the color picker appear on click of the color decorator")
],
description: nls.localize('colorDecoratorActivatedOn', "Controls the condition to make a color picker appear from a color decorator")
})),
colorDecoratorsLimit: register(new EditorIntOption(
EditorOption.colorDecoratorsLimit, 'colorDecoratorsLimit', 500, 1, 1000000,
{
Expand Down Expand Up @@ -5395,6 +5538,7 @@ export const EditorOptions = {
3, 0, 3
)),
padding: register(new EditorPadding()),
pasteAs: register(new EditorPasteAs()),
parameterHints: register(new EditorParameterHints()),
peekWidgetDefaultFocus: register(new EditorStringEnumOption(
EditorOption.peekWidgetDefaultFocus, 'peekWidgetDefaultFocus',
Expand All @@ -5421,6 +5565,7 @@ export const EditorOptions = {
readOnly: register(new EditorBooleanOption(
EditorOption.readOnly, 'readOnly', false,
)),
readOnlyMessage: register(new ReadonlyMessage()),
renameOnType: register(new EditorBooleanOption(
EditorOption.renameOnType, 'renameOnType', false,
{ description: nls.localize('renameOnType', "Controls whether the editor auto renames on type."), markdownDeprecationMessage: nls.localize('renameOnTypeDeprecate', "Deprecated, use `editor.linkedEditing` instead.") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -921,7 +921,7 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart
state.push({
id: compositeItem.id,
name: viewContainerModel.title,
icon: URI.isUri(viewContainerModel.icon) && this.environmentService.remoteAuthority ? undefined : viewContainerModel.icon, /* Donot cache uri icons with remote connection */
icon: URI.isUri(viewContainerModel.icon) && this.environmentService.remoteAuthority ? undefined : viewContainerModel.icon, // Do not cache uri icons with remote connection
views,
pinned: compositeItem.pinned,
order: compositeItem.order,
Expand All @@ -947,7 +947,7 @@ export class ActivitybarPart extends Part implements IPaneCompositeSelectorPart
cachedViewContainer.icon = placeholderViewContainer.themeIcon ? placeholderViewContainer.themeIcon :
placeholderViewContainer.iconUrl ? URI.revive(placeholderViewContainer.iconUrl) : undefined;
if (URI.isUri(cachedViewContainer.icon) && this.environmentService.remoteAuthority) {
cachedViewContainer.icon = undefined; /* Donot cache uri icons with remote connection */
cachedViewContainer.icon = undefined; // Do not cache uri icons with remote connection
}
cachedViewContainer.views = placeholderViewContainer.views;
cachedViewContainer.isBuiltin = placeholderViewContainer.isBuiltin;
Expand Down
Loading
Loading