@@ -471,15 +471,15 @@ function realActivation(): void {
471471// Register a protocol handler to serve localized versions of the schema for c_cpp_properties.json
472472class SchemaProvider implements vscode . TextDocumentContentProvider {
473473public async provideTextDocumentContent ( uri :vscode . Uri ) :Promise < string > {
474- let fileName :string = uri . fsPath ;
474+ console . assert ( uri . path [ 0 ] === '/' , "A preceeding slash is expected on schema uri path" ) ;
475+ let fileName :string = uri . path . substr ( 1 ) ;
475476let locale :string = util . getLocaleId ( ) ;
476477let localizedFilePath :string = util . getExtensionFilePath ( path . join ( "dist/schema/" , locale , fileName ) ) ;
477- return util . checkFileExists ( localizedFilePath ) . then ( ( fileExists ) => {
478- if ( ! fileExists ) {
479- localizedFilePath = util . getExtensionFilePath ( fileName ) ;
480- }
481- return util . readFileText ( localizedFilePath ) ;
482- } ) ;
478+ const fileExists :boolean = await util . checkFileExists ( localizedFilePath ) ;
479+ if ( ! fileExists ) {
480+ localizedFilePath = util . getExtensionFilePath ( fileName ) ;
481+ }
482+ return util . readFileText ( localizedFilePath ) ;
483483}
484484}
485485