@@ -10,7 +10,10 @@ import { IContextMenuService } from '../../../../../platform/contextview/browser
1010import { TestInstantiationService } from '../../../../../platform/instantiation/test/common/instantiationServiceMock.js' ;
1111import { IExtensionService } from '../../../../services/extensions/common/extensions.js' ;
1212import { SimpleSettingRenderer } from '../../../markdown/browser/markdownSettingRenderer.js' ;
13+ import { IPreferencesService } from '../../../../services/preferences/common/preferences.js' ;
1314import { renderReleaseNotesMarkdown } from '../../browser/releaseNotesEditor.js' ;
15+ import { URI } from '../../../../../base/common/uri.js' ;
16+ import { Emitter } from '../../../../../base/common/event.js' ;
1417
1518
1619suite ( 'Release notes renderer' , ( ) => {
@@ -55,4 +58,48 @@ Navigation End -->
5558 const result = await renderReleaseNotesMarkdown ( content , extensionService , languageService , instantiationService . createInstance ( SimpleSettingRenderer ) ) ;
5659 await assertSnapshot ( result . toString ( ) ) ;
5760 } ) ;
61+
62+ test ( 'Should render code settings' , async ( ) => {
63+ // Stub preferences service with a known setting so the SimpleSettingRenderer treats it as valid
64+ const testSettingId = 'editor.wordWrap' ;
65+ instantiationService . stub ( IPreferencesService , < Partial < IPreferencesService > > {
66+ _serviceBrand : undefined ,
67+ onDidDefaultSettingsContentChanged : new Emitter < URI > ( ) . event ,
68+ userSettingsResource : undefined as any ,
69+ workspaceSettingsResource : null ,
70+ getFolderSettingsResource : ( ) => null ,
71+ createPreferencesEditorModel : async ( ) => null ,
72+ getDefaultSettingsContent : ( ) => undefined ,
73+ hasDefaultSettingsContent : ( ) => false ,
74+ createSettings2EditorModel : ( ) => { throw new Error ( 'not needed' ) ; } ,
75+ openPreferences : async ( ) => undefined ,
76+ openRawDefaultSettings : async ( ) => undefined ,
77+ openSettings : async ( ) => undefined ,
78+ openApplicationSettings : async ( ) => undefined ,
79+ openUserSettings : async ( ) => undefined ,
80+ openRemoteSettings : async ( ) => undefined ,
81+ openWorkspaceSettings : async ( ) => undefined ,
82+ openFolderSettings : async ( ) => undefined ,
83+ openGlobalKeybindingSettings : async ( ) => undefined ,
84+ openDefaultKeybindingsFile : async ( ) => undefined ,
85+ openLanguageSpecificSettings : async ( ) => undefined ,
86+ getEditableSettingsURI : async ( ) => null ,
87+ getSetting : ( id : string ) => {
88+ if ( id === testSettingId ) {
89+ // Provide the minimal fields accessed by SimpleSettingRenderer
90+ return < any > {
91+ key : testSettingId ,
92+ value : 'off' ,
93+ type : 'string'
94+ } ;
95+ }
96+ return undefined ;
97+ } ,
98+ createSplitJsonEditorInput : ( ) => { throw new Error ( 'not needed' ) ; }
99+ } ) ;
100+
101+ const content = `Here is a setting: \`setting(${ testSettingId } :on)\` and another \`setting(${ testSettingId } :off)\`` ;
102+ const result = await renderReleaseNotesMarkdown ( content , extensionService , languageService , instantiationService . createInstance ( SimpleSettingRenderer ) ) ;
103+ await assertSnapshot ( result . toString ( ) ) ;
104+ } ) ;
58105} ) ;
0 commit comments