@@ -10,7 +10,7 @@ import {
10
10
} from "vscode-languageserver" ;
11
11
import { TextDocument } from "vscode-languageserver-textdocument" ;
12
12
import { publish , publishAsync , subscribe } from "../pubsub.js" ;
13
- import { getSchemaDocument } from "./schema-documents.js" ;
13
+ import { allSchemaDocuments , getSchemaDocument } from "./schema-documents.js" ;
14
14
import { getDocumentSettings } from "./document-settings.js" ;
15
15
import picomatch from "picomatch" ;
16
16
@@ -62,7 +62,7 @@ export default {
62
62
const reporter = await connection . window . createWorkDoneProgress ( ) ;
63
63
reporter . begin ( "JSON Schema: Indexing workspace" ) ;
64
64
65
- // Re/validate all schemas
65
+ // Load all schemas
66
66
const settings = await getDocumentSettings ( connection ) ;
67
67
const schemaFilePatterns = settings . schemaFilePatterns ;
68
68
for await ( const uri of workspaceSchemas ( schemaFilePatterns ) ) {
@@ -72,7 +72,11 @@ export default {
72
72
textDocument = TextDocument . create ( uri , "json" , - 1 , instanceJson ) ;
73
73
}
74
74
75
- const schemaDocument = await getSchemaDocument ( connection , textDocument ) ;
75
+ await getSchemaDocument ( connection , textDocument ) ;
76
+ }
77
+
78
+ // Re/validate all schemas
79
+ for ( const schemaDocument of allSchemaDocuments ( ) ) {
76
80
validateSchema ( schemaDocument ) ;
77
81
}
78
82
0 commit comments