File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
src/vs/workbench/contrib/userDataProfile/browser Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import { ThemeIcon } from 'vs/platform/theme/common/themeService';
27
27
import { ITextFileService } from 'vs/workbench/services/textfile/common/textfiles' ;
28
28
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs' ;
29
29
import { joinPath } from 'vs/base/common/resources' ;
30
+ import { Codicon } from 'vs/base/common/codicons' ;
30
31
31
32
export class UserDataProfilesWorkbenchContribution extends Disposable implements IWorkbenchContribution {
32
33
@@ -188,7 +189,17 @@ export class UserDataProfilesWorkbenchContribution extends Disposable implements
188
189
value : that . userDataProfileService . getShortName ( profile ) ,
189
190
title : localize ( 'change short name' , "Change Short Name..." ) ,
190
191
validateInput : async ( value : string ) => {
191
- if ( profile . shortName !== value && ! ThemeIcon . fromString ( value ) && charCount ( value ) > 2 ) {
192
+ if ( profile . shortName === value ) {
193
+ return undefined ;
194
+ }
195
+ const themeIcon = ThemeIcon . fromString ( value ) ;
196
+ if ( themeIcon ) {
197
+ if ( Codicon . getAll ( ) . some ( c => c . id === themeIcon . id ) ) {
198
+ return undefined ;
199
+ }
200
+ return localize ( 'invalid codicon' , "Invalid codicon. Please use a valid codicon id." ) ;
201
+ }
202
+ if ( charCount ( value ) > 2 ) {
192
203
return localize ( 'invalid short name' , "Short name should be at most 2 characters long." ) ;
193
204
}
194
205
return undefined ;
You can’t perform that action at this time.
0 commit comments