@@ -31,6 +31,7 @@ import { SubstitutionCodeActionProvider } from './substitutionCodeActionProvider
3131import { UndefinedSubstitutionValidator } from './undefinedSubstitutionValidator' ;
3232import { substitutionCache , initializeSubstitutionsForWeb } from './substitutions' ;
3333import { VersionsCache } from './versionsCache' ;
34+ import { ValeUpdateChecker } from './valeUpdateChecker' ;
3435
3536import { outputChannel } from './logger' ;
3637import { performanceLogger } from './performanceLogger' ;
@@ -59,6 +60,12 @@ export function activate(context: vscode.ExtensionContext): void {
5960 outputChannel . appendLine ( `Failed to initialize substitutions for web: ${ err } ` ) ;
6061 } ) ;
6162
63+ // Check for Vale style guide updates (async, non-blocking)
64+ const valeUpdateChecker = ValeUpdateChecker . getInstance ( ) ;
65+ valeUpdateChecker . checkForUpdates ( ) . catch ( err => {
66+ outputChannel . appendLine ( `Failed to check for Vale updates: ${ err } ` ) ;
67+ } ) ;
68+
6269 // Apply color customizations programmatically
6370 applyColorCustomizations ( ) ;
6471
@@ -336,6 +343,31 @@ export function activate(context: vscode.ExtensionContext): void {
336343 } )
337344 ) ;
338345
346+ // Register command to manually check for Vale style guide updates
347+ context . subscriptions . push (
348+ vscode . commands . registerCommand ( 'elastic-docs-v3.checkValeUpdates' , async ( ) => {
349+ try {
350+ await vscode . window . withProgress ( {
351+ location : vscode . ProgressLocation . Notification ,
352+ title : "Checking for Vale style guide updates..." ,
353+ cancellable : false
354+ } , async ( ) => {
355+ await valeUpdateChecker . checkForUpdates ( ) ;
356+ } ) ;
357+ } catch ( error ) {
358+ vscode . window . showErrorMessage ( `Failed to check for Vale updates: ${ error } ` ) ;
359+ outputChannel . appendLine ( `Error checking for Vale updates: ${ error } ` ) ;
360+ }
361+ } )
362+ ) ;
363+
364+ // Register command to test Vale update notification (for development/testing)
365+ context . subscriptions . push (
366+ vscode . commands . registerCommand ( 'elastic-docs-v3.testValeUpdateNotification' , async ( ) => {
367+ await valeUpdateChecker . simulateUpdateNotification ( ) ;
368+ } )
369+ ) ;
370+
339371 // Periodically refresh versions cache (every hour)
340372 const refreshInterval = setInterval ( ( ) => {
341373 versionsCache . refreshIfNeeded ( ) . then ( ( ) => {
0 commit comments