File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed
Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export class CfnExternal implements Configurables, Closeable {
6363 overrides . guardService ??
6464 new GuardService ( core . documentManager , core . diagnosticCoordinator , core . syntaxTreeManager ) ;
6565
66- this . onlineStatus = overrides . onlineStatus ?? new OnlineStatus ( core . clientMessage ) ;
66+ this . onlineStatus = overrides . onlineStatus ?? new OnlineStatus ( ) ;
6767 this . featureFlags = overrides . featureFlags ?? new FeatureFlagProvider ( getFromGitHub ) ;
6868 this . onlineFeatureGuard = overrides . onlineFeatureGuard ?? new OnlineFeatureGuard ( core . awsCredentials ) ;
6969 }
Original file line number Diff line number Diff line change 11import { lookup } from 'node:dns/promises' ;
2- import { MessageType } from 'vscode-languageserver-protocol' ;
3- import { ClientMessage } from '../telemetry/ClientMessage' ;
2+ import { LoggerFactory } from '../telemetry/LoggerFactory' ;
43import { Closeable } from '../utils/Closeable' ;
54
5+ const logger = LoggerFactory . getLogger ( 'OnlineStatus' ) ;
6+
67export class OnlineStatus implements Closeable {
78 private _isOnline : boolean = false ;
89 private notifiedOnce : boolean = false ;
910 private readonly timeout : NodeJS . Timeout ;
1011
11- constructor ( private readonly clientMessage : ClientMessage ) {
12+ constructor ( ) {
1213 void this . hasInternet ( ) ;
1314
1415 this . timeout = setInterval (
@@ -26,21 +27,14 @@ export class OnlineStatus implements Closeable {
2627 } catch {
2728 this . _isOnline = false ;
2829 } finally {
29- await this . notify ( ) ;
30+ this . notify ( ) ;
3031 }
3132 }
3233
33- private async notify ( ) {
34+ private notify ( ) {
3435 if ( ! this . notifiedOnce && ! this . _isOnline ) {
35- try {
36- await this . clientMessage . showMessageNotification (
37- MessageType . Warning ,
38- 'Internet connection lost. Some AWS CloudFormation features may not work properly.' ,
39- ) ;
40- this . notifiedOnce = true ;
41- } catch {
42- // Nothing to do here
43- }
36+ logger . warn ( 'Internet connection lost. Some AWS CloudFormation features may not work properly.' ) ;
37+ this . notifiedOnce = true ;
4438 }
4539 }
4640
You can’t perform that action at this time.
0 commit comments