Change:
} }; <del> const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[] | undefined, folderUri: Uri | undefined = undefined, settingsLocation = folderUri) => { </del> <ins> /* * Add schemas from the settings * folderUri to which folder the setting is scoped to. `undefined` means global (also external files) * settingsLocation against which path relative schema URLs are resolved */ const collectSchemaSettings = (schemaSettings: JSONSchemaSettings[] | undefined, folderUri: string | undefined, settingsLocation: Uri | undefined) => { </ins> if (schemaSettings) { for (const setting of schemaSettings) { const url = getSchemaId(setting, settingsLocation); if (url) { <del> const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri: folderUri?.toString(false), schema: setting.schema }; </del> <ins> const schemaSetting: JSONSchemaSettings = { url, fileMatch: setting.fileMatch, folderUri, schema: setting.schema }; </ins> schemas.push(schemaSetting); } } } }; <del> const folders = workspace.workspaceFolders; </del> <ins> const folders = workspace.workspaceFolders ?? []; </ins> const schemaConfigInfo = workspace.getConfiguration('json', null).inspect<JSONSchemaSettings[]>('schemas'); if (schemaConfigInfo) { <del> if (schemaConfigInfo.workspaceValue && workspace.workspaceFile && folders && folders.length) { const settingsLocation = Uri.joinPath(workspace.workspaceFile, '..'); </del> <ins> // settings in user config collectSchemaSettings(schemaConfigInfo.globalValue, undefined, undefined); if (workspace.workspaceFile) { if (schemaConfigInfo.workspaceValue) { const settingsLocation = Uri.joinPath(workspace.workspaceFile, '..'); // settings in the workspace configuration file apply to all files (also external files) collectSchemaSettings(schemaConfigInfo.workspaceValue, undefined, settingsLocation); } </ins> for (const folder of folders) { <del> collectSchemaSettings(schemaConfigInfo.workspaceValue, folder.uri, settingsLocation); </del> <ins> const folderUri = folder.uri; const folderSchemaConfigInfo = workspace.getConfiguration('json', folderUri).inspect<JSONSchemaSettings[]>('schemas'); collectSchemaSettings(folderSchemaConfigInfo?.workspaceFolderValue, folderUri.toString(false), folderUri); } } else { if (schemaConfigInfo.workspaceValue && folders.length === 1) { // single folder workspace: settings apply to all files (also external files) collectSchemaSettings(schemaConfigInfo.workspaceValue, undefined, folders[0].uri); </ins> } <del> } collectSchemaSettings(schemaConfigInfo.globalValue); } if (folders) { for (const folder of folders) { const schemaConfigInfo = workspace.getConfiguration('json', folder.uri).inspect<JSONSchemaSettings[]>('schemas'); collectSchemaSettings(schemaConfigInfo?.workspaceFolderValue, folder.uri); </del> } } return settings;

Discussion:
I have a workspace open with the correct JSON schemas configuration in the workspace's , but the JSON file in question is outside of this workspace, even though it's open in the workspace's window and matches (or at least used to). So, the workspace's settings must have applied to such files before, but not any more. Is this scenario still supported in some other way? Originally posted by in
To verify: clone open folder look at the workspace settings: all files are associated with schema . Note that this is a relative path to the workspace file open files in the folder check that code completion gives back property . You can also click on the JSON language selector ( next to JSON in the status bar) to see the schema that is associated open external and check that code completion also gives back property To verify that the issue did not break open workspace look at the workspace settings: all files are associated with schema . Note that this is a relative path to the workspace file open all files , and (external file) and check that code completion gives back property . open both files files and check that code completion gives back property , but only when in folder1.
Fixed by