mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-05 17:23:51 -05:00
Merge VS Code 1.23.1 (#1520)
This commit is contained in:
@@ -10,6 +10,8 @@ import { ScrollbarVisibility } from 'vs/base/common/scrollable';
|
||||
import { FontInfo } from 'vs/editor/common/config/fontInfo';
|
||||
import { Constants } from 'vs/editor/common/core/uint';
|
||||
import { USUAL_WORD_SEPARATORS } from 'vs/editor/common/model/wordHelper';
|
||||
import * as arrays from 'vs/base/common/arrays';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
|
||||
/**
|
||||
* Configuration options for editor scrollbars
|
||||
@@ -135,6 +137,13 @@ export interface IEditorLightbulbOptions {
|
||||
enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration map for codeActionsOnSave
|
||||
*/
|
||||
export interface ICodeActionsOnSaveOptions {
|
||||
[kind: string]: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Configuration options for the editor.
|
||||
*/
|
||||
@@ -381,6 +390,11 @@ export interface IEditorOptions {
|
||||
* Defaults to 'alt'
|
||||
*/
|
||||
multiCursorModifier?: 'ctrlCmd' | 'alt';
|
||||
/**
|
||||
* Merge overlapping selections.
|
||||
* Defaults to true
|
||||
*/
|
||||
multiCursorMergeOverlapping?: boolean;
|
||||
/**
|
||||
* Configure the editor's accessibility support.
|
||||
* Defaults to 'auto'. It is best to leave this to 'auto'.
|
||||
@@ -460,7 +474,7 @@ export interface IEditorOptions {
|
||||
/**
|
||||
* The history mode for suggestions.
|
||||
*/
|
||||
suggestSelection?: string;
|
||||
suggestSelection?: 'first' | 'recentlyUsed' | 'recentlyUsedByPrefix';
|
||||
/**
|
||||
* The font size for the suggest widget.
|
||||
* Defaults to the editor font size.
|
||||
@@ -486,20 +500,28 @@ export interface IEditorOptions {
|
||||
* Defaults to true.
|
||||
*/
|
||||
codeLens?: boolean;
|
||||
/**
|
||||
* @deprecated - use codeLens instead
|
||||
* @internal
|
||||
*/
|
||||
referenceInfos?: boolean;
|
||||
/**
|
||||
* Control the behavior and rendering of the code action lightbulb.
|
||||
*/
|
||||
lightbulb?: IEditorLightbulbOptions;
|
||||
/**
|
||||
* Code action kinds to be run on save.
|
||||
*/
|
||||
codeActionsOnSave?: ICodeActionsOnSaveOptions;
|
||||
/**
|
||||
* Timeout for running code actions on save.
|
||||
*/
|
||||
codeActionsOnSaveTimeout?: number;
|
||||
/**
|
||||
* Enable code folding
|
||||
* Defaults to true in vscode and to false in monaco-editor.
|
||||
* Defaults to true.
|
||||
*/
|
||||
folding?: boolean;
|
||||
/**
|
||||
* Selects the folding strategy. 'auto' uses the strategies contributed for the current document, 'indentation' uses the indentation based folding strategy.
|
||||
* Defaults to 'auto'.
|
||||
*/
|
||||
foldingStrategy?: 'auto' | 'indentation';
|
||||
/**
|
||||
* Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter.
|
||||
* Defaults to 'mouseover'.
|
||||
@@ -838,11 +860,14 @@ export interface EditorContribOptions {
|
||||
readonly occurrencesHighlight: boolean;
|
||||
readonly codeLens: boolean;
|
||||
readonly folding: boolean;
|
||||
readonly foldingStrategy: 'auto' | 'indentation';
|
||||
readonly showFoldingControls: 'always' | 'mouseover';
|
||||
readonly matchBrackets: boolean;
|
||||
readonly find: InternalEditorFindOptions;
|
||||
readonly colorDecorators: boolean;
|
||||
readonly lightbulbEnabled: boolean;
|
||||
readonly codeActionsOnSave: ICodeActionsOnSaveOptions;
|
||||
readonly codeActionsOnSaveTimeout: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -872,6 +897,7 @@ export interface IValidatedEditorOptions {
|
||||
readonly emptySelectionClipboard: boolean;
|
||||
readonly useTabStops: boolean;
|
||||
readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';
|
||||
readonly multiCursorMergeOverlapping: boolean;
|
||||
readonly accessibilitySupport: 'auto' | 'off' | 'on';
|
||||
|
||||
readonly viewInfo: InternalEditorViewOptions;
|
||||
@@ -894,6 +920,7 @@ export class InternalEditorOptions {
|
||||
*/
|
||||
readonly accessibilitySupport: platform.AccessibilitySupport;
|
||||
readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';
|
||||
readonly multiCursorMergeOverlapping: boolean;
|
||||
|
||||
// ---- cursor options
|
||||
readonly wordSeparators: string;
|
||||
@@ -922,6 +949,7 @@ export class InternalEditorOptions {
|
||||
readOnly: boolean;
|
||||
accessibilitySupport: platform.AccessibilitySupport;
|
||||
multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';
|
||||
multiCursorMergeOverlapping: boolean;
|
||||
wordSeparators: string;
|
||||
autoClosingBrackets: boolean;
|
||||
autoIndent: boolean;
|
||||
@@ -942,6 +970,7 @@ export class InternalEditorOptions {
|
||||
this.readOnly = source.readOnly;
|
||||
this.accessibilitySupport = source.accessibilitySupport;
|
||||
this.multiCursorModifier = source.multiCursorModifier;
|
||||
this.multiCursorMergeOverlapping = source.multiCursorMergeOverlapping;
|
||||
this.wordSeparators = source.wordSeparators;
|
||||
this.autoClosingBrackets = source.autoClosingBrackets;
|
||||
this.autoIndent = source.autoIndent;
|
||||
@@ -968,6 +997,7 @@ export class InternalEditorOptions {
|
||||
&& this.readOnly === other.readOnly
|
||||
&& this.accessibilitySupport === other.accessibilitySupport
|
||||
&& this.multiCursorModifier === other.multiCursorModifier
|
||||
&& this.multiCursorMergeOverlapping === other.multiCursorMergeOverlapping
|
||||
&& this.wordSeparators === other.wordSeparators
|
||||
&& this.autoClosingBrackets === other.autoClosingBrackets
|
||||
&& this.autoIndent === other.autoIndent
|
||||
@@ -995,6 +1025,7 @@ export class InternalEditorOptions {
|
||||
readOnly: (this.readOnly !== newOpts.readOnly),
|
||||
accessibilitySupport: (this.accessibilitySupport !== newOpts.accessibilitySupport),
|
||||
multiCursorModifier: (this.multiCursorModifier !== newOpts.multiCursorModifier),
|
||||
multiCursorMergeOverlapping: (this.multiCursorMergeOverlapping !== newOpts.multiCursorMergeOverlapping),
|
||||
wordSeparators: (this.wordSeparators !== newOpts.wordSeparators),
|
||||
autoClosingBrackets: (this.autoClosingBrackets !== newOpts.autoClosingBrackets),
|
||||
autoIndent: (this.autoIndent !== newOpts.autoIndent),
|
||||
@@ -1058,7 +1089,7 @@ export class InternalEditorOptions {
|
||||
return (
|
||||
a.extraEditorClassName === b.extraEditorClassName
|
||||
&& a.disableMonospaceOptimizations === b.disableMonospaceOptimizations
|
||||
&& this._equalsNumberArrays(a.rulers, b.rulers)
|
||||
&& arrays.equals(a.rulers, b.rulers)
|
||||
&& a.ariaLabel === b.ariaLabel
|
||||
&& a.renderLineNumbers === b.renderLineNumbers
|
||||
&& a.renderCustomLineNumbers === b.renderCustomLineNumbers
|
||||
@@ -1120,18 +1151,6 @@ export class InternalEditorOptions {
|
||||
);
|
||||
}
|
||||
|
||||
private static _equalsNumberArrays(a: number[], b: number[]): boolean {
|
||||
if (a.length !== b.length) {
|
||||
return false;
|
||||
}
|
||||
for (let i = 0; i < a.length; i++) {
|
||||
if (a[i] !== b[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@@ -1188,10 +1207,13 @@ export class InternalEditorOptions {
|
||||
&& a.occurrencesHighlight === b.occurrencesHighlight
|
||||
&& a.codeLens === b.codeLens
|
||||
&& a.folding === b.folding
|
||||
&& a.foldingStrategy === b.foldingStrategy
|
||||
&& a.showFoldingControls === b.showFoldingControls
|
||||
&& a.matchBrackets === b.matchBrackets
|
||||
&& this._equalFindOptions(a.find, b.find)
|
||||
&& a.colorDecorators === b.colorDecorators
|
||||
&& objects.equals(a.codeActionsOnSave, b.codeActionsOnSave)
|
||||
&& a.codeActionsOnSaveTimeout === b.codeActionsOnSaveTimeout
|
||||
&& a.lightbulbEnabled === b.lightbulbEnabled
|
||||
);
|
||||
}
|
||||
@@ -1347,6 +1369,7 @@ export interface IConfigurationChangedEvent {
|
||||
readonly readOnly: boolean;
|
||||
readonly accessibilitySupport: boolean;
|
||||
readonly multiCursorModifier: boolean;
|
||||
readonly multiCursorMergeOverlapping: boolean;
|
||||
readonly wordSeparators: boolean;
|
||||
readonly autoClosingBrackets: boolean;
|
||||
readonly autoIndent: boolean;
|
||||
@@ -1388,6 +1411,21 @@ function _boolean<T>(value: any, defaultValue: T): boolean | T {
|
||||
return Boolean(value);
|
||||
}
|
||||
|
||||
function _booleanMap(value: { [key: string]: boolean }, defaultValue: { [key: string]: boolean }): { [key: string]: boolean } {
|
||||
if (!value) {
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
const out = Object.create(null);
|
||||
for (const k of Object.keys(value)) {
|
||||
const v = value[k];
|
||||
if (typeof v === 'boolean') {
|
||||
out[k] = v;
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function _string(value: any, defaultValue: string): string {
|
||||
if (typeof value !== 'string') {
|
||||
return defaultValue;
|
||||
@@ -1395,14 +1433,14 @@ function _string(value: any, defaultValue: string): string {
|
||||
return value;
|
||||
}
|
||||
|
||||
function _stringSet<T>(value: any, defaultValue: T, allowedValues: string[]): T {
|
||||
function _stringSet<T>(value: T, defaultValue: T, allowedValues: T[]): T {
|
||||
if (typeof value !== 'string') {
|
||||
return defaultValue;
|
||||
}
|
||||
if (allowedValues.indexOf(value) === -1) {
|
||||
return defaultValue;
|
||||
}
|
||||
return <T><any>value;
|
||||
return value;
|
||||
}
|
||||
|
||||
function _clampedInt(value: any, defaultValue: number, minimum: number, maximum: number): number {
|
||||
@@ -1532,6 +1570,7 @@ export class EditorOptionsValidator {
|
||||
emptySelectionClipboard: _boolean(opts.emptySelectionClipboard, defaults.emptySelectionClipboard),
|
||||
useTabStops: _boolean(opts.useTabStops, defaults.useTabStops),
|
||||
multiCursorModifier: multiCursorModifier,
|
||||
multiCursorMergeOverlapping: _boolean(opts.multiCursorMergeOverlapping, defaults.multiCursorMergeOverlapping),
|
||||
accessibilitySupport: _stringSet<'auto' | 'on' | 'off'>(opts.accessibilitySupport, defaults.accessibilitySupport, ['auto', 'on', 'off']),
|
||||
viewInfo: viewInfo,
|
||||
contribInfo: contribInfo,
|
||||
@@ -1652,7 +1691,11 @@ export class EditorOptionsValidator {
|
||||
renderLineHighlight = _stringSet<'none' | 'gutter' | 'line' | 'all'>(opts.renderLineHighlight, defaults.renderLineHighlight, ['none', 'gutter', 'line', 'all']);
|
||||
}
|
||||
|
||||
const mouseWheelScrollSensitivity = _float(opts.mouseWheelScrollSensitivity, defaults.scrollbar.mouseWheelScrollSensitivity);
|
||||
let mouseWheelScrollSensitivity = _float(opts.mouseWheelScrollSensitivity, defaults.scrollbar.mouseWheelScrollSensitivity);
|
||||
if (mouseWheelScrollSensitivity === 0) {
|
||||
// Disallow 0, as it would prevent/block scrolling
|
||||
mouseWheelScrollSensitivity = 1;
|
||||
}
|
||||
const scrollbar = this._sanitizeScrollbarOpts(opts.scrollbar, defaults.scrollbar, mouseWheelScrollSensitivity);
|
||||
const minimap = this._sanitizeMinimapOpts(opts.minimap, defaults.minimap);
|
||||
|
||||
@@ -1695,6 +1738,10 @@ export class EditorOptionsValidator {
|
||||
} else {
|
||||
quickSuggestions = _boolean(opts.quickSuggestions, defaults.quickSuggestions);
|
||||
}
|
||||
// Compatibility support for acceptSuggestionOnEnter
|
||||
if (typeof opts.acceptSuggestionOnEnter === 'boolean') {
|
||||
opts.acceptSuggestionOnEnter = opts.acceptSuggestionOnEnter ? 'on' : 'off';
|
||||
}
|
||||
const find = this._santizeFindOpts(opts.find, defaults.find);
|
||||
return {
|
||||
selectionClipboard: _boolean(opts.selectionClipboard, defaults.selectionClipboard),
|
||||
@@ -1708,7 +1755,7 @@ export class EditorOptionsValidator {
|
||||
formatOnType: _boolean(opts.formatOnType, defaults.formatOnType),
|
||||
formatOnPaste: _boolean(opts.formatOnPaste, defaults.formatOnPaste),
|
||||
suggestOnTriggerCharacters: _boolean(opts.suggestOnTriggerCharacters, defaults.suggestOnTriggerCharacters),
|
||||
acceptSuggestionOnEnter: typeof opts.acceptSuggestionOnEnter === 'string' ? _stringSet<'on' | 'smart' | 'off'>(opts.acceptSuggestionOnEnter, defaults.acceptSuggestionOnEnter, ['on', 'smart', 'off']) : opts.acceptSuggestionOnEnter ? 'on' : 'off',
|
||||
acceptSuggestionOnEnter: _stringSet<'on' | 'smart' | 'off'>(opts.acceptSuggestionOnEnter, defaults.acceptSuggestionOnEnter, ['on', 'smart', 'off']),
|
||||
acceptSuggestionOnCommitCharacter: _boolean(opts.acceptSuggestionOnCommitCharacter, defaults.acceptSuggestionOnCommitCharacter),
|
||||
snippetSuggestions: _stringSet<'top' | 'bottom' | 'inline' | 'none'>(opts.snippetSuggestions, defaults.snippetSuggestions, ['top', 'bottom', 'inline', 'none']),
|
||||
wordBasedSuggestions: _boolean(opts.wordBasedSuggestions, defaults.wordBasedSuggestions),
|
||||
@@ -1717,13 +1764,16 @@ export class EditorOptionsValidator {
|
||||
suggestLineHeight: _clampedInt(opts.suggestLineHeight, defaults.suggestLineHeight, 0, 1000),
|
||||
selectionHighlight: _boolean(opts.selectionHighlight, defaults.selectionHighlight),
|
||||
occurrencesHighlight: _boolean(opts.occurrencesHighlight, defaults.occurrencesHighlight),
|
||||
codeLens: _boolean(opts.codeLens, defaults.codeLens) && _boolean(opts.referenceInfos, true),
|
||||
codeLens: _boolean(opts.codeLens, defaults.codeLens),
|
||||
folding: _boolean(opts.folding, defaults.folding),
|
||||
foldingStrategy: _stringSet<'auto' | 'indentation'>(opts.foldingStrategy, defaults.foldingStrategy, ['auto', 'indentation']),
|
||||
showFoldingControls: _stringSet<'always' | 'mouseover'>(opts.showFoldingControls, defaults.showFoldingControls, ['always', 'mouseover']),
|
||||
matchBrackets: _boolean(opts.matchBrackets, defaults.matchBrackets),
|
||||
find: find,
|
||||
colorDecorators: _boolean(opts.colorDecorators, defaults.colorDecorators),
|
||||
lightbulbEnabled: _boolean(opts.lightbulb ? opts.lightbulb.enabled : false, defaults.lightbulbEnabled)
|
||||
lightbulbEnabled: _boolean(opts.lightbulb ? opts.lightbulb.enabled : false, defaults.lightbulbEnabled),
|
||||
codeActionsOnSave: _booleanMap(opts.codeActionsOnSave, {}),
|
||||
codeActionsOnSaveTimeout: _clampedInt(opts.codeActionsOnSaveTimeout, defaults.codeActionsOnSaveTimeout, 1, 10000)
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1758,6 +1808,7 @@ export class InternalEditorOptionsFactory {
|
||||
emptySelectionClipboard: opts.emptySelectionClipboard,
|
||||
useTabStops: opts.useTabStops,
|
||||
multiCursorModifier: opts.multiCursorModifier,
|
||||
multiCursorMergeOverlapping: opts.multiCursorMergeOverlapping,
|
||||
accessibilitySupport: opts.accessibilitySupport,
|
||||
|
||||
viewInfo: {
|
||||
@@ -1820,11 +1871,14 @@ export class InternalEditorOptionsFactory {
|
||||
occurrencesHighlight: (accessibilityIsOn ? false : opts.contribInfo.occurrencesHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
codeLens: (accessibilityIsOn ? false : opts.contribInfo.codeLens), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
folding: (accessibilityIsOn ? false : opts.contribInfo.folding), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
foldingStrategy: opts.contribInfo.foldingStrategy,
|
||||
showFoldingControls: opts.contribInfo.showFoldingControls,
|
||||
matchBrackets: (accessibilityIsOn ? false : opts.contribInfo.matchBrackets), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
find: opts.contribInfo.find,
|
||||
colorDecorators: opts.contribInfo.colorDecorators,
|
||||
lightbulbEnabled: opts.contribInfo.lightbulbEnabled
|
||||
lightbulbEnabled: opts.contribInfo.lightbulbEnabled,
|
||||
codeActionsOnSave: opts.contribInfo.codeActionsOnSave,
|
||||
codeActionsOnSaveTimeout: opts.contribInfo.codeActionsOnSaveTimeout
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1964,6 +2018,7 @@ export class InternalEditorOptionsFactory {
|
||||
readOnly: opts.readOnly,
|
||||
accessibilitySupport: accessibilitySupport,
|
||||
multiCursorModifier: opts.multiCursorModifier,
|
||||
multiCursorMergeOverlapping: opts.multiCursorMergeOverlapping,
|
||||
wordSeparators: opts.wordSeparators,
|
||||
autoClosingBrackets: opts.autoClosingBrackets,
|
||||
autoIndent: opts.autoIndent,
|
||||
@@ -1984,31 +2039,31 @@ export class InternalEditorOptionsFactory {
|
||||
* @internal
|
||||
*/
|
||||
export interface IEditorLayoutProviderOpts {
|
||||
outerWidth: number;
|
||||
outerHeight: number;
|
||||
readonly outerWidth: number;
|
||||
readonly outerHeight: number;
|
||||
|
||||
showGlyphMargin: boolean;
|
||||
lineHeight: number;
|
||||
readonly showGlyphMargin: boolean;
|
||||
readonly lineHeight: number;
|
||||
|
||||
showLineNumbers: boolean;
|
||||
lineNumbersMinChars: number;
|
||||
lineNumbersDigitCount: number;
|
||||
readonly showLineNumbers: boolean;
|
||||
readonly lineNumbersMinChars: number;
|
||||
readonly lineNumbersDigitCount: number;
|
||||
|
||||
lineDecorationsWidth: number;
|
||||
readonly lineDecorationsWidth: number;
|
||||
|
||||
typicalHalfwidthCharacterWidth: number;
|
||||
maxDigitWidth: number;
|
||||
readonly typicalHalfwidthCharacterWidth: number;
|
||||
readonly maxDigitWidth: number;
|
||||
|
||||
verticalScrollbarWidth: number;
|
||||
verticalScrollbarHasArrows: boolean;
|
||||
scrollbarArrowSize: number;
|
||||
horizontalScrollbarHeight: number;
|
||||
readonly verticalScrollbarWidth: number;
|
||||
readonly verticalScrollbarHasArrows: boolean;
|
||||
readonly scrollbarArrowSize: number;
|
||||
readonly horizontalScrollbarHeight: number;
|
||||
|
||||
minimap: boolean;
|
||||
minimapSide: string;
|
||||
minimapRenderCharacters: boolean;
|
||||
minimapMaxColumn: number;
|
||||
pixelRatio: number;
|
||||
readonly minimap: boolean;
|
||||
readonly minimapSide: string;
|
||||
readonly minimapRenderCharacters: boolean;
|
||||
readonly minimapMaxColumn: number;
|
||||
readonly pixelRatio: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -2074,18 +2129,19 @@ export class EditorLayoutProvider {
|
||||
}
|
||||
|
||||
// Given:
|
||||
// viewportColumn = (contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth
|
||||
// (leaving 2px for the cursor to have space after the last character)
|
||||
// viewportColumn = (contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth
|
||||
// minimapWidth = viewportColumn * minimapCharWidth
|
||||
// contentWidth = remainingWidth - minimapWidth
|
||||
// What are good values for contentWidth and minimapWidth ?
|
||||
|
||||
// minimapWidth = ((contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth) * minimapCharWidth
|
||||
// typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth) * minimapCharWidth
|
||||
// typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth) * minimapCharWidth
|
||||
// (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth) * minimapCharWidth
|
||||
// minimapWidth = ((remainingWidth - verticalScrollbarWidth) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)
|
||||
// minimapWidth = ((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth) * minimapCharWidth
|
||||
// typicalHalfwidthCharacterWidth * minimapWidth = (contentWidth - verticalScrollbarWidth - 2) * minimapCharWidth
|
||||
// typicalHalfwidthCharacterWidth * minimapWidth = (remainingWidth - minimapWidth - verticalScrollbarWidth - 2) * minimapCharWidth
|
||||
// (typicalHalfwidthCharacterWidth + minimapCharWidth) * minimapWidth = (remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth
|
||||
// minimapWidth = ((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)
|
||||
|
||||
minimapWidth = Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)));
|
||||
minimapWidth = Math.max(0, Math.floor(((remainingWidth - verticalScrollbarWidth - 2) * minimapCharWidth) / (typicalHalfwidthCharacterWidth + minimapCharWidth)));
|
||||
let minimapColumns = minimapWidth / minimapCharWidth;
|
||||
if (minimapColumns > minimapMaxColumn) {
|
||||
minimapWidth = Math.floor(minimapMaxColumn * minimapCharWidth);
|
||||
@@ -2103,7 +2159,8 @@ export class EditorLayoutProvider {
|
||||
}
|
||||
}
|
||||
|
||||
const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth) / typicalHalfwidthCharacterWidth));
|
||||
// (leaving 2px for the cursor to have space after the last character)
|
||||
const viewportColumn = Math.max(1, Math.floor((contentWidth - verticalScrollbarWidth - 2) / typicalHalfwidthCharacterWidth));
|
||||
|
||||
const verticalArrowSize = (verticalScrollbarHasArrows ? scrollbarArrowSize : 0);
|
||||
|
||||
@@ -2172,7 +2229,8 @@ export const EDITOR_MODEL_DEFAULTS = {
|
||||
tabSize: 4,
|
||||
insertSpaces: true,
|
||||
detectIndentation: true,
|
||||
trimAutoWhitespace: true
|
||||
trimAutoWhitespace: true,
|
||||
largeFileOptimizations: true
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -2200,6 +2258,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
emptySelectionClipboard: true,
|
||||
useTabStops: true,
|
||||
multiCursorModifier: 'altKey',
|
||||
multiCursorMergeOverlapping: true,
|
||||
accessibilitySupport: 'auto',
|
||||
|
||||
viewInfo: {
|
||||
@@ -2276,6 +2335,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
occurrencesHighlight: true,
|
||||
codeLens: true,
|
||||
folding: true,
|
||||
foldingStrategy: 'auto',
|
||||
showFoldingControls: 'mouseover',
|
||||
matchBrackets: true,
|
||||
find: {
|
||||
@@ -2284,6 +2344,8 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
globalFindClipboard: false
|
||||
},
|
||||
colorDecorators: true,
|
||||
lightbulbEnabled: true
|
||||
lightbulbEnabled: true,
|
||||
codeActionsOnSave: {},
|
||||
codeActionsOnSaveTimeout: 750
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user