Code change:
private start(): void { this.textModelResolverService.registerTextModelContentProvider('vscode', { <del> provideTextContent: (uri: URI): Promise<ITextModel | null> | null => { </del> <ins> provideTextContent: async (uri: URI): Promise<ITextModel | null> => { </ins> if (uri.scheme !== 'vscode') { return null; } if (uri.authority === 'schemas') { <del> const schemaModel = this.getSchemaModel(uri); if (schemaModel) { return Promise.resolve(schemaModel); } </del> <ins> return this.getSchemaModel(uri); </ins> } <del> return Promise.resolve(this.preferencesService.resolveModel(uri)); </del> <ins> return this.preferencesService.resolveModel(uri); </ins> } }); } <del> private getSchemaModel(uri: URI): ITextModel | null { let schema = schemaRegistry.getSchemaContributions().schemas[uri.toString()]; if (schema) { const modelContent = JSON.stringify(schema); const languageSelection = this.languageService.createById('jsonc'); const model = this.modelService.createModel(modelContent, languageSelection, uri); const disposables = new DisposableStore(); disposables.add(schemaRegistry.onDidChangeSchema(schemaUri => { if (schemaUri === uri.toString()) { schema = schemaRegistry.getSchemaContributions().schemas[uri.toString()]; model.setValue(JSON.stringify(schema)); } })); disposables.add(model.onWillDispose(() => disposables.dispose())); return model; } return null; </del> <ins> private getSchemaModel(uri: URI): ITextModel { let schema = schemaRegistry.getSchemaContributions().schemas[uri.toString()] ?? {} /* Use empty schema if not yet registered */; const modelContent = JSON.stringify(schema); const languageSelection = this.languageService.createById('jsonc'); const model = this.modelService.createModel(modelContent, languageSelection, uri); const disposables = new DisposableStore(); disposables.add(schemaRegistry.onDidChangeSchema(schemaUri => { if (schemaUri === uri.toString()) { schema = schemaRegistry.getSchemaContributions().schemas[uri.toString()]; model.setValue(JSON.stringify(schema)); } })); disposables.add(model.onWillDispose(() => disposables.dispose())); return model; </ins> } dispose(): void {

Related discussion:
text: Linux version: Version: 1.80.0 Commit: Date: 2023-07-04T13:39:48.236Z (1 wk ago) Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.80.0 Chrome/108.0.5359.215 Electron/22.3.14 Safari/537.36 Windows version (stable): Version: 1.80.0 Commit: Date: 2023-07-04T15:06:02.407Z (1 wk ago) Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code/1.80.0 Chrome/108.0.5359.215 Electron/22.3.14 Safari/537.36 Windows version (insiders): Version: 1.81.0-insider Commit: Date: 2023-07-13T05:33:32.822Z (2 hrs ago) Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Code-Insiders/1.81.0-insider Chrome/108.0.5359.215 Electron/22.3.14 Safari/537.36
Reopening this because it can be still reproduced.
I am getting this error and I can't figure out how to fix it.
Please try our and see if you are still seeing it
Currently seeing this while in a file on GitHub Codespaces, in the following form:
Can you please try insiders and see if you are still seeing this?
I still saw this issue when opening on: Version: 1.80.1 (user setup) Commit: Date: 2023-07-12T17:22:07.651Z Electron: 22.3.14 ElectronBuildId: Chromium: 108.0.5359.215 16.17.1 V8: 10.8.168.25-electron.0 OS: Windows_NT x64 10.0.
As I mentioned, this was in GitHub Codespaces. I can't change the version of VS Code they serve to the browser.