@@ -149,6 +149,33 @@ suite('GetErrorsTool - Tool Invocation', () => {
149149 ] ) ;
150150 } ) ;
151151
152+ test ( 'getDiagnostics - folder path excludes files with only Info and Hint diagnostics' , ( ) => {
153+ // Create a file with only Info and Hint diagnostics
154+ const infoHintOnlyFile = URI . file ( '/test/workspace/src/infoHintOnly.ts' ) ;
155+ diagnosticsService . setDiagnostics ( infoHintOnlyFile , [
156+ {
157+ message : 'This is just informational' ,
158+ range : new Range ( 0 , 0 , 0 , 5 ) ,
159+ severity : DiagnosticSeverity . Information
160+ } ,
161+ {
162+ message : 'This is a hint' ,
163+ range : new Range ( 1 , 0 , 1 , 5 ) ,
164+ severity : DiagnosticSeverity . Hint
165+ }
166+ ] ) ;
167+
168+ // Request diagnostics for the src folder
169+ const srcFolder = URI . file ( '/test/workspace/src' ) ;
170+ const results = tool . getDiagnostics ( [ { uri : srcFolder , range : undefined } ] ) ;
171+
172+ // Should only include tsFile1 and tsFile2, not infoHintOnlyFile (which has no Warning/Error)
173+ expect ( results ) . toEqual ( [
174+ { uri : tsFile1 , diagnostics : diagnosticsService . getDiagnostics ( tsFile1 ) . filter ( d => d . severity <= DiagnosticSeverity . Warning ) } ,
175+ { uri : tsFile2 , diagnostics : diagnosticsService . getDiagnostics ( tsFile2 ) . filter ( d => d . severity <= DiagnosticSeverity . Warning ) }
176+ ] ) ;
177+ } ) ;
178+
152179 // Tool invocation tests
153180 test ( 'Tool invocation - with no filePaths aggregates all diagnostics and formats workspace message' , async ( ) => {
154181 const result = await tool . invoke ( { input : { } , toolInvocationToken : null ! } , CancellationToken . None ) ;
0 commit comments