Skip to content

Commit

Permalink
[monaco] Align editor configurations
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Nikitenko <rnikiten@redhat.com>
  • Loading branch information
RomanNikitenko committed Jul 20, 2020
1 parent e1ba08d commit fd9f111
Showing 1 changed file with 53 additions and 7 deletions.
60 changes: 53 additions & 7 deletions packages/editor/src/browser/editor-preferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const platform = {
isLinux: OS.type() === OS.Type.Linux
};

// should be in sync with https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/editor/common/config/editorOptions.ts#L2974
// should be in sync with https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/editor/common/config/editorOptions.ts#L3042
export const EDITOR_FONT_DEFAULTS = {
fontFamily: (
isOSX ? DEFAULT_MAC_FONT_FAMILY : (isWindows ? DEFAULT_WINDOWS_FONT_FAMILY : DEFAULT_LINUX_FONT_FAMILY)
Expand All @@ -49,7 +49,7 @@ export const EDITOR_FONT_DEFAULTS = {
letterSpacing: 0,
};

// should be in sync with https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/editor/common/config/editorOptions.ts#L2989
// should be in sync with https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/editor/common/config/editorOptions.ts#L3057
export const EDITOR_MODEL_DEFAULTS = {
tabSize: 4,
indentSize: 4,
Expand All @@ -63,11 +63,11 @@ export const EDITOR_MODEL_DEFAULTS = {

/* eslint-disable max-len */
// should be in sync with:
// 1. https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/editor/common/config/commonEditorConfig.ts#L442
// 2. https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/editor/common/config/commonEditorConfig.ts#L526
// 1. https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/editor/common/config/commonEditorConfig.ts#L441
// 2. https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/editor/common/config/commonEditorConfig.ts#L530

// 1. Copy from https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/editor/common/config/commonEditorConfig.ts#L526
// 2. Align first items with https://github.com/theia-ide/vscode/blob/standalone/0.19.x/src/vs/editor/common/config/commonEditorConfig.ts#L442
// 1. Copy from https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/editor/common/config/commonEditorConfig.ts#L530
// 2. Align first items with https://github.com/theia-ide/vscode/blob/standalone/0.20.x/src/vs/editor/common/config/commonEditorConfig.ts#L441
// 3. Find -> Use Regular Expressions to clean up data and replace " by ', for example -> nls\.localize\(.*, "(.*)"\) -> "$1"
// 4. Apply `quotemark` quick fixes
// 5. Fix the rest manually
Expand Down Expand Up @@ -103,6 +103,11 @@ const codeEditorPreferenceProperties = {
'default': true,
'description': 'Controls whether completions should be computed based on words in the document.'
},
'editor.semanticHighlighting.enabled': {
'type': 'boolean',
'default': false,
'description': 'Controls whether the semanticHighlighting is shown for the languages that support it.'
},
'editor.stablePeek': {
'type': 'boolean',
'default': false,
Expand Down Expand Up @@ -270,6 +275,11 @@ const codeEditorPreferenceProperties = {
'type': 'boolean',
'default': true
},
'editor.comments.insertSpace': {
'type': 'boolean',
'default': true,
'description': 'Controls whether a space character is inserted when commenting.'
},
'editor.copyWithSyntaxHighlighting': {
'description': 'Controls whether syntax highlighting should be copied into the clipboard.',
'type': 'boolean',
Expand Down Expand Up @@ -392,6 +402,11 @@ const codeEditorPreferenceProperties = {
],
'default': 'auto'
},
'editor.foldingHighlight': {
'description': 'Controls whether the editor should highlight folded ranges.',
'type': 'boolean',
'default': true
},
'editor.fontFamily': {
'description': 'Controls the font family.',
'type': 'string',
Expand Down Expand Up @@ -731,6 +746,19 @@ const codeEditorPreferenceProperties = {
'default': false,
'description': 'Controls whether the parameter hints menu cycles or closes when reaching the end of the list.'
},
'editor.peekWidgetDefaultFocus': {
'enumDescriptions': [
'Focus the tree when opening peek',
'Focus the editor when opening peek'
],
'description': 'Controls whether to focus the inline editor or the tree in the peek widget.',
'type': 'string',
'enum': [
'tree',
'editor'
],
'default': 'tree'
},
'editor.quickSuggestions': {
'anyOf': [
{
Expand Down Expand Up @@ -928,7 +956,7 @@ const codeEditorPreferenceProperties = {
'editor.suggest.snippetsPreventQuickSuggestions': {
'type': 'boolean',
'default': true,
'description': 'Control whether an active snippet prevents quick suggestions.'
'description': 'Controls whether an active snippet prevents quick suggestions.'
},
'editor.suggest.showIcons': {
'type': 'boolean',
Expand Down Expand Up @@ -1077,6 +1105,11 @@ const codeEditorPreferenceProperties = {
'default': true,
'markdownDescription': 'When enabled IntelliSense shows `snippet`-suggestions.'
},
'editor.suggest.hideStatusBar': {
'type': 'boolean',
'default': true,
'markdownDescription': 'Controls the visibility of the status bar at the bottom of the suggest widget.'
},
'editor.suggestFontSize': {
'markdownDescription': 'Font size for the suggest widget. When set to `0`, the value of `#editor.fontSize#` is used.',
'type': 'integer',
Expand Down Expand Up @@ -1176,6 +1209,19 @@ const codeEditorPreferenceProperties = {
'deepIndent'
],
'default': 'same'
},
'editor.wrappingStrategy': {
'enumDescriptions': [
'Assumes that all characters are of the same width. This is a fast algorithm that works correctly for monospace fonts and certain scripts (like Latin characters) where glyphs are of equal width.',
'Delegates wrapping points computation to the browser. This is a slow algorithm, that might cause freezes for large files, but it works correctly in all cases.'
],
'description': 'Controls the algorithm that computes wrapping points.',
'type': 'string',
'enum': [
'simple',
'advanced'
],
'default': 'simple'
}
};
/* eslint-enable max-len */
Expand Down

0 comments on commit fd9f111

Please sign in to comment.