Skip to content

Commit 14dd693

Browse files
authored
Merge branch 'master' into movableViews
2 parents 2175d4c + 419360d commit 14dd693

46 files changed

Lines changed: 478 additions & 266 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

extensions/json-language-features/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,11 @@
111111
},
112112
"editor.suggest.insertMode": "replace"
113113
}
114-
}
114+
},
115+
"jsonValidation": [{
116+
"fileMatch": "*.schema.json",
117+
"url": "http://json-schema.org/draft-07/schema#"
118+
}]
115119
},
116120
"dependencies": {
117121
"request-light": "^0.2.5",

extensions/json/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,6 @@
6767
"scopeName": "source.json.comments",
6868
"path": "./syntaxes/JSONC.tmLanguage.json"
6969
}
70-
],
71-
"jsonValidation": [
72-
{
73-
"fileMatch": "*.schema.json",
74-
"url": "http://json-schema.org/draft-07/schema#"
75-
}
7670
]
7771
}
7872
}

src/vs/editor/common/config/editorOptions.ts

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -549,7 +549,7 @@ export interface IEditorOptions {
549549
* Controls whether to focus the inline editor in the peek widget by default.
550550
* Defaults to false.
551551
*/
552-
peekWidgetFocusInlineEditor?: boolean;
552+
peekWidgetDefaultFocus?: 'tree' | 'editor';
553553
}
554554

