Skip to content

Commit 85ef45d

Browse files
hannesrudolphdaniel-lxs
authored andcommitted
fix: respect maxDiagnosticMessages setting in workspace problems mention
- Changed hardcoded limit of 5 diagnostics to use user's maxDiagnosticMessages setting - Default value remains 50 if not configured - Ensures consistent behavior with other diagnostic displays in the extension
1 parent f407483 commit 85ef45d

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/core/mentions/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import { FileContextTracker } from "../context-tracking/FileContextTracker"
1919

2020
import { RooIgnoreController } from "../ignore/RooIgnoreController"
2121

22+
import { DEFAULT_MAX_DIAGNOSTIC_MESSAGES } from "../constants/diagnosticSettings"
23+
2224
import { t } from "../../i18n"
2325

2426
function getUrlErrorMessage(error: unknown): string {
@@ -81,7 +83,7 @@ export async function parseMentions(
8183
rooIgnoreController?: RooIgnoreController,
8284
showRooIgnoredFiles: boolean = true,
8385
includeDiagnosticMessages: boolean = true,
84-
maxDiagnosticMessages: number = 5,
86+
maxDiagnosticMessages: number = DEFAULT_MAX_DIAGNOSTIC_MESSAGES,
8587
): Promise<string> {
8688
const mentions: Set<string> = new Set()
8789
let parsedText = text.replace(mentionRegexGlobal, (match, mention) => {
@@ -291,7 +293,7 @@ async function getFileOrFolderContent(
291293
async function getWorkspaceProblems(
292294
cwd: string,
293295
includeDiagnosticMessages: boolean = true,
294-
maxDiagnosticMessages: number = 5,
296+
maxDiagnosticMessages: number = DEFAULT_MAX_DIAGNOSTIC_MESSAGES,
295297
): Promise<string> {
296298
const diagnostics = vscode.languages.getDiagnostics()
297299
const result = await diagnosticsToProblemsString(

src/core/mentions/processUserContentMentions.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Anthropic } from "@anthropic-ai/sdk"
22
import { parseMentions } from "./index"
33
import { UrlContentFetcher } from "../../services/browser/UrlContentFetcher"
44
import { FileContextTracker } from "../context-tracking/FileContextTracker"
5+
import { DEFAULT_MAX_DIAGNOSTIC_MESSAGES } from "../constants/diagnosticSettings"
56

67
/**
78
* Process mentions in user content, specifically within task and feedback tags
@@ -14,7 +15,7 @@ export async function processUserContentMentions({
1415
rooIgnoreController,
1516
showRooIgnoredFiles = true,
1617
includeDiagnosticMessages = true,
17-
maxDiagnosticMessages = 5,
18+
maxDiagnosticMessages = DEFAULT_MAX_DIAGNOSTIC_MESSAGES,
1819
}: {
1920
userContent: Anthropic.Messages.ContentBlockParam[]
2021
cwd: string

0 commit comments

Comments
 (0)