@@ -80,6 +80,8 @@ export async function parseMentions(
8080 fileContextTracker ?: FileContextTracker ,
8181 rooIgnoreController ?: RooIgnoreController ,
8282 showRooIgnoredFiles : boolean = true ,
83+ includeDiagnosticMessages : boolean = true ,
84+ maxDiagnosticMessages : number = 50 ,
8385) : Promise < string > {
8486 const mentions : Set < string > = new Set ( )
8587 let parsedText = text . replace ( mentionRegexGlobal , ( match , mention ) => {
@@ -165,7 +167,7 @@ export async function parseMentions(
165167 }
166168 } else if ( mention === "problems" ) {
167169 try {
168- const problems = await getWorkspaceProblems ( cwd )
170+ const problems = await getWorkspaceProblems ( cwd , includeDiagnosticMessages , maxDiagnosticMessages )
169171 parsedText += `\n\n<workspace_diagnostics>\n${ problems } \n</workspace_diagnostics>`
170172 } catch ( error ) {
171173 parsedText += `\n\n<workspace_diagnostics>\nError fetching diagnostics: ${ error . message } \n</workspace_diagnostics>`
@@ -286,12 +288,18 @@ async function getFileOrFolderContent(
286288 }
287289}
288290
289- async function getWorkspaceProblems ( cwd : string ) : Promise < string > {
291+ async function getWorkspaceProblems (
292+ cwd : string ,
293+ includeDiagnosticMessages : boolean = true ,
294+ maxDiagnosticMessages : number = 50 ,
295+ ) : Promise < string > {
290296 const diagnostics = vscode . languages . getDiagnostics ( )
291297 const result = await diagnosticsToProblemsString (
292298 diagnostics ,
293299 [ vscode . DiagnosticSeverity . Error , vscode . DiagnosticSeverity . Warning ] ,
294300 cwd ,
301+ includeDiagnosticMessages ,
302+ maxDiagnosticMessages ,
295303 )
296304 if ( ! result ) {
297305 return "No errors or warnings detected."
0 commit comments