@@ -834,7 +834,7 @@ export function cursorStyleToString(cursorStyle: TextEditorCursorStyle): string
834
834
}
835
835
}
836
836
837
- function _cursorStyleFromString ( cursorStyle : string , defaultValue : TextEditorCursorStyle ) : TextEditorCursorStyle {
837
+ function _cursorStyleFromString ( cursorStyle : string | undefined , defaultValue : TextEditorCursorStyle ) : TextEditorCursorStyle {
838
838
if ( typeof cursorStyle !== 'string' ) {
839
839
return defaultValue ;
840
840
}
@@ -930,7 +930,7 @@ export interface InternalEditorViewOptions {
930
930
readonly rulers : number [ ] ;
931
931
readonly ariaLabel : string ;
932
932
readonly renderLineNumbers : RenderLineNumbersType ;
933
- readonly renderCustomLineNumbers : ( lineNumber : number ) => string ;
933
+ readonly renderCustomLineNumbers : ( ( lineNumber : number ) => string ) | null ;
934
934
readonly selectOnLineNumbers : boolean ;
935
935
readonly glyphMargin : boolean ;
936
936
readonly revealHorizontalRightPadding : number ;
@@ -1597,7 +1597,7 @@ function _boolean<T>(value: any, defaultValue: T): boolean | T {
1597
1597
return Boolean ( value ) ;
1598
1598
}
1599
1599
1600
- function _booleanMap ( value : { [ key : string ] : boolean } , defaultValue : { [ key : string ] : boolean } ) : { [ key : string ] : boolean } {
1600
+ function _booleanMap ( value : { [ key : string ] : boolean } | undefined , defaultValue : { [ key : string ] : boolean } ) : { [ key : string ] : boolean } {
1601
1601
if ( ! value ) {
1602
1602
return defaultValue ;
1603
1603
}
@@ -1619,7 +1619,7 @@ function _string(value: any, defaultValue: string): string {
1619
1619
return value ;
1620
1620
}
1621
1621
1622
- function _stringSet < T > ( value : T , defaultValue : T , allowedValues : T [ ] ) : T {
1622
+ function _stringSet < T > ( value : T | undefined , defaultValue : T , allowedValues : T [ ] ) : T {
1623
1623
if ( typeof value !== 'string' ) {
1624
1624
return defaultValue ;
1625
1625
}
@@ -1652,7 +1652,7 @@ function _float(value: any, defaultValue: number): number {
1652
1652
return r ;
1653
1653
}
1654
1654
1655
- function _wrappingIndentFromString ( wrappingIndent : string , defaultValue : WrappingIndent ) : WrappingIndent {
1655
+ function _wrappingIndentFromString ( wrappingIndent : string | undefined , defaultValue : WrappingIndent ) : WrappingIndent {
1656
1656
if ( typeof wrappingIndent !== 'string' ) {
1657
1657
return defaultValue ;
1658
1658
}
@@ -1667,7 +1667,7 @@ function _wrappingIndentFromString(wrappingIndent: string, defaultValue: Wrappin
1667
1667
}
1668
1668
}
1669
1669
1670
- function _cursorBlinkingStyleFromString ( cursorBlinkingStyle : string , defaultValue : TextEditorCursorBlinkingStyle ) : TextEditorCursorBlinkingStyle {
1670
+ function _cursorBlinkingStyleFromString ( cursorBlinkingStyle : string | undefined , defaultValue : TextEditorCursorBlinkingStyle ) : TextEditorCursorBlinkingStyle {
1671
1671
if ( typeof cursorBlinkingStyle !== 'string' ) {
1672
1672
return defaultValue ;
1673
1673
}
@@ -1687,7 +1687,7 @@ function _cursorBlinkingStyleFromString(cursorBlinkingStyle: string, defaultValu
1687
1687
return TextEditorCursorBlinkingStyle . Blink ;
1688
1688
}
1689
1689
1690
- function _scrollbarVisibilityFromString ( visibility : string , defaultValue : ScrollbarVisibility ) : ScrollbarVisibility {
1690
+ function _scrollbarVisibilityFromString ( visibility : string | undefined , defaultValue : ScrollbarVisibility ) : ScrollbarVisibility {
1691
1691
if ( typeof visibility !== 'string' ) {
1692
1692
return defaultValue ;
1693
1693
}
@@ -1726,7 +1726,7 @@ export class EditorOptionsValidator {
1726
1726
const viewInfo = this . _sanitizeViewInfo ( opts , defaults . viewInfo ) ;
1727
1727
const contribInfo = this . _sanitizeContribInfo ( opts , defaults . contribInfo ) ;
1728
1728
1729
- let configuredMulticursorModifier : 'altKey' | 'metaKey' | 'ctrlKey' ;
1729
+ let configuredMulticursorModifier : 'altKey' | 'metaKey' | 'ctrlKey' | undefined = undefined ;
1730
1730
if ( typeof opts . multiCursorModifier === 'string' ) {
1731
1731
if ( opts . multiCursorModifier === 'ctrlCmd' ) {
1732
1732
configuredMulticursorModifier = platform . isMacintosh ? 'metaKey' : 'ctrlKey' ;
@@ -1783,7 +1783,7 @@ export class EditorOptionsValidator {
1783
1783
} ;
1784
1784
}
1785
1785
1786
- private static _sanitizeScrollbarOpts ( opts : IEditorScrollbarOptions , defaults : InternalEditorScrollbarOptions , mouseWheelScrollSensitivity : number ) : InternalEditorScrollbarOptions {
1786
+ private static _sanitizeScrollbarOpts ( opts : IEditorScrollbarOptions | undefined , defaults : InternalEditorScrollbarOptions , mouseWheelScrollSensitivity : number ) : InternalEditorScrollbarOptions {
1787
1787
if ( typeof opts !== 'object' ) {
1788
1788
return defaults ;
1789
1789
}
@@ -1810,7 +1810,7 @@ export class EditorOptionsValidator {
1810
1810
} ;
1811
1811
}
1812
1812
1813
- private static _sanitizeMinimapOpts ( opts : IEditorMinimapOptions , defaults : InternalEditorMinimapOptions ) : InternalEditorMinimapOptions {
1813
+ private static _sanitizeMinimapOpts ( opts : IEditorMinimapOptions | undefined , defaults : InternalEditorMinimapOptions ) : InternalEditorMinimapOptions {
1814
1814
if ( typeof opts !== 'object' ) {
1815
1815
return defaults ;
1816
1816
}
@@ -1823,7 +1823,7 @@ export class EditorOptionsValidator {
1823
1823
} ;
1824
1824
}
1825
1825
1826
- private static _santizeFindOpts ( opts : IEditorFindOptions , defaults : InternalEditorFindOptions ) : InternalEditorFindOptions {
1826
+ private static _santizeFindOpts ( opts : IEditorFindOptions | undefined , defaults : InternalEditorFindOptions ) : InternalEditorFindOptions {
1827
1827
if ( typeof opts !== 'object' ) {
1828
1828
return defaults ;
1829
1829
}
@@ -1835,7 +1835,7 @@ export class EditorOptionsValidator {
1835
1835
} ;
1836
1836
}
1837
1837
1838
- private static _sanitizeParameterHintOpts ( opts : IEditorParameterHintOptions , defaults : InternalParameterHintOptions ) : InternalParameterHintOptions {
1838
+ private static _sanitizeParameterHintOpts ( opts : IEditorParameterHintOptions | undefined , defaults : InternalParameterHintOptions ) : InternalParameterHintOptions {
1839
1839
if ( typeof opts !== 'object' ) {
1840
1840
return defaults ;
1841
1841
}
@@ -1846,7 +1846,7 @@ export class EditorOptionsValidator {
1846
1846
} ;
1847
1847
}
1848
1848
1849
- private static _santizeHoverOpts ( _opts : boolean | IEditorHoverOptions , defaults : InternalEditorHoverOptions ) : InternalEditorHoverOptions {
1849
+ private static _santizeHoverOpts ( _opts : boolean | IEditorHoverOptions | undefined , defaults : InternalEditorHoverOptions ) : InternalEditorHoverOptions {
1850
1850
let opts : IEditorHoverOptions ;
1851
1851
if ( typeof _opts === 'boolean' ) {
1852
1852
opts = {
@@ -1875,7 +1875,7 @@ export class EditorOptionsValidator {
1875
1875
} ;
1876
1876
}
1877
1877
1878
- private static _sanitizeTabCompletionOpts ( opts : boolean | 'on' | 'off' | 'onlySnippets' , defaults : 'on' | 'off' | 'onlySnippets' ) : 'on' | 'off' | 'onlySnippets' {
1878
+ private static _sanitizeTabCompletionOpts ( opts : boolean | 'on' | 'off' | 'onlySnippets' | undefined , defaults : 'on' | 'off' | 'onlySnippets' ) : 'on' | 'off' | 'onlySnippets' {
1879
1879
if ( opts === false ) {
1880
1880
return 'off' ;
1881
1881
} else if ( opts === true ) {
@@ -1896,7 +1896,7 @@ export class EditorOptionsValidator {
1896
1896
}
1897
1897
1898
1898
let renderLineNumbers : RenderLineNumbersType = defaults . renderLineNumbers ;
1899
- let renderCustomLineNumbers : ( lineNumber : number ) => string = defaults . renderCustomLineNumbers ;
1899
+ let renderCustomLineNumbers : ( ( lineNumber : number ) => string ) | null = defaults . renderCustomLineNumbers ;
1900
1900
1901
1901
if ( typeof opts . lineNumbers !== 'undefined' ) {
1902
1902
let lineNumbers = opts . lineNumbers ;
@@ -2198,7 +2198,7 @@ export class InternalEditorOptionsFactory {
2198
2198
pixelRatio : env . pixelRatio
2199
2199
} ) ;
2200
2200
2201
- let bareWrappingInfo : { isWordWrapMinified : boolean ; isViewportWrapping : boolean ; wrappingColumn : number ; } = null ;
2201
+ let bareWrappingInfo : { isWordWrapMinified : boolean ; isViewportWrapping : boolean ; wrappingColumn : number ; } | null = null ;
2202
2202
{
2203
2203
const wordWrap = opts . wordWrap ;
2204
2204
const wordWrapColumn = opts . wordWrapColumn ;
0 commit comments