Skip to content

Commit 46043d4

Browse files
committed
continue to suppor legacy parameter hints config, microsoft#81256
1 parent ddcdb9d commit 46043d4

1 file changed

Lines changed: 17 additions & 6 deletions

File tree

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,14 +1871,25 @@ class EditorParameterHints extends BaseEditorOption<EditorOption.parameterHints,
18711871
}
18721872

18731873
public validate(_input: any): InternalParameterHintOptions {
1874-
if (typeof _input !== 'object') {
1874+
if (typeof _input === 'boolean') {
1875+
// legacy
1876+
return {
1877+
enabled: _input,
1878+
cycle: this.defaultValue.cycle
1879+
};
1880+
1881+
} else if (typeof _input !== 'object') {
1882+
// invalid
18751883
return this.defaultValue;
1884+
1885+
} else {
1886+
//
1887+
const input = _input as IEditorParameterHintOptions;
1888+
return {
1889+
enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled),
1890+
cycle: EditorBooleanOption.boolean(input.cycle, this.defaultValue.cycle)
1891+
};
18761892
}
1877-
const input = _input as IEditorParameterHintOptions;
1878-
return {
1879-
enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled),
1880-
cycle: EditorBooleanOption.boolean(input.cycle, this.defaultValue.cycle)
1881-
};
18821893
}
18831894
}
18841895

0 commit comments

Comments
 (0)