@@ -12,14 +12,16 @@ export default {
12
12
13
13
onInitialized ( ) {
14
14
subscribe ( "diagnostics" , async ( _message , { schemaDocument, diagnostics } ) => {
15
- for ( const deprecated of schemaDocument . annotatedWith ( "deprecated" , annotationDialectUri ) ) {
16
- if ( JsonNode . annotation ( deprecated , "deprecated" , annotationDialectUri ) . some ( ( deprecated ) => deprecated ) ) {
17
- diagnostics . push ( {
18
- instance : deprecated . parent ,
19
- message : JsonNode . annotation ( deprecated , "x-deprecationMessage" , annotationDialectUri ) . join ( "\n" ) || "deprecated" ,
20
- severity : DiagnosticSeverity . Warning ,
21
- tags : [ DiagnosticTag . Deprecated ]
22
- } ) ;
15
+ for ( const { schemaResource } of schemaDocument . schemaResources ) {
16
+ for ( const deprecated of JsonNode . annotatedWith ( schemaResource , "deprecated" , annotationDialectUri ) ) {
17
+ if ( JsonNode . annotation ( deprecated , "deprecated" , annotationDialectUri ) . some ( ( deprecated ) => deprecated ) ) {
18
+ diagnostics . push ( {
19
+ instance : deprecated . parent ,
20
+ message : JsonNode . annotation ( deprecated , "x-deprecationMessage" , annotationDialectUri ) . join ( "\n" ) || "deprecated" ,
21
+ severity : DiagnosticSeverity . Warning ,
22
+ tags : [ DiagnosticTag . Deprecated ]
23
+ } ) ;
24
+ }
23
25
}
24
26
}
25
27
} ) ;
0 commit comments