mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Vscode merge (#4582)
* Merge from vscode 37cb23d3dd4f9433d56d4ba5ea3203580719a0bd * fix issues with merges * bump node version in azpipe * replace license headers * remove duplicate launch task * fix build errors * fix build errors * fix tslint issues * working through package and linux build issues * more work * wip * fix packaged builds * working through linux build errors * wip * wip * wip * fix mac and linux file limits * iterate linux pipeline * disable editor typing * revert series to parallel * remove optimize vscode from linux * fix linting issues * revert testing change * add work round for new node * readd packaging for extensions * fix issue with angular not resolving decorator dependencies
This commit is contained in:
@@ -11,6 +11,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 { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { isObject } from 'vs/base/common/types';
|
||||
|
||||
/**
|
||||
* Configuration options for editor scrollbars
|
||||
@@ -85,6 +87,10 @@ export interface IEditorFindOptions {
|
||||
* Controls if Find in Selection flag is turned on when multiple lines of text are selected in the editor.
|
||||
*/
|
||||
autoFindInSelection: boolean;
|
||||
/*
|
||||
* Controls whether the Find Widget should add extra lines on top of the editor.
|
||||
*/
|
||||
addExtraSpaceOnTop?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
* Controls if the Find Widget should read or modify the shared find clipboard on macOS
|
||||
@@ -194,11 +200,29 @@ export interface ISuggestOptions {
|
||||
* Favours words that appear close to the cursor.
|
||||
*/
|
||||
localityBonus?: boolean;
|
||||
|
||||
/**
|
||||
* Enable using global storage for remembering suggestions.
|
||||
*/
|
||||
shareSuggestSelections?: boolean;
|
||||
/**
|
||||
* Enable or disable icons in suggestions. Defaults to true.
|
||||
*/
|
||||
showIcons?: boolean;
|
||||
/**
|
||||
* Max suggestions to show in suggestions. Defaults to 12.
|
||||
*/
|
||||
maxVisibleSuggestions?: boolean;
|
||||
/**
|
||||
* Names of suggestion types to filter.
|
||||
*/
|
||||
filteredTypes?: Record<string, boolean>;
|
||||
}
|
||||
|
||||
export interface IGotoLocationOptions {
|
||||
/**
|
||||
* Control how goto-command work when having multiple results.
|
||||
*/
|
||||
many?: 'peek' | 'revealAndPeek' | 'reveal';
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -244,6 +268,11 @@ export interface IEditorOptions {
|
||||
* Defaults to true.
|
||||
*/
|
||||
lineNumbers?: 'on' | 'off' | 'relative' | 'interval' | ((lineNumber: number) => string);
|
||||
/**
|
||||
* Render last line number when the file ends with a newline.
|
||||
* Defaults to true on Windows/Mac and to false on Linux.
|
||||
*/
|
||||
renderFinalNewline?: boolean;
|
||||
/**
|
||||
* Should the corresponding line be selected when clicking on the line number?
|
||||
* Defaults to true.
|
||||
@@ -482,6 +511,10 @@ export interface IEditorOptions {
|
||||
* Suggest options.
|
||||
*/
|
||||
suggest?: ISuggestOptions;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
gotoLocation?: IGotoLocationOptions;
|
||||
/**
|
||||
* Enable quick suggestions (shadow suggestions)
|
||||
* Defaults to true.
|
||||
@@ -496,11 +529,6 @@ export interface IEditorOptions {
|
||||
* Parameter hint options.
|
||||
*/
|
||||
parameterHints?: IEditorParameterHintOptions;
|
||||
/**
|
||||
* Render icons in suggestions box.
|
||||
* Defaults to true.
|
||||
*/
|
||||
iconsInSuggestions?: boolean;
|
||||
/**
|
||||
* Options for auto closing brackets.
|
||||
* Defaults to language defined behavior.
|
||||
@@ -894,6 +922,7 @@ export interface InternalEditorMinimapOptions {
|
||||
export interface InternalEditorFindOptions {
|
||||
readonly seedSearchStringFromSelection: boolean;
|
||||
readonly autoFindInSelection: boolean;
|
||||
readonly addExtraSpaceOnTop: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@@ -906,12 +935,19 @@ export interface InternalEditorHoverOptions {
|
||||
readonly sticky: boolean;
|
||||
}
|
||||
|
||||
export interface InternalGoToLocationOptions {
|
||||
readonly many: 'peek' | 'revealAndPeek' | 'reveal';
|
||||
}
|
||||
|
||||
export interface InternalSuggestOptions {
|
||||
readonly filterGraceful: boolean;
|
||||
readonly snippets: 'top' | 'bottom' | 'inline' | 'none';
|
||||
readonly snippetsPreventQuickSuggestions: boolean;
|
||||
readonly localityBonus: boolean;
|
||||
readonly shareSuggestSelections: boolean;
|
||||
readonly showIcons: boolean;
|
||||
readonly maxVisibleSuggestions: number;
|
||||
readonly filteredTypes: Record<string, boolean>;
|
||||
}
|
||||
|
||||
export interface InternalParameterHintOptions {
|
||||
@@ -946,6 +982,7 @@ export interface InternalEditorViewOptions {
|
||||
readonly ariaLabel: string;
|
||||
readonly renderLineNumbers: RenderLineNumbersType;
|
||||
readonly renderCustomLineNumbers: ((lineNumber: number) => string) | null;
|
||||
readonly renderFinalNewline: boolean;
|
||||
readonly selectOnLineNumbers: boolean;
|
||||
readonly glyphMargin: boolean;
|
||||
readonly revealHorizontalRightPadding: number;
|
||||
@@ -981,7 +1018,6 @@ export interface EditorContribOptions {
|
||||
readonly quickSuggestions: boolean | { other: boolean, comments: boolean, strings: boolean };
|
||||
readonly quickSuggestionsDelay: number;
|
||||
readonly parameterHints: InternalParameterHintOptions;
|
||||
readonly iconsInSuggestions: boolean;
|
||||
readonly formatOnType: boolean;
|
||||
readonly formatOnPaste: boolean;
|
||||
readonly suggestOnTriggerCharacters: boolean;
|
||||
@@ -993,6 +1029,7 @@ export interface EditorContribOptions {
|
||||
readonly suggestLineHeight: number;
|
||||
readonly tabCompletion: 'on' | 'off' | 'onlySnippets';
|
||||
readonly suggest: InternalSuggestOptions;
|
||||
readonly gotoLocation: InternalGoToLocationOptions;
|
||||
readonly selectionHighlight: boolean;
|
||||
readonly occurrencesHighlight: boolean;
|
||||
readonly codeLens: boolean;
|
||||
@@ -1059,7 +1096,7 @@ export class InternalEditorOptions {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
readonly accessibilitySupport: platform.AccessibilitySupport;
|
||||
readonly accessibilitySupport: AccessibilitySupport;
|
||||
readonly multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';
|
||||
readonly multiCursorMergeOverlapping: boolean;
|
||||
readonly showUnused: boolean;
|
||||
@@ -1092,7 +1129,7 @@ export class InternalEditorOptions {
|
||||
editorClassName: string;
|
||||
lineHeight: number;
|
||||
readOnly: boolean;
|
||||
accessibilitySupport: platform.AccessibilitySupport;
|
||||
accessibilitySupport: AccessibilitySupport;
|
||||
multiCursorModifier: 'altKey' | 'ctrlKey' | 'metaKey';
|
||||
multiCursorMergeOverlapping: boolean;
|
||||
wordSeparators: string;
|
||||
@@ -1253,6 +1290,7 @@ export class InternalEditorOptions {
|
||||
&& a.ariaLabel === b.ariaLabel
|
||||
&& a.renderLineNumbers === b.renderLineNumbers
|
||||
&& a.renderCustomLineNumbers === b.renderCustomLineNumbers
|
||||
&& a.renderFinalNewline === b.renderFinalNewline
|
||||
&& a.selectOnLineNumbers === b.selectOnLineNumbers
|
||||
&& a.glyphMargin === b.glyphMargin
|
||||
&& a.revealHorizontalRightPadding === b.revealHorizontalRightPadding
|
||||
@@ -1323,6 +1361,7 @@ export class InternalEditorOptions {
|
||||
a.seedSearchStringFromSelection === b.seedSearchStringFromSelection
|
||||
&& a.autoFindInSelection === b.autoFindInSelection
|
||||
&& a.globalFindClipboard === b.globalFindClipboard
|
||||
&& a.addExtraSpaceOnTop === b.addExtraSpaceOnTop
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1360,7 +1399,19 @@ export class InternalEditorOptions {
|
||||
&& a.snippets === b.snippets
|
||||
&& a.snippetsPreventQuickSuggestions === b.snippetsPreventQuickSuggestions
|
||||
&& a.localityBonus === b.localityBonus
|
||||
&& a.shareSuggestSelections === b.shareSuggestSelections;
|
||||
&& a.shareSuggestSelections === b.shareSuggestSelections
|
||||
&& a.showIcons === b.showIcons
|
||||
&& a.maxVisibleSuggestions === b.maxVisibleSuggestions;
|
||||
}
|
||||
}
|
||||
|
||||
private static _equalsGotoLocationOptions(a: InternalGoToLocationOptions | undefined, b: InternalGoToLocationOptions | undefined): boolean {
|
||||
if (a === b) {
|
||||
return true;
|
||||
} else if (!a || !b) {
|
||||
return false;
|
||||
} else {
|
||||
return a.many === b.many;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1393,7 +1444,6 @@ export class InternalEditorOptions {
|
||||
&& InternalEditorOptions._equalsQuickSuggestions(a.quickSuggestions, b.quickSuggestions)
|
||||
&& a.quickSuggestionsDelay === b.quickSuggestionsDelay
|
||||
&& this._equalsParameterHintOptions(a.parameterHints, b.parameterHints)
|
||||
&& a.iconsInSuggestions === b.iconsInSuggestions
|
||||
&& a.formatOnType === b.formatOnType
|
||||
&& a.formatOnPaste === b.formatOnPaste
|
||||
&& a.suggestOnTriggerCharacters === b.suggestOnTriggerCharacters
|
||||
@@ -1405,6 +1455,7 @@ export class InternalEditorOptions {
|
||||
&& a.suggestLineHeight === b.suggestLineHeight
|
||||
&& a.tabCompletion === b.tabCompletion
|
||||
&& this._equalsSuggestOptions(a.suggest, b.suggest)
|
||||
&& InternalEditorOptions._equalsGotoLocationOptions(a.gotoLocation, b.gotoLocation)
|
||||
&& a.selectionHighlight === b.selectionHighlight
|
||||
&& a.occurrencesHighlight === b.occurrencesHighlight
|
||||
&& a.codeLens === b.codeLens
|
||||
@@ -1602,7 +1653,7 @@ export interface IEnvironmentalOptions {
|
||||
readonly emptySelectionClipboard: boolean;
|
||||
readonly pixelRatio: number;
|
||||
readonly tabFocusMode: boolean;
|
||||
readonly accessibilitySupport: platform.AccessibilitySupport;
|
||||
readonly accessibilitySupport: AccessibilitySupport;
|
||||
}
|
||||
|
||||
function _boolean<T>(value: any, defaultValue: T): boolean | T {
|
||||
@@ -1851,7 +1902,8 @@ export class EditorOptionsValidator {
|
||||
return {
|
||||
seedSearchStringFromSelection: _boolean(opts.seedSearchStringFromSelection, defaults.seedSearchStringFromSelection),
|
||||
autoFindInSelection: _boolean(opts.autoFindInSelection, defaults.autoFindInSelection),
|
||||
globalFindClipboard: _boolean(opts.globalFindClipboard, defaults.globalFindClipboard)
|
||||
globalFindClipboard: _boolean(opts.globalFindClipboard, defaults.globalFindClipboard),
|
||||
addExtraSpaceOnTop: _boolean(opts.addExtraSpaceOnTop, defaults.addExtraSpaceOnTop)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1892,7 +1944,17 @@ export class EditorOptionsValidator {
|
||||
snippets: _stringSet<'top' | 'bottom' | 'inline' | 'none'>(opts.snippetSuggestions, defaults.snippets, ['top', 'bottom', 'inline', 'none']),
|
||||
snippetsPreventQuickSuggestions: _boolean(suggestOpts.snippetsPreventQuickSuggestions, defaults.filterGraceful),
|
||||
localityBonus: _boolean(suggestOpts.localityBonus, defaults.localityBonus),
|
||||
shareSuggestSelections: _boolean(suggestOpts.shareSuggestSelections, defaults.shareSuggestSelections)
|
||||
shareSuggestSelections: _boolean(suggestOpts.shareSuggestSelections, defaults.shareSuggestSelections),
|
||||
showIcons: _boolean(suggestOpts.showIcons, defaults.showIcons),
|
||||
maxVisibleSuggestions: _clampedInt(suggestOpts.maxVisibleSuggestions, defaults.maxVisibleSuggestions, 1, 12),
|
||||
filteredTypes: isObject(suggestOpts.filteredTypes) ? suggestOpts.filteredTypes : Object.create(null)
|
||||
};
|
||||
}
|
||||
|
||||
private static _santizeGotoLocationOpts(opts: IEditorOptions, defaults: InternalGoToLocationOptions): InternalGoToLocationOptions {
|
||||
const gotoOpts = opts.gotoLocation || {};
|
||||
return {
|
||||
many: _stringSet<'peek' | 'revealAndPeek' | 'reveal'>(gotoOpts.many, defaults.many, ['peek', 'revealAndPeek', 'reveal'])
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1988,6 +2050,7 @@ export class EditorOptionsValidator {
|
||||
ariaLabel: _string(opts.ariaLabel, defaults.ariaLabel),
|
||||
renderLineNumbers: renderLineNumbers,
|
||||
renderCustomLineNumbers: renderCustomLineNumbers,
|
||||
renderFinalNewline: _boolean(opts.renderFinalNewline, defaults.renderFinalNewline),
|
||||
selectOnLineNumbers: _boolean(opts.selectOnLineNumbers, defaults.selectOnLineNumbers),
|
||||
glyphMargin: _boolean(opts.glyphMargin, defaults.glyphMargin),
|
||||
revealHorizontalRightPadding: _clampedInt(opts.revealHorizontalRightPadding, defaults.revealHorizontalRightPadding, 0, 1000),
|
||||
@@ -2036,7 +2099,6 @@ export class EditorOptionsValidator {
|
||||
quickSuggestions: quickSuggestions,
|
||||
quickSuggestionsDelay: _clampedInt(opts.quickSuggestionsDelay, defaults.quickSuggestionsDelay, Constants.MIN_SAFE_SMALL_INTEGER, Constants.MAX_SAFE_SMALL_INTEGER),
|
||||
parameterHints: this._sanitizeParameterHintOpts(opts.parameterHints, defaults.parameterHints),
|
||||
iconsInSuggestions: _boolean(opts.iconsInSuggestions, defaults.iconsInSuggestions),
|
||||
formatOnType: _boolean(opts.formatOnType, defaults.formatOnType),
|
||||
formatOnPaste: _boolean(opts.formatOnPaste, defaults.formatOnPaste),
|
||||
suggestOnTriggerCharacters: _boolean(opts.suggestOnTriggerCharacters, defaults.suggestOnTriggerCharacters),
|
||||
@@ -2048,6 +2110,7 @@ export class EditorOptionsValidator {
|
||||
suggestLineHeight: _clampedInt(opts.suggestLineHeight, defaults.suggestLineHeight, 0, 1000),
|
||||
tabCompletion: this._sanitizeTabCompletionOpts(opts.tabCompletion, defaults.tabCompletion),
|
||||
suggest: this._sanitizeSuggestOpts(opts, defaults.suggest),
|
||||
gotoLocation: this._santizeGotoLocationOpts(opts, defaults.gotoLocation),
|
||||
selectionHighlight: _boolean(opts.selectionHighlight, defaults.selectionHighlight),
|
||||
occurrencesHighlight: _boolean(opts.occurrencesHighlight, defaults.occurrencesHighlight),
|
||||
codeLens: _boolean(opts.codeLens, defaults.codeLens),
|
||||
@@ -2069,9 +2132,9 @@ export class EditorOptionsValidator {
|
||||
*/
|
||||
export class InternalEditorOptionsFactory {
|
||||
|
||||
private static _tweakValidatedOptions(opts: IValidatedEditorOptions, accessibilitySupport: platform.AccessibilitySupport): IValidatedEditorOptions {
|
||||
const accessibilityIsOn = (accessibilitySupport === platform.AccessibilitySupport.Enabled);
|
||||
const accessibilityIsOff = (accessibilitySupport === platform.AccessibilitySupport.Disabled);
|
||||
private static _tweakValidatedOptions(opts: IValidatedEditorOptions, accessibilitySupport: AccessibilitySupport): IValidatedEditorOptions {
|
||||
const accessibilityIsOn = (accessibilitySupport === AccessibilitySupport.Enabled);
|
||||
const accessibilityIsOff = (accessibilitySupport === AccessibilitySupport.Disabled);
|
||||
return {
|
||||
inDiffEditor: opts.inDiffEditor,
|
||||
wordSeparators: opts.wordSeparators,
|
||||
@@ -2108,6 +2171,7 @@ export class InternalEditorOptionsFactory {
|
||||
ariaLabel: (accessibilityIsOff ? nls.localize('accessibilityOffAriaLabel', "The editor is not accessible at this time. Press Alt+F1 for options.") : opts.viewInfo.ariaLabel),
|
||||
renderLineNumbers: opts.viewInfo.renderLineNumbers,
|
||||
renderCustomLineNumbers: opts.viewInfo.renderCustomLineNumbers,
|
||||
renderFinalNewline: opts.viewInfo.renderFinalNewline,
|
||||
selectOnLineNumbers: opts.viewInfo.selectOnLineNumbers,
|
||||
glyphMargin: opts.viewInfo.glyphMargin,
|
||||
revealHorizontalRightPadding: opts.viewInfo.revealHorizontalRightPadding,
|
||||
@@ -2149,7 +2213,6 @@ export class InternalEditorOptionsFactory {
|
||||
quickSuggestions: opts.contribInfo.quickSuggestions,
|
||||
quickSuggestionsDelay: opts.contribInfo.quickSuggestionsDelay,
|
||||
parameterHints: opts.contribInfo.parameterHints,
|
||||
iconsInSuggestions: opts.contribInfo.iconsInSuggestions,
|
||||
formatOnType: opts.contribInfo.formatOnType,
|
||||
formatOnPaste: opts.contribInfo.formatOnPaste,
|
||||
suggestOnTriggerCharacters: opts.contribInfo.suggestOnTriggerCharacters,
|
||||
@@ -2161,6 +2224,7 @@ export class InternalEditorOptionsFactory {
|
||||
suggestLineHeight: opts.contribInfo.suggestLineHeight,
|
||||
tabCompletion: opts.contribInfo.tabCompletion,
|
||||
suggest: opts.contribInfo.suggest,
|
||||
gotoLocation: opts.contribInfo.gotoLocation,
|
||||
selectionHighlight: (accessibilityIsOn ? false : opts.contribInfo.selectionHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
occurrencesHighlight: (accessibilityIsOn ? false : opts.contribInfo.occurrencesHighlight), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
codeLens: (accessibilityIsOn ? false : opts.contribInfo.codeLens), // DISABLED WHEN SCREEN READER IS ATTACHED
|
||||
@@ -2179,14 +2243,14 @@ export class InternalEditorOptionsFactory {
|
||||
|
||||
public static createInternalEditorOptions(env: IEnvironmentalOptions, _opts: IValidatedEditorOptions) {
|
||||
|
||||
let accessibilitySupport: platform.AccessibilitySupport;
|
||||
let accessibilitySupport: AccessibilitySupport;
|
||||
if (_opts.accessibilitySupport === 'auto') {
|
||||
// The editor reads the `accessibilitySupport` from the environment
|
||||
accessibilitySupport = env.accessibilitySupport;
|
||||
} else if (_opts.accessibilitySupport === 'on') {
|
||||
accessibilitySupport = platform.AccessibilitySupport.Enabled;
|
||||
accessibilitySupport = AccessibilitySupport.Enabled;
|
||||
} else {
|
||||
accessibilitySupport = platform.AccessibilitySupport.Disabled;
|
||||
accessibilitySupport = AccessibilitySupport.Disabled;
|
||||
}
|
||||
|
||||
// Disable some non critical features to get as best performance as possible
|
||||
@@ -2232,7 +2296,7 @@ export class InternalEditorOptionsFactory {
|
||||
const wordWrapColumn = opts.wordWrapColumn;
|
||||
const wordWrapMinified = opts.wordWrapMinified;
|
||||
|
||||
if (accessibilitySupport === platform.AccessibilitySupport.Enabled) {
|
||||
if (accessibilitySupport === AccessibilitySupport.Enabled) {
|
||||
// See https://github.com/Microsoft/vscode/issues/27766
|
||||
// Never enable wrapping when a screen reader is attached
|
||||
// because arrow down etc. will not move the cursor in the way
|
||||
@@ -2525,6 +2589,7 @@ export const EDITOR_FONT_DEFAULTS = {
|
||||
*/
|
||||
export const EDITOR_MODEL_DEFAULTS = {
|
||||
tabSize: 4,
|
||||
indentSize: 4,
|
||||
insertSpaces: true,
|
||||
detectIndentation: true,
|
||||
trimAutoWhitespace: true,
|
||||
@@ -2570,6 +2635,7 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"),
|
||||
renderLineNumbers: RenderLineNumbersType.On,
|
||||
renderCustomLineNumbers: null,
|
||||
renderFinalNewline: (platform.isLinux ? false : true),
|
||||
selectOnLineNumbers: true,
|
||||
glyphMargin: true,
|
||||
revealHorizontalRightPadding: 30,
|
||||
@@ -2633,7 +2699,6 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
enabled: true,
|
||||
cycle: false
|
||||
},
|
||||
iconsInSuggestions: true,
|
||||
formatOnType: false,
|
||||
formatOnPaste: false,
|
||||
suggestOnTriggerCharacters: true,
|
||||
@@ -2649,7 +2714,13 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
snippets: 'inline',
|
||||
snippetsPreventQuickSuggestions: true,
|
||||
localityBonus: false,
|
||||
shareSuggestSelections: false
|
||||
shareSuggestSelections: false,
|
||||
showIcons: true,
|
||||
maxVisibleSuggestions: 12,
|
||||
filteredTypes: Object.create(null)
|
||||
},
|
||||
gotoLocation: {
|
||||
many: 'peek'
|
||||
},
|
||||
selectionHighlight: true,
|
||||
occurrencesHighlight: true,
|
||||
@@ -2661,7 +2732,8 @@ export const EDITOR_DEFAULTS: IValidatedEditorOptions = {
|
||||
find: {
|
||||
seedSearchStringFromSelection: true,
|
||||
autoFindInSelection: false,
|
||||
globalFindClipboard: false
|
||||
globalFindClipboard: false,
|
||||
addExtraSpaceOnTop: true
|
||||
},
|
||||
colorDecorators: true,
|
||||
lightbulbEnabled: true,
|
||||
|
||||
Reference in New Issue
Block a user