@@ -49,19 +49,12 @@ export class PromotionProvider implements Disposable {
4949 this . triggerJavaVersionUpgrade ( javaVersion ) ;
5050 const pomPath = data . metaData ?. PomPath ;
5151 if ( pomPath ) {
52- this . diagnostics . set ( Uri . file ( pomPath ) , [
53- new Diagnostic (
54- // TODO: locate the actual version settings
55- new Range ( 0 , 0 , 0 , 0 ) ,
56- `Old Java version: ${ javaVersion } ` ,
57- DiagnosticSeverity . Warning
58- )
59- ] ) ;
52+ this . createWarningDiagnostics ( pomPath , `Old Java version: ${ javaVersion } ` ) ;
6053 }
6154 }
6255 }
6356
64- public checkDependencyVersion ( data : INodeData ) {
57+ public checkDependencyVersion ( data : INodeData , dependingPomPath : string | undefined ) {
6558 const versionString = data . metaData ?. [ "maven.version" ] ;
6659 const groupId = data . metaData ?. [ "maven.groupId" ] ;
6760 const supportedVersionDefinition = this . dependencyCheckMetadata [ groupId ] ;
@@ -74,9 +67,23 @@ export class PromotionProvider implements Disposable {
7467 }
7568 if ( ! semver . satisfies ( currentVersion , supportedVersionDefinition . supportedVersion ) ) {
7669 this . triggerFrameworkVersionUpgrade ( supportedVersionDefinition . name , versionString ) ;
70+ if ( dependingPomPath ) {
71+ this . createWarningDiagnostics ( dependingPomPath , `Deprecated ${ supportedVersionDefinition . name } version: ${ versionString } ` ) ;
72+ }
7773 }
7874 }
7975
76+ private createWarningDiagnostics ( filePath : string , message : string ) {
77+ this . diagnostics . set ( Uri . file ( filePath ) , [
78+ new Diagnostic (
79+ // TODO: locate the actual version settings
80+ new Range ( 0 , 0 , 0 , 0 ) ,
81+ message ,
82+ DiagnosticSeverity . Warning
83+ )
84+ ] ) ;
85+ }
86+
8087 private async refreshDependencyCheckMetadata ( ) : Promise < void > {
8188 const metadata = this . context . globalState . get ( METADATA_STORAGE_KEY ) as MementoItem < DependencyCheckMetadata > | undefined ;
8289 const nowTs = Number ( new Date ( ) ) / 1000 ;
0 commit comments