@@ -212,6 +212,10 @@ export interface TSUserConfig {
212212 workspaceSymbols ?: TsWorkspaceSymbolsConfig ;
213213}
214214
215+ interface TsJsSharedConfig {
216+ hover ?: { maximumLength ?: number } ;
217+ }
218+
215219/**
216220 * A subset of the JS/TS VS Code settings which
217221 * are transformed to ts.UserPreferences.
@@ -291,6 +295,12 @@ export interface TsWorkspaceSymbolsConfig {
291295
292296export type TsUserConfigLang = 'typescript' | 'javascript' ;
293297
298+ interface TsUserConfigLangMap {
299+ typescript ?: TSUserConfig ;
300+ javascript ?: TSUserConfig ;
301+ 'js/ts' ?: TsJsSharedConfig ;
302+ }
303+
294304/**
295305 * The config as the vscode-css-languageservice understands it
296306 */
@@ -434,10 +444,11 @@ export class LSConfigManager {
434444 ) ;
435445 }
436446
437- updateTsJsUserPreferences ( config : Record < TsUserConfigLang , TSUserConfig > ) : void {
447+ updateTsJsUserPreferences ( config : TsUserConfigLangMap ) : void {
448+ const shared = config [ 'js/ts' ] ;
438449 ( [ 'typescript' , 'javascript' ] as const ) . forEach ( ( lang ) => {
439450 if ( config [ lang ] ) {
440- this . _updateTsUserPreferences ( lang , config [ lang ] ) ;
451+ this . _updateTsUserPreferences ( lang , config [ lang ] , shared ) ;
441452 this . rawTsUserConfig [ lang ] = config [ lang ] ;
442453 }
443454 } ) ;
@@ -458,7 +469,11 @@ export class LSConfigManager {
458469 this . notifyListeners ( ) ;
459470 }
460471
461- private _updateTsUserPreferences ( lang : TsUserConfigLang , config : TSUserConfig ) {
472+ private _updateTsUserPreferences (
473+ lang : TsUserConfigLang ,
474+ config : TSUserConfig ,
475+ shared ?: TsJsSharedConfig
476+ ) {
462477 const { inlayHints } = config ;
463478
464479 this . tsUserPreferences [ lang ] = {
@@ -482,6 +497,7 @@ export class LSConfigManager {
482497 includeCompletionsWithObjectLiteralMethodSnippets :
483498 config . suggest ?. objectLiteralMethodSnippets ?. enabled ?? true ,
484499 preferTypeOnlyAutoImports : config . preferences ?. preferTypeOnlyAutoImports ,
500+ maximumHoverLength : shared ?. hover ?. maximumLength ,
485501
486502 // Although we don't support incompletion cache.
487503 // But this will make ts resolve the module specifier more aggressively
@@ -618,7 +634,7 @@ export class LSConfigManager {
618634 return this . htmlConfig ;
619635 }
620636
621- updateTsJsFormateConfig ( config : Record < TsUserConfigLang , TSUserConfig > ) : void {
637+ updateTsJsFormateConfig ( config : TsUserConfigLangMap ) : void {
622638 ( [ 'typescript' , 'javascript' ] as const ) . forEach ( ( lang ) => {
623639 if ( config [ lang ] ) {
624640 this . _updateTsFormatConfig ( lang , config [ lang ] ) ;
0 commit comments