@@ -56,6 +56,8 @@ const LINT_FILE_DEBOUNCE_DELAY = 100;
5656 */
5757const connection = createConnection ( ProposedFeatures . all ) ;
5858
59+ connection . console . info ( `AGLint Language Server starting (Node.js ${ process . version } )` ) ;
60+
5961/**
6062 * Create a simple text document manager.
6163 */
@@ -163,7 +165,7 @@ connection.onInitialize(async (params: InitializeParams) => {
163165 } else {
164166 message += 'without workspace root' ;
165167 }
166- connection . console . log ( message ) ;
168+ connection . console . debug ( message ) ;
167169
168170 // TODO: Define the capabilities of the language server here
169171 const result : InitializeResult = {
@@ -180,7 +182,7 @@ connection.onInitialize(async (params: InitializeParams) => {
180182 // we do not need to handle workspace folder changes.
181183 if ( hasWorkspaceFolderCapability ) {
182184 connection . workspace . onDidChangeWorkspaceFolders ( ( ) => {
183- connection . console . log ( 'Workspace folder change event received (ignored by per-folder server instance).' ) ;
185+ connection . console . warn ( 'Workspace folder change event received (ignored by per-folder server instance).' ) ;
184186 } ) ;
185187 }
186188
@@ -342,15 +344,15 @@ async function lintFile(textDocument: TextDocument): Promise<void> {
342344 const cachedDiagnostics = lintCache . get ( cacheKey ) ;
343345 if ( cachedDiagnostics ) {
344346 const duration = Date . now ( ) - startTime ;
345- connection . console . info (
347+ connection . console . debug (
346348 `Linting completed for: ${ documentPath } (from cache, ${ duration } ms)` ,
347349 ) ;
348350 connection . sendDiagnostics ( { uri : textDocument . uri , diagnostics : cachedDiagnostics } ) ;
349351 return ;
350352 }
351353 }
352354
353- connection . console . info ( `Linting started for : ${ documentPath } ` ) ;
355+ connection . console . debug ( `Linting file : ${ documentPath } ` ) ;
354356
355357 const linterRunOptions : LinterRunOptions = {
356358 fileProps : {
@@ -377,7 +379,7 @@ async function lintFile(textDocument: TextDocument): Promise<void> {
377379 }
378380
379381 const duration = Date . now ( ) - startTime ;
380- connection . console . info ( `Linting completed for: ${ documentPath } (${ duration } ms)` ) ;
382+ connection . console . debug ( `Linting completed for: ${ documentPath } (${ duration } ms)` ) ;
381383
382384 connection . sendDiagnostics ( { uri : textDocument . uri , diagnostics } ) ;
383385 } catch ( error : unknown ) {
@@ -415,7 +417,7 @@ const parseConfigCommentTolerant = (rule: string): ConfigCommentRule | null => {
415417 try {
416418 return ConfigCommentRuleParser . parse ( rule ) ;
417419 } catch ( error : unknown ) {
418- connection . console . error ( `'${ rule } ' is not a valid AGLint config comment rule: ${ getErrorMessage ( error ) } ` ) ;
420+ connection . console . debug ( `'${ rule } ' is not a valid AGLint config comment rule: ${ getErrorMessage ( error ) } ` ) ;
419421 return null ;
420422 }
421423} ;
@@ -802,11 +804,11 @@ async function pullSettings() {
802804 // If AGLint is disabled, clean up and return early
803805 if ( ! settings . enableAglint ) {
804806 removeAllDiagnostics ( ) ;
805- connection . console . info ( 'AGLint is disabled' ) ;
807+ connection . console . debug ( 'AGLint is disabled' ) ;
806808 return ;
807809 }
808810
809- connection . console . info ( 'AGLint integration is enabled' ) ;
811+ connection . console . debug ( 'AGLint integration is enabled' ) ;
810812
811813 // Initialize AGLint context if not already initialized
812814 if ( ! aglintContext ) {
@@ -824,7 +826,7 @@ async function pullSettings() {
824826 }
825827 } else if ( previousEnableDebug !== settings . enableAglintDebug ) {
826828 // Handle debug setting change
827- connection . console . info ( `AGLint debug mode changed: ${ settings . enableAglintDebug } ` ) ;
829+ connection . console . info ( `AGLint debug mode ${ settings . enableAglintDebug ? 'enabled' : 'disabled' } ` ) ;
828830
829831 if ( settings . enableAglintDebug ) {
830832 aglintContext . debuggerInstance . enable ( ) ;
@@ -833,6 +835,17 @@ async function pullSettings() {
833835 }
834836 }
835837
838+ // Log cache setting changes
839+ if ( previousEnableCache !== settings . enableInMemoryAglintCache ) {
840+ if ( settings . enableInMemoryAglintCache ) {
841+ connection . console . info ( 'In-memory linting cache enabled' ) ;
842+ } else {
843+ connection . console . info ( 'In-memory linting cache disabled' ) ;
844+ lintCache . clear ( ) ;
845+ connection . console . debug ( 'Cache cleared' ) ;
846+ }
847+ }
848+
836849 await refreshLinter ( ) ;
837850}
838851
@@ -874,7 +887,7 @@ connection.onInitialized(async () => {
874887
875888 if ( hasWorkspaceFolderCapability ) {
876889 connection . workspace . onDidChangeWorkspaceFolders ( ( ) => {
877- connection . console . log ( 'Workspace folder change event received.' ) ;
890+ connection . console . warn ( 'Workspace folder change event received.' ) ;
878891 } ) ;
879892 }
880893
@@ -894,5 +907,3 @@ documents.listen(connection);
894907
895908// Listen on the connection
896909connection . listen ( ) ;
897-
898- connection . console . info ( `AGLint Node.js Language Server running in node ${ process . version } ` ) ;
0 commit comments