File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -72,22 +72,22 @@ export function getNlsConfiguration(_document: Document, base: string) {
72
72
73
73
type LoadBundleCallback = ( _ : undefined , result ?: string ) => void
74
74
75
- nlsConfig . loadBundle = ( bundle : string , _language : string , cb : LoadBundleCallback ) : void => {
75
+ nlsConfig . loadBundle = async ( bundle : string , _language : string , cb : LoadBundleCallback ) : Promise < void > => {
76
76
// TODO@jsjoeio write tests for here to END
77
77
const result = bundles [ bundle ]
78
78
if ( result ) {
79
79
return cb ( undefined , result )
80
80
}
81
81
// FIXME: Only works if path separators are /.
82
- const path = createBundlePath ( nlsConfig . _resolvedLanguagePackCoreLocation || "" , bundle )
83
- fetch ( ` ${ base } /vscode/resource/? path= ${ encodeURIComponent ( path ) } ` )
84
- . then ( ( response ) => response . json ( ) )
85
- . then ( ( json ) => {
86
- bundles [ bundle ] = json
87
- cb ( undefined , json )
88
- // END here
89
- } )
90
- . catch ( cb )
82
+ try {
83
+ const path = createBundlePath ( nlsConfig . _resolvedLanguagePackCoreLocation || "" , bundle )
84
+ const response = await fetch ( ` ${ base } /vscode/resource/?path= ${ encodeURIComponent ( path ) } ` )
85
+ const json = await response . json ( )
86
+ bundles [ bundle ] = json
87
+ return cb ( undefined , json )
88
+ } catch ( error ) {
89
+ return cb ( error )
90
+ }
91
91
}
92
92
}
93
93
You can’t perform that action at this time.
0 commit comments