1- import { arch , platform } from 'os' ;
1+ import { arch , machine , platform , release , type } from 'os' ;
22import { createConnection , ProposedFeatures } from 'vscode-languageserver/node' ;
33import { InitializedParams } from 'vscode-languageserver-protocol' ;
44import { LspCapabilities } from '../protocol/LspCapabilities' ;
@@ -11,7 +11,7 @@ import { ExtensionName } from '../utils/ExtensionConfig';
1111
1212let server : unknown ;
1313
14- /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */
14+ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access, no-console */
1515async function onInitialize ( params : ExtendedInitializeParams ) {
1616 const ClientInfo = params . clientInfo ;
1717 const AwsMetadata = params . initializationOptions ?. [ 'aws' ] ;
@@ -32,7 +32,7 @@ async function onInitialize(params: ExtendedInitializeParams) {
3232 `${ ExtensionName } initializing...` ,
3333 ) ;
3434 getLogger ( ) . info ( {
35- Machine : `${ platform ( ) } -${ arch ( ) } ` ,
35+ Machine : `${ type ( ) } - ${ platform ( ) } -${ arch ( ) } - ${ machine ( ) } - ${ release ( ) } ` ,
3636 Process : `${ process . platform } -${ process . arch } ` ,
3737 Runtime : `node=${ process . versions . node } v8=${ process . versions . v8 } uv=${ process . versions . uv } modules=${ process . versions . modules } ` ,
3838 } ) ;
@@ -53,12 +53,12 @@ function onInitialized(params: InitializedParams) {
5353}
5454
5555function onShutdown ( ) {
56- getLogger ( ) . info ( `${ ExtensionName } shutting down...` ) ;
56+ console . info ( `${ ExtensionName } shutting down...` ) ;
5757 return ( server as any ) . close ( ) ;
5858}
5959
6060function onExit ( ) {
61- getLogger ( ) . info ( `${ ExtensionName } exiting` ) ;
61+ console . info ( `${ ExtensionName } exiting` ) ;
6262}
6363
6464const lsp = new LspConnection ( createConnection ( ProposedFeatures . all ) , {
@@ -70,11 +70,22 @@ const lsp = new LspConnection(createConnection(ProposedFeatures.all), {
7070lsp . listen ( ) ;
7171
7272process . on ( 'unhandledRejection' , ( reason , _promise ) => {
73- getLogger ( ) . error ( reason , 'Unhandled promise rejection' ) ;
73+ console . error ( reason , 'Unhandled promise rejection' ) ;
74+
75+ try {
76+ getLogger ( ) . error ( reason , 'Unhandled promise rejection' ) ;
77+ } catch {
78+ // do nothing
79+ }
7480} ) ;
7581
7682process . on ( 'uncaughtException' , ( error , origin ) => {
77- getLogger ( ) . error ( error , `Uncaught exception ${ origin } ` ) ;
83+ console . error ( error , `Unhandled exception ${ origin } ` ) ;
84+ try {
85+ getLogger ( ) . error ( error , `Uncaught exception ${ origin } ` ) ;
86+ } catch {
87+ // do nothing
88+ }
7889} ) ;
7990
8091function getLogger ( ) {
0 commit comments