555555
export interface IEditorConstructionOptions extends IEditorOptions {
@@ -3160,7 +3160,7 @@ export const enum EditorOption {
31603160
overviewRulerBorder,
31613161
overviewRulerLanes,
31623162
parameterHints,
3163-
peekWidgetFocusInlineEditor,
3163+
peekWidgetDefaultFocus,
31643164
quickSuggestions,
31653165
quickSuggestionsDelay,
31663166
readOnly,
@@ -3539,9 +3539,17 @@ export const EditorOptions = {
35393539
3, 0, 3
35403540
)),
35413541
parameterHints: register(new EditorParameterHints()),
3542-
peekWidgetFocusInlineEditor: register(new EditorBooleanOption(
3543-
EditorOption.peekWidgetFocusInlineEditor, 'peekWidgetFocusInlineEditor', false,
3544-
{ description: nls.localize('peekWidgetFocusInlineEditor', "Controls whether to focus the inline editor in the peek widget by default.") }
3542+
peekWidgetDefaultFocus: register(new EditorStringEnumOption(
3543+
EditorOption.peekWidgetDefaultFocus, 'peekWidgetDefaultFocus',
3544+
'tree' as 'tree' | 'editor',
3545+
['tree', 'editor'] as const,
3546+
{
3547+
enumDescriptions: [
3548+
nls.localize('peekWidgetDefaultFocus.tree', "Focus the tree when openeing peek"),
3549+
nls.localize('peekWidgetDefaultFocus.editor', "Focus the editor when opening peek")
3550+
],
3551+
description: nls.localize('peekWidgetDefaultFocus', "Controls whether to focus the inline editor or the tree in the peek widget.")
3552+
}
35453553
)),
35463554
quickSuggestions: register(new EditorQuickSuggestions()),
35473555
quickSuggestionsDelay: register(new EditorIntOption(

src/vs/editor/common/modes/supports.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ export class ScopedLineTokens {
6262
return actualLineContent.substring(this.firstCharOffset, this._lastCharOffset);
6363
}
6464

65+
public getActualLineContentBefore(offset: number): string {
66+
const actualLineContent = this._actual.getLineContent();
67+
return actualLineContent.substring(0, this.firstCharOffset + offset);
68+
}
69+
6570
public getTokenCount(): number {
6671
return this._lastTokenIndex - this._firstTokenIndex;
6772
}

src/vs/editor/common/modes/supports/electricCharacter.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,27 @@ export class BracketElectricCharacterSupport {
4949
return null;
5050
}
5151

52-
let tokenIndex = context.findTokenIndexAtOffset(column - 1);
52+
const tokenIndex = context.findTokenIndexAtOffset(column - 1);
5353
if (ignoreBracketsInToken(context.getStandardTokenType(tokenIndex))) {
5454
return null;
5555
}
5656

57-
let reversedBracketRegex = this._richEditBrackets.reversedRegex;
58-
let text = context.getLineContent().substring(0, column - 1) + character;
57+
const reversedBracketRegex = this._richEditBrackets.reversedRegex;
58+
const text = context.getLineContent().substring(0, column - 1) + character;
5959

60-
let r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length);
60+
const r = BracketsUtils.findPrevBracketInRange(reversedBracketRegex, 1, text, 0, text.length);
6161
if (!r) {
6262
return null;
6363
}
6464

65-
let bracketText = text.substring(r.startColumn - 1, r.endColumn - 1);
66-
bracketText = bracketText.toLowerCase();
65+
const bracketText = text.substring(r.startColumn - 1, r.endColumn - 1).toLowerCase();
6766

68-
let isOpen = this._richEditBrackets.textIsOpenBracket[bracketText];
67+
const isOpen = this._richEditBrackets.textIsOpenBracket[bracketText];
6968
if (isOpen) {
7069
return null;
7170
}
7271

73-
let textBeforeBracket = text.substring(0, r.startColumn - 1);
72+
const textBeforeBracket = context.getActualLineContentBefore(r.startColumn - 1);
7473
if (!/^\s*$/.test(textBeforeBracket)) {
7574
// There is other text on the line before the bracket
7675
return null;

src/vs/editor/common/standalone/standaloneEnums.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export enum EditorOption {
230230
overviewRulerBorder = 62,
231231
overviewRulerLanes = 63,
232232
parameterHints = 64,
233-
peekWidgetFocusInlineEditor = 65,
233+
peekWidgetDefaultFocus = 65,
234234
quickSuggestions = 66,
235235
quickSuggestionsDelay = 67,
236236
readOnly = 68,

src/vs/editor/contrib/codelens/codelensController.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,13 @@ export class CodeLensContribution implements IEditorContribution {
8585
const fontInfo = options.get(EditorOption.fontInfo);
8686
const lineHeight = options.get(EditorOption.lineHeight);
8787

88-
const newStyle = `.monaco-editor .codelens-decoration.${this._styleClassName} { height: ${Math.round(lineHeight * 1.1)}px; line-height: ${lineHeight}px; font-size: ${Math.round(fontInfo.fontSize * 0.9)}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;}`;
88+
89+
const height = Math.round(lineHeight * 1.1);
90+
const fontSize = Math.round(fontInfo.fontSize * 0.9);
91+
const newStyle = `
92+
.monaco-editor .codelens-decoration.${this._styleClassName} { height: ${height}px; line-height: ${lineHeight}px; font-size: ${fontSize}px; padding-right: ${Math.round(fontInfo.fontSize * 0.45)}px;}
93+
.monaco-editor .codelens-decoration.${this._styleClassName} > a > .codicon { line-height: ${lineHeight}px; font-size: ${fontSize}px; }
94+
`;
8995
this._styleElement.innerHTML = newStyle;
9096
}
9197

src/vs/editor/contrib/codelens/codelensWidget.css

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@
2727
}
2828

2929
.monaco-editor .codelens-decoration .codicon {
30-
line-height: inherit;
31-
font-size: 110%;
32-
vertical-align: inherit;
30+
vertical-align: middle;
31+
color: currentColor !important;
3332
}
3433

3534
.monaco-editor .codelens-decoration > a:hover .codicon::before {

src/vs/editor/contrib/gotoSymbol/peek/referencesController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export abstract class ReferencesController implements IEditorContribution {
165165
let selection = this._model.nearestReference(uri, pos);
166166
if (selection) {
167167
return this._widget.setSelection(selection).then(() => {
168-
if (this._widget && this._editor.getOption(EditorOption.peekWidgetFocusInlineEditor)) {
168+
if (this._widget && this._editor.getOption(EditorOption.peekWidgetDefaultFocus) === 'editor') {
169169
this._widget.focusOnPreviewEditor();
170170
}
171171
});

src/vs/editor/contrib/rename/renameInputField.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
}
1010

1111
.monaco-editor .rename-box.preview {
12-
padding: 4px;
12+
padding: 3px 3px 0 3px;
1313
}
1414

1515
.monaco-editor .rename-box .rename-input {
16-
padding: 4px;
17-
width: calc(100% - 8px);
16+
padding: 3px;
17+
width: calc(100% - 6px);
1818
}
1919

2020
.monaco-editor .rename-box .rename-label {

0 commit comments

Comments
 (0)