This commit is contained in:
Alex Dima 2020-07-21 10:46:15 +02:00
parent 3d0d50caf8
commit a5aa8f5456
No known key found for this signature in database
GPG key ID: 6E58D7B045760DA0
4 changed files with 18 additions and 7 deletions

View file

@ -381,7 +381,7 @@ export abstract class CommonEditorConfiguration extends Disposable implements IC
}
continue;
}
if (typeof baseValue === 'object' && typeof subsetValue === 'object') {
if (baseValue && typeof baseValue === 'object' && subsetValue && typeof subsetValue === 'object') {
if (!this._subsetEquals(baseValue, subsetValue)) {
return false;
}

View file

@ -2572,9 +2572,9 @@ class EditorPixelRatio extends ComputedEditorOption<EditorOption.pixelRatio, num
* Configuration options for quick suggestions
*/
export interface IQuickSuggestionsOptions {
other: boolean;
comments: boolean;
strings: boolean;
other?: boolean;
comments?: boolean;
strings?: boolean;
}
export type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;

View file

@ -211,4 +211,15 @@ suite('Common Editor Config', () => {
strings: false
});
});
test('issue #102920: Can\'t snap or split view with JSON files', () => {
const config = new TestConfiguration({ quickSuggestions: null! });
config.updateOptions({ quickSuggestions: { strings: true } });
const actual = <Readonly<Required<IQuickSuggestionsOptions>>>config.options.get(EditorOption.quickSuggestions);
assert.deepEqual(actual, {
other: true,
comments: false,
strings: true
});
});
});

6
src/vs/monaco.d.ts vendored
View file

@ -3557,9 +3557,9 @@ declare namespace monaco.editor {
* Configuration options for quick suggestions
*/
export interface IQuickSuggestionsOptions {
other: boolean;
comments: boolean;
strings: boolean;
other?: boolean;
comments?: boolean;
strings?: boolean;
}
export type ValidQuickSuggestionsOptions = boolean | Readonly<Required<IQuickSuggestionsOptions>>;