diff --git a/packages/types/src/global-settings.ts b/packages/types/src/global-settings.ts index 5b729a125f..d3444ae333 100644 --- a/packages/types/src/global-settings.ts +++ b/packages/types/src/global-settings.ts @@ -70,6 +70,10 @@ export const globalSettingsSchema = z.object({ showRooIgnoredFiles: z.boolean().optional(), maxReadFileLine: z.number().optional(), + includeDiagnostics: z.boolean().optional(), + maxDiagnosticsCount: z.number().optional(), + diagnosticsFilter: z.array(z.string()).optional(), + terminalOutputLineLimit: z.number().optional(), terminalShellIntegrationTimeout: z.number().optional(), terminalShellIntegrationDisabled: z.boolean().optional(), diff --git a/src/core/mentions/index.ts b/src/core/mentions/index.ts index 8ae4f7f131..2820d2c2fb 100644 --- a/src/core/mentions/index.ts +++ b/src/core/mentions/index.ts @@ -246,6 +246,14 @@ async function getFileOrFolderContent( } async function getWorkspaceProblems(cwd: string): Promise { + // Check if diagnostics are enabled + const config = vscode.workspace.getConfiguration("roo-cline") + const includeDiagnostics = config.get("includeDiagnostics", false) + + if (!includeDiagnostics) { + return "Diagnostics are disabled in settings." + } + const diagnostics = vscode.languages.getDiagnostics() const result = await diagnosticsToProblemsString( diagnostics, diff --git a/src/core/webview/ClineProvider.ts b/src/core/webview/ClineProvider.ts index 57fa16a848..240a611786 100644 --- a/src/core/webview/ClineProvider.ts +++ b/src/core/webview/ClineProvider.ts @@ -1329,6 +1329,9 @@ export class ClineProvider showRooIgnoredFiles, language, maxReadFileLine, + includeDiagnostics, + maxDiagnosticsCount, + diagnosticsFilter, terminalCompressProgressBar, historyPreviewCollapsed, cloudUserInfo, @@ -1439,6 +1442,9 @@ export class ClineProvider renderContext: this.renderContext, maxReadFileLine: maxReadFileLine ?? -1, maxConcurrentFileReads: maxConcurrentFileReads ?? 5, + includeDiagnostics: includeDiagnostics ?? false, + maxDiagnosticsCount: maxDiagnosticsCount ?? 50, + diagnosticsFilter: diagnosticsFilter ?? [], settingsImportedAt: this.settingsImportedAt, terminalCompressProgressBar: terminalCompressProgressBar ?? true, hasSystemPromptOverride, @@ -1590,6 +1596,9 @@ export class ClineProvider showRooIgnoredFiles: stateValues.showRooIgnoredFiles ?? true, maxReadFileLine: stateValues.maxReadFileLine ?? -1, maxConcurrentFileReads: stateValues.maxConcurrentFileReads ?? 5, + includeDiagnostics: stateValues.includeDiagnostics ?? false, + maxDiagnosticsCount: stateValues.maxDiagnosticsCount ?? 50, + diagnosticsFilter: stateValues.diagnosticsFilter ?? [], historyPreviewCollapsed: stateValues.historyPreviewCollapsed ?? false, cloudUserInfo, cloudIsAuthenticated, diff --git a/src/core/webview/__tests__/ClineProvider.test.ts b/src/core/webview/__tests__/ClineProvider.test.ts index 6ced4989a4..b5144ca034 100644 --- a/src/core/webview/__tests__/ClineProvider.test.ts +++ b/src/core/webview/__tests__/ClineProvider.test.ts @@ -432,6 +432,9 @@ describe("ClineProvider", () => { autoCondenseContextPercent: 100, cloudIsAuthenticated: false, sharingEnabled: false, + includeDiagnostics: false, + maxDiagnosticsCount: 5, + diagnosticsFilter: ["error", "warning"], } const message: ExtensionMessage = { diff --git a/src/core/webview/webviewMessageHandler.ts b/src/core/webview/webviewMessageHandler.ts index a4d9dafecf..2a6eb6cddd 100644 --- a/src/core/webview/webviewMessageHandler.ts +++ b/src/core/webview/webviewMessageHandler.ts @@ -995,6 +995,18 @@ export const webviewMessageHandler = async ( await updateGlobalState("maxConcurrentFileReads", valueToSave) await provider.postStateToWebview() break + case "includeDiagnostics": + await updateGlobalState("includeDiagnostics", message.bool ?? false) + await provider.postStateToWebview() + break + case "maxDiagnosticsCount": + await updateGlobalState("maxDiagnosticsCount", message.value ?? 5) + await provider.postStateToWebview() + break + case "diagnosticsFilter": + await updateGlobalState("diagnosticsFilter", (message.values as string[]) ?? ["error", "warning"]) + await provider.postStateToWebview() + break case "setHistoryPreviewCollapsed": // Add the new case handler await updateGlobalState("historyPreviewCollapsed", message.bool ?? false) // No need to call postStateToWebview here as the UI already updated optimistically diff --git a/src/i18n/locales/ca/common.json b/src/i18n/locales/ca/common.json index 31b9668a86..fdf379d9d4 100644 --- a/src/i18n/locales/ca/common.json +++ b/src/i18n/locales/ca/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Clau API de Groq", "getGroqApiKey": "Obté la clau API de Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/de/common.json b/src/i18n/locales/de/common.json index ab0cd61ac9..440379e6b3 100644 --- a/src/i18n/locales/de/common.json +++ b/src/i18n/locales/de/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Groq API-Schlüssel", "getGroqApiKey": "Groq API-Schlüssel erhalten" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/en/common.json b/src/i18n/locales/en/common.json index 7d359e6586..12dace3a89 100644 --- a/src/i18n/locales/en/common.json +++ b/src/i18n/locales/en/common.json @@ -96,5 +96,25 @@ "input": { "task_prompt": "What should Roo do?", "task_placeholder": "Type your task here" + }, + "settings": { + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" + } } } diff --git a/src/i18n/locales/es/common.json b/src/i18n/locales/es/common.json index 3fb8602131..a26610ceed 100644 --- a/src/i18n/locales/es/common.json +++ b/src/i18n/locales/es/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Clave API de Groq", "getGroqApiKey": "Obtener clave API de Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/fr/common.json b/src/i18n/locales/fr/common.json index 70f22f4f9f..dc07a07f6e 100644 --- a/src/i18n/locales/fr/common.json +++ b/src/i18n/locales/fr/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Clé API Groq", "getGroqApiKey": "Obtenir la clé API Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/hi/common.json b/src/i18n/locales/hi/common.json index 7b97e41ffc..2078f18e7e 100644 --- a/src/i18n/locales/hi/common.json +++ b/src/i18n/locales/hi/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "ग्रोक एपीआई कुंजी", "getGroqApiKey": "ग्रोक एपीआई कुंजी प्राप्त करें" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/id/common.json b/src/i18n/locales/id/common.json index 16da42750e..6b56035000 100644 --- a/src/i18n/locales/id/common.json +++ b/src/i18n/locales/id/common.json @@ -96,5 +96,25 @@ "input": { "task_prompt": "Apa yang harus Roo lakukan?", "task_placeholder": "Ketik tugas kamu di sini" + }, + "settings": { + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" + } } } diff --git a/src/i18n/locales/it/common.json b/src/i18n/locales/it/common.json index 21946d69e5..7b0ebcddd7 100644 --- a/src/i18n/locales/it/common.json +++ b/src/i18n/locales/it/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Chiave API Groq", "getGroqApiKey": "Ottieni chiave API Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/ja/common.json b/src/i18n/locales/ja/common.json index 2cf2d50f29..1a6614ed8d 100644 --- a/src/i18n/locales/ja/common.json +++ b/src/i18n/locales/ja/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Groq APIキー", "getGroqApiKey": "Groq APIキーを取得" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/ko/common.json b/src/i18n/locales/ko/common.json index 52264fcdd5..6bd42be7ec 100644 --- a/src/i18n/locales/ko/common.json +++ b/src/i18n/locales/ko/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Groq API 키", "getGroqApiKey": "Groq API 키 받기" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/nl/common.json b/src/i18n/locales/nl/common.json index 26a856c15f..a24820cd3a 100644 --- a/src/i18n/locales/nl/common.json +++ b/src/i18n/locales/nl/common.json @@ -96,5 +96,25 @@ "input": { "task_prompt": "Wat moet Roo doen?", "task_placeholder": "Typ hier je taak" + }, + "settings": { + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" + } } } diff --git a/src/i18n/locales/pl/common.json b/src/i18n/locales/pl/common.json index 1091b643e2..0f359c6ddf 100644 --- a/src/i18n/locales/pl/common.json +++ b/src/i18n/locales/pl/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Klucz API Groq", "getGroqApiKey": "Uzyskaj klucz API Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/pt-BR/common.json b/src/i18n/locales/pt-BR/common.json index 6eb8fc7708..454fdb3007 100644 --- a/src/i18n/locales/pt-BR/common.json +++ b/src/i18n/locales/pt-BR/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Chave de API Groq", "getGroqApiKey": "Obter chave de API Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/ru/common.json b/src/i18n/locales/ru/common.json index a8e0479da1..317ed7e066 100644 --- a/src/i18n/locales/ru/common.json +++ b/src/i18n/locales/ru/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Ключ API Groq", "getGroqApiKey": "Получить ключ API Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/tr/common.json b/src/i18n/locales/tr/common.json index 182df50d1c..2fcff07e23 100644 --- a/src/i18n/locales/tr/common.json +++ b/src/i18n/locales/tr/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Groq API Anahtarı", "getGroqApiKey": "Groq API Anahtarı Al" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/vi/common.json b/src/i18n/locales/vi/common.json index 2f32da8f70..85682287b3 100644 --- a/src/i18n/locales/vi/common.json +++ b/src/i18n/locales/vi/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Khóa API Groq", "getGroqApiKey": "Lấy khóa API Groq" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/zh-CN/common.json b/src/i18n/locales/zh-CN/common.json index 45fd6d9b58..d2b8121d00 100644 --- a/src/i18n/locales/zh-CN/common.json +++ b/src/i18n/locales/zh-CN/common.json @@ -106,6 +106,24 @@ "providers": { "groqApiKey": "Groq API 密钥", "getGroqApiKey": "获取 Groq API 密钥" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/i18n/locales/zh-TW/common.json b/src/i18n/locales/zh-TW/common.json index 03e83b183a..939b898b0d 100644 --- a/src/i18n/locales/zh-TW/common.json +++ b/src/i18n/locales/zh-TW/common.json @@ -101,6 +101,24 @@ "providers": { "groqApiKey": "Groq API 金鑰", "getGroqApiKey": "取得 Groq API 金鑰" + }, + "diagnostics": { + "description": "Configure which diagnostic messages are included in the context.", + "includeDiagnostics": { + "label": "Include Diagnostics", + "description": "Enable to include code diagnostics in the context." + }, + "maxDiagnosticsCount": { + "label": "Max Diagnostics", + "description": "The maximum number of diagnostics to include." + }, + "diagnosticsFilter": { + "label": "Filter", + "description": "A comma-separated list of diagnostic sources to include (e.g., eslint, tsc)." + } + }, + "sections": { + "diagnostics": "Diagnostics" } } } diff --git a/src/integrations/diagnostics/__tests__/diagnostics.spec.ts b/src/integrations/diagnostics/__tests__/diagnostics.spec.ts index 0df472a75f..c91925d171 100644 --- a/src/integrations/diagnostics/__tests__/diagnostics.spec.ts +++ b/src/integrations/diagnostics/__tests__/diagnostics.spec.ts @@ -64,6 +64,15 @@ vitest.mock("vscode", () => ({ stat: vitest.fn(), }, openTextDocument: vitest.fn(), + getConfiguration: vitest.fn(() => ({ + get: vitest.fn((key, defaultValue) => { + // Return default values for diagnostics configuration + if (key === "includeDiagnostics") return false + if (key === "maxDiagnosticsCount") return 50 + if (key === "diagnosticsFilter") return [] + return defaultValue + }), + })), }, })) @@ -103,6 +112,7 @@ describe("diagnosticsToProblemsString", () => { [[fileUri, diagnostics]], [vscode.DiagnosticSeverity.Error, vscode.DiagnosticSeverity.Warning], "/path/to", + { includeDiagnostics: true }, ) // Verify only Error and Warning diagnostics are included @@ -147,6 +157,7 @@ describe("diagnosticsToProblemsString", () => { [[dirUri, [diagnostic]]], [vscode.DiagnosticSeverity.Error], "/path/to", + { includeDiagnostics: true }, ) // Verify fs.stat was called with the directory URI @@ -204,6 +215,7 @@ describe("diagnosticsToProblemsString", () => { [[fileUri, diagnostics]], [vscode.DiagnosticSeverity.Error, vscode.DiagnosticSeverity.Warning, vscode.DiagnosticSeverity.Information], "/path/to", + { includeDiagnostics: true }, ) // Verify all diagnostics are included in the output @@ -277,6 +289,7 @@ describe("diagnosticsToProblemsString", () => { ], [vscode.DiagnosticSeverity.Error, vscode.DiagnosticSeverity.Warning, vscode.DiagnosticSeverity.Information], "/path/to", + { includeDiagnostics: true }, ) // Verify file paths are correctly shown with relative paths @@ -333,6 +346,7 @@ describe("diagnosticsToProblemsString", () => { [[fileUri, diagnostics]], [vscode.DiagnosticSeverity.Information, vscode.DiagnosticSeverity.Hint], "/path/to", + { includeDiagnostics: true }, ) // Verify empty string is returned @@ -373,6 +387,7 @@ describe("diagnosticsToProblemsString", () => { [[fileUri, [diagnostic]]], [vscode.DiagnosticSeverity.Error], "/project/root", + { includeDiagnostics: true }, ) // Verify exact output format diff --git a/src/integrations/diagnostics/__tests__/diagnosticsToProblemsString.test.ts b/src/integrations/diagnostics/__tests__/diagnosticsToProblemsString.test.ts new file mode 100644 index 0000000000..e546f7d0c4 --- /dev/null +++ b/src/integrations/diagnostics/__tests__/diagnosticsToProblemsString.test.ts @@ -0,0 +1,198 @@ +import * as vscode from "vscode" +import { diagnosticsToProblemsString } from "../index" + +// Mock vscode +jest.mock("vscode", () => ({ + workspace: { + getConfiguration: jest.fn(() => ({ + get: jest.fn((key: string, defaultValue: any) => { + const config: Record = { + includeDiagnostics: false, + maxDiagnosticsCount: 50, + diagnosticsFilter: [], + } + return config[key] ?? defaultValue + }), + })), + fs: { + stat: jest.fn(), + }, + openTextDocument: jest.fn(), + }, + DiagnosticSeverity: { + Error: 0, + Warning: 1, + Information: 2, + Hint: 3, + }, + FileType: { + File: 1, + Directory: 2, + }, + Uri: { + file: (path: string) => ({ fsPath: path }), + }, + Range: jest.fn((startLine: number, startChar: number, endLine: number, endChar: number) => ({ + start: { line: startLine, character: startChar }, + end: { line: endLine, character: endChar }, + })), + Position: jest.fn((line: number, char: number) => ({ line, character: char })), +})) + +describe("diagnosticsToProblemsString", () => { + const mockCwd = "/test/workspace" + + beforeEach(() => { + jest.clearAllMocks() + }) + + it("should return empty string when includeDiagnostics is false", async () => { + const diagnostics: [vscode.Uri, vscode.Diagnostic[]][] = [ + [ + vscode.Uri.file("/test/workspace/file.ts"), + [ + { + range: new vscode.Range(0, 0, 0, 10), + message: "Test error", + severity: vscode.DiagnosticSeverity.Error, + } as vscode.Diagnostic, + ], + ], + ] + + const result = await diagnosticsToProblemsString(diagnostics, [vscode.DiagnosticSeverity.Error], mockCwd, { + includeDiagnostics: false, + }) + + expect(result).toBe("") + }) + + it("should include diagnostics when includeDiagnostics is true", async () => { + const mockDocument = { + lineAt: jest.fn(() => ({ text: "const x = 1" })), + } + ;(vscode.workspace.openTextDocument as jest.Mock).mockResolvedValue(mockDocument) + ;(vscode.workspace.fs.stat as jest.Mock).mockResolvedValue({ type: vscode.FileType.File }) + + const diagnostics: [vscode.Uri, vscode.Diagnostic[]][] = [ + [ + vscode.Uri.file("/test/workspace/file.ts"), + [ + { + range: new vscode.Range(0, 0, 0, 10), + message: "Test error", + severity: vscode.DiagnosticSeverity.Error, + source: "typescript", + } as vscode.Diagnostic, + ], + ], + ] + + const result = await diagnosticsToProblemsString(diagnostics, [vscode.DiagnosticSeverity.Error], mockCwd, { + includeDiagnostics: true, + }) + + expect(result).toContain("file.ts") + expect(result).toContain("Test error") + expect(result).toContain("typescript") + }) + + it("should respect maxDiagnosticsCount", async () => { + const mockDocument = { + lineAt: jest.fn(() => ({ text: "const x = 1" })), + } + ;(vscode.workspace.openTextDocument as jest.Mock).mockResolvedValue(mockDocument) + ;(vscode.workspace.fs.stat as jest.Mock).mockResolvedValue({ type: vscode.FileType.File }) + + const diagnostics: [vscode.Uri, vscode.Diagnostic[]][] = [ + [ + vscode.Uri.file("/test/workspace/file.ts"), + Array(10) + .fill(null) + .map( + (_, i) => + ({ + range: new vscode.Range(i, 0, i, 10), + message: `Test error ${i}`, + severity: vscode.DiagnosticSeverity.Error, + }) as vscode.Diagnostic, + ), + ], + ] + + const result = await diagnosticsToProblemsString(diagnostics, [vscode.DiagnosticSeverity.Error], mockCwd, { + includeDiagnostics: true, + maxDiagnosticsCount: 3, + }) + + expect(result).toContain("Test error 0") + expect(result).toContain("Test error 1") + expect(result).toContain("Test error 2") + expect(result).not.toContain("Test error 3") + expect(result).toContain("7 more diagnostics omitted") + }) + + it("should apply diagnosticsFilter correctly", async () => { + const mockDocument = { + lineAt: jest.fn(() => ({ text: "const x = 1" })), + } + ;(vscode.workspace.openTextDocument as jest.Mock).mockResolvedValue(mockDocument) + ;(vscode.workspace.fs.stat as jest.Mock).mockResolvedValue({ type: vscode.FileType.File }) + + const diagnostics: [vscode.Uri, vscode.Diagnostic[]][] = [ + [ + vscode.Uri.file("/test/workspace/file.ts"), + [ + { + range: new vscode.Range(0, 0, 0, 10), + message: "ESLint error", + severity: vscode.DiagnosticSeverity.Error, + source: "eslint", + code: "no-unused-vars", + } as vscode.Diagnostic, + { + range: new vscode.Range(1, 0, 1, 10), + message: "TypeScript error", + severity: vscode.DiagnosticSeverity.Error, + source: "typescript", + code: "2322", + } as vscode.Diagnostic, + ], + ], + ] + + const result = await diagnosticsToProblemsString(diagnostics, [vscode.DiagnosticSeverity.Error], mockCwd, { + includeDiagnostics: true, + diagnosticsFilter: ["typescript 2322"], + }) + + expect(result).toContain("TypeScript error") + expect(result).not.toContain("ESLint error") + }) + + it("should handle file read errors gracefully", async () => { + ;(vscode.workspace.openTextDocument as jest.Mock).mockRejectedValue(new Error("File not found")) + ;(vscode.workspace.fs.stat as jest.Mock).mockResolvedValue({ type: vscode.FileType.File }) + + const diagnostics: [vscode.Uri, vscode.Diagnostic[]][] = [ + [ + vscode.Uri.file("/test/workspace/file.ts"), + [ + { + range: new vscode.Range(0, 0, 0, 10), + message: "Test error", + severity: vscode.DiagnosticSeverity.Error, + } as vscode.Diagnostic, + ], + ], + ] + + const result = await diagnosticsToProblemsString(diagnostics, [vscode.DiagnosticSeverity.Error], mockCwd, { + includeDiagnostics: true, + }) + + expect(result).toContain("file.ts") + expect(result).toContain("(unavailable)") + expect(result).toContain("Test error") + }) +}) diff --git a/src/integrations/diagnostics/index.ts b/src/integrations/diagnostics/index.ts index 97b8335353..df4d139183 100644 --- a/src/integrations/diagnostics/index.ts +++ b/src/integrations/diagnostics/index.ts @@ -74,17 +74,57 @@ export async function diagnosticsToProblemsString( diagnostics: [vscode.Uri, vscode.Diagnostic[]][], severities: vscode.DiagnosticSeverity[], cwd: string, + options?: { + includeDiagnostics?: boolean + maxDiagnosticsCount?: number + diagnosticsFilter?: string[] + }, ): Promise { + // Use provided options or fall back to VSCode configuration + const config = vscode.workspace.getConfiguration("roo-cline") + const includeDiagnostics = options?.includeDiagnostics ?? config.get("includeDiagnostics", false) + + if (!includeDiagnostics) { + return "" + } + + const maxDiagnosticsCount = options?.maxDiagnosticsCount ?? config.get("maxDiagnosticsCount", 50) + const diagnosticsFilter = options?.diagnosticsFilter ?? config.get("diagnosticsFilter", []) + const documents = new Map() const fileStats = new Map() let result = "" + let totalDiagnosticsCount = 0 + for (const [uri, fileDiagnostics] of diagnostics) { const problems = fileDiagnostics .filter((d) => severities.includes(d.severity)) + .filter((d) => { + // Apply diagnostics filter + if (diagnosticsFilter.length === 0) return true + + const source = d.source || "" + const code = typeof d.code === "object" ? d.code.value : d.code + const filterKey = source ? `${source} ${code || ""}`.trim() : `${code || ""}`.trim() + + // Check if this diagnostic matches any filter (exact match) + return diagnosticsFilter.some((filter) => { + // Exact matching for filter key + return filterKey === filter || (filter && filterKey.startsWith(filter + " ")) + }) + }) .sort((a, b) => a.range.start.line - b.range.start.line) + if (problems.length > 0) { result += `\n\n${path.relative(cwd, uri.fsPath).toPosix()}` + for (const diagnostic of problems) { + // Check if we've reached the max count + if (maxDiagnosticsCount > 0 && totalDiagnosticsCount >= maxDiagnosticsCount) { + result += `\n... (${diagnostics.reduce((sum, [, diags]) => sum + diags.filter((d) => severities.includes(d.severity)).length, 0) - totalDiagnosticsCount} more diagnostics omitted)` + return result.trim() + } + let label: string switch (diagnostic.severity) { case vscode.DiagnosticSeverity.Error: @@ -121,6 +161,8 @@ export async function diagnosticsToProblemsString( } catch { result += `\n- [${source}${label}] ${line} | (unavailable) : ${diagnostic.message}` } + + totalDiagnosticsCount++ } } } diff --git a/src/package.json b/src/package.json index 5e2fd096e1..1b32cf5a69 100644 --- a/src/package.json +++ b/src/package.json @@ -3,7 +3,7 @@ "displayName": "%extension.displayName%", "description": "%extension.description%", "publisher": "RooVeterinaryInc", - "version": "3.20.3", + "version": "3.20.4", "icon": "assets/icons/icon.png", "galleryBanner": { "color": "#617A91", @@ -344,6 +344,25 @@ "type": "boolean", "default": false, "description": "%settings.rooCodeCloudEnabled.description%" + }, + "roo-cline.includeDiagnostics": { + "type": "boolean", + "default": false, + "description": "%settings.includeDiagnostics.description%" + }, + "roo-cline.maxDiagnosticsCount": { + "type": "number", + "default": 50, + "minimum": 0, + "description": "%settings.maxDiagnosticsCount.description%" + }, + "roo-cline.diagnosticsFilter": { + "type": "array", + "items": { + "type": "string" + }, + "default": [], + "description": "%settings.diagnosticsFilter.description%" } } } diff --git a/src/package.nls.ca.json b/src/package.nls.ca.json index a9c3a93dad..c8bd895086 100644 --- a/src/package.nls.ca.json +++ b/src/package.nls.ca.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "El proveïdor del model de llenguatge (p. ex. copilot)", "settings.vsCodeLmModelSelector.family.description": "La família del model de llenguatge (p. ex. gpt-4)", "settings.customStoragePath.description": "Ruta d'emmagatzematge personalitzada. Deixeu-la buida per utilitzar la ubicació predeterminada. Admet rutes absolutes (p. ex. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Habilitar Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Habilitar Roo Code Cloud.", + "settings.includeDiagnostics.description": "Inclou diagnòstics (errors/avisos) a les sol·licituds de l'API. Desactiva-ho en crear funcions de diversos fitxers per evitar que errors temporals distreguin la IA.", + "settings.maxDiagnosticsCount.description": "Nombre màxim de diagnòstics a incloure a les sol·licituds de l'API (0 per il·limitat). Ajuda a controlar l'ús de fitxes.", + "settings.diagnosticsFilter.description": "Filtra els diagnòstics per codi o font. Afegeix codis de diagnòstic (p. ex., 'dart Error', 'eslint/no-unused-vars') per excloure tipus específics." } diff --git a/src/package.nls.de.json b/src/package.nls.de.json index e9496d7ede..6b81f0d8be 100644 --- a/src/package.nls.de.json +++ b/src/package.nls.de.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Der Anbieter des Sprachmodells (z.B. copilot)", "settings.vsCodeLmModelSelector.family.description": "Die Familie des Sprachmodells (z.B. gpt-4)", "settings.customStoragePath.description": "Benutzerdefinierter Speicherpfad. Leer lassen, um den Standardspeicherort zu verwenden. Unterstützt absolute Pfade (z.B. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Aktiviere Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Aktiviere Roo Code Cloud.", + "settings.includeDiagnostics.description": "Diagnosen (Fehler/Warnungen) in API-Anfragen einschließen. Deaktivieren Sie dies beim Erstellen von Funktionen mit mehreren Dateien, um zu vermeiden, dass temporäre Fehler die KI ablenken.", + "settings.maxDiagnosticsCount.description": "Maximale Anzahl von Diagnosen, die in API-Anfragen eingeschlossen werden sollen (0 für unbegrenzt). Hilft bei der Kontrolle der Token-Nutzung.", + "settings.diagnosticsFilter.description": "Diagnosen nach Code oder Quelle filtern. Fügen Sie Diagnosecodes hinzu (z.B. 'dart Error', 'eslint/no-unused-vars'), um bestimmte Typen auszuschließen." } diff --git a/src/package.nls.es.json b/src/package.nls.es.json index 1b3e09c17b..3af441be18 100644 --- a/src/package.nls.es.json +++ b/src/package.nls.es.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "El proveedor del modelo de lenguaje (ej. copilot)", "settings.vsCodeLmModelSelector.family.description": "La familia del modelo de lenguaje (ej. gpt-4)", "settings.customStoragePath.description": "Ruta de almacenamiento personalizada. Dejar vacío para usar la ubicación predeterminada. Admite rutas absolutas (ej. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Habilitar Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Habilitar Roo Code Cloud.", + "settings.includeDiagnostics.description": "Incluir diagnósticos (errores/advertencias) en las solicitudes de API. Desactívalo al crear funciones de varios archivos para evitar que errores temporales distraigan a la IA.", + "settings.maxDiagnosticsCount.description": "Número máximo de diagnósticos a incluir en las solicitudes de API (0 para ilimitado). Ayuda a controlar el uso de tokens.", + "settings.diagnosticsFilter.description": "Filtrar diagnósticos por código o fuente. Agrega códigos de diagnóstico (ej., 'dart Error', 'eslint/no-unused-vars') para excluir tipos específicos." } diff --git a/src/package.nls.fr.json b/src/package.nls.fr.json index 0782ecab05..c48312d0f5 100644 --- a/src/package.nls.fr.json +++ b/src/package.nls.fr.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Le fournisseur du modèle de langage (ex: copilot)", "settings.vsCodeLmModelSelector.family.description": "La famille du modèle de langage (ex: gpt-4)", "settings.customStoragePath.description": "Chemin de stockage personnalisé. Laisser vide pour utiliser l'emplacement par défaut. Prend en charge les chemins absolus (ex: 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Activer Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Activer Roo Code Cloud.", + "settings.includeDiagnostics.description": "Inclure les diagnostics (erreurs/avertissements) dans les requêtes API. Désactivez cette option lors de la création de fonctionnalités multi-fichiers pour éviter que des erreurs temporaires ne distraient l'IA.", + "settings.maxDiagnosticsCount.description": "Nombre maximum de diagnostics à inclure dans les requêtes API (0 pour illimité). Aide à contrôler l'utilisation des jetons.", + "settings.diagnosticsFilter.description": "Filtrer les diagnostics par code ou source. Ajoutez des codes de diagnostic (par exemple, 'dart Error', 'eslint/no-unused-vars') pour exclure des types spécifiques." } diff --git a/src/package.nls.hi.json b/src/package.nls.hi.json index a1855f4cb6..0e558320a0 100644 --- a/src/package.nls.hi.json +++ b/src/package.nls.hi.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "भाषा मॉडल का विक्रेता (उदा. copilot)", "settings.vsCodeLmModelSelector.family.description": "भाषा मॉडल का परिवार (उदा. gpt-4)", "settings.customStoragePath.description": "कस्टम स्टोरेज पाथ। डिफ़ॉल्ट स्थान का उपयोग करने के लिए खाली छोड़ें। पूर्ण पथ का समर्थन करता है (उदा. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Roo Code Cloud सक्षम करें।" + "settings.rooCodeCloudEnabled.description": "Roo Code Cloud सक्षम करें।", + "settings.includeDiagnostics.description": "API अनुरोधों में निदान (त्रुटियाँ/चेतावनी) शामिल करें। अस्थायी त्रुटियों को AI को विचलित करने से बचाने के लिए मल्टी-फ़ाइल सुविधाएँ बनाते समय इसे अक्षम करें।", + "settings.maxDiagnosticsCount.description": "API अनुरोधों में शामिल करने के लिए निदान की अधिकतम संख्या (असीमित के लिए 0)। टोकन उपयोग को नियंत्रित करने में मदद करता है।", + "settings.diagnosticsFilter.description": "कोड या स्रोत द्वारा निदान फ़िल्टर करें। विशिष्ट प्रकारों को बाहर करने के लिए निदान कोड (जैसे, 'dart Error', 'eslint/no-unused-vars') जोड़ें।" } diff --git a/src/package.nls.id.json b/src/package.nls.id.json index 56685d86a5..efff3087e0 100644 --- a/src/package.nls.id.json +++ b/src/package.nls.id.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Vendor dari model bahasa (misalnya copilot)", "settings.vsCodeLmModelSelector.family.description": "Keluarga dari model bahasa (misalnya gpt-4)", "settings.customStoragePath.description": "Path penyimpanan kustom. Biarkan kosong untuk menggunakan lokasi default. Mendukung path absolut (misalnya 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Aktifkan Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Aktifkan Roo Code Cloud.", + "settings.includeDiagnostics.description": "Sertakan diagnostik (kesalahan/peringatan) dalam permintaan API. Nonaktifkan ini saat membuat fitur multi-file untuk menghindari kesalahan sementara mengganggu AI.", + "settings.maxDiagnosticsCount.description": "Jumlah maksimum diagnostik yang akan disertakan dalam permintaan API (0 untuk tidak terbatas). Membantu mengontrol penggunaan token.", + "settings.diagnosticsFilter.description": "Filter diagnostik berdasarkan kode atau sumber. Tambahkan kode diagnostik (misalnya, 'dart Error', 'eslint/no-unused-vars') untuk mengecualikan jenis tertentu." } diff --git a/src/package.nls.it.json b/src/package.nls.it.json index 0d491db802..8170939fd5 100644 --- a/src/package.nls.it.json +++ b/src/package.nls.it.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Il fornitore del modello linguistico (es. copilot)", "settings.vsCodeLmModelSelector.family.description": "La famiglia del modello linguistico (es. gpt-4)", "settings.customStoragePath.description": "Percorso di archiviazione personalizzato. Lasciare vuoto per utilizzare la posizione predefinita. Supporta percorsi assoluti (es. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Abilita Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Abilita Roo Code Cloud.", + "settings.includeDiagnostics.description": "Includi diagnostica (errori/avvisi) nelle richieste API. Disabilita questa opzione quando crei funzionalità multi-file per evitare che errori temporanei distraggano l'IA.", + "settings.maxDiagnosticsCount.description": "Numero massimo di diagnostiche da includere nelle richieste API (0 per illimitato). Aiuta a controllare l'utilizzo dei token.", + "settings.diagnosticsFilter.description": "Filtra le diagnostiche per codice o fonte. Aggiungi codici di diagnostica (ad es. 'dart Error', 'eslint/no-unused-vars') per escludere tipi specifici." } diff --git a/src/package.nls.ja.json b/src/package.nls.ja.json index 0f8949b1f7..ae929d7037 100644 --- a/src/package.nls.ja.json +++ b/src/package.nls.ja.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "言語モデルのベンダー(例:copilot)", "settings.vsCodeLmModelSelector.family.description": "言語モデルのファミリー(例:gpt-4)", "settings.customStoragePath.description": "カスタムストレージパス。デフォルトの場所を使用する場合は空のままにします。絶対パスをサポートします(例:'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Roo Code Cloud を有効にする。" + "settings.rooCodeCloudEnabled.description": "Roo Code Cloud を有効にする。", + "settings.includeDiagnostics.description": "APIリクエストに診断(エラー/警告)を含めます。複数ファイルの機能を作成する際に、一時的なエラーがAIの邪魔をしないようにこれを無効にします。", + "settings.maxDiagnosticsCount.description": "APIリクエストに含める診断の最大数(0で無制限)。トークンの使用量を制御するのに役立ちます。", + "settings.diagnosticsFilter.description": "コードまたはソースで診断をフィルタリングします。特定のタイプを除外するために診断コード(例:「dart Error」、「eslint/no-unused-vars」)を追加します。" } diff --git a/src/package.nls.json b/src/package.nls.json index b05dac3b36..4dd7f9ffd3 100644 --- a/src/package.nls.json +++ b/src/package.nls.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "The vendor of the language model (e.g. copilot)", "settings.vsCodeLmModelSelector.family.description": "The family of the language model (e.g. gpt-4)", "settings.customStoragePath.description": "Custom storage path. Leave empty to use the default location. Supports absolute paths (e.g. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Enable Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Enable Roo Code Cloud.", + "settings.includeDiagnostics.description": "Include diagnostics (errors/warnings) in API requests. Disable this when creating multi-file features to avoid temporary errors distracting the AI.", + "settings.maxDiagnosticsCount.description": "Maximum number of diagnostics to include in API requests (0 for unlimited). Helps control token usage.", + "settings.diagnosticsFilter.description": "Filter diagnostics by code or source. Add diagnostic codes (e.g., 'dart Error', 'eslint/no-unused-vars') to exclude specific types." } diff --git a/src/package.nls.ko.json b/src/package.nls.ko.json index beddd14f83..3a3a0e9e6d 100644 --- a/src/package.nls.ko.json +++ b/src/package.nls.ko.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "언어 모델 공급자 (예: copilot)", "settings.vsCodeLmModelSelector.family.description": "언어 모델 계열 (예: gpt-4)", "settings.customStoragePath.description": "사용자 지정 저장소 경로. 기본 위치를 사용하려면 비워두세요. 절대 경로를 지원합니다 (예: 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Roo Code Cloud 사용 설정" + "settings.rooCodeCloudEnabled.description": "Roo Code Cloud 사용 설정", + "settings.includeDiagnostics.description": "API 요청에 진단(오류/경고)을 포함합니다. 다중 파일 기능을 만들 때 임시 오류가 AI를 방해하지 않도록 이 기능을 비활성화하세요.", + "settings.maxDiagnosticsCount.description": "API 요청에 포함할 최대 진단 수(0은 무제한). 토큰 사용량을 제어하는 데 도움이 됩니다.", + "settings.diagnosticsFilter.description": "코드 또는 소스별로 진단을 필터링합니다. 특정 유형을 제외하려면 진단 코드(예: 'dart Error', 'eslint/no-unused-vars')를 추가하세요." } diff --git a/src/package.nls.nl.json b/src/package.nls.nl.json index 6ef27343c7..9db4015f4b 100644 --- a/src/package.nls.nl.json +++ b/src/package.nls.nl.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "De leverancier van het taalmodel (bijv. copilot)", "settings.vsCodeLmModelSelector.family.description": "De familie van het taalmodel (bijv. gpt-4)", "settings.customStoragePath.description": "Aangepast opslagpad. Laat leeg om de standaardlocatie te gebruiken. Ondersteunt absolute paden (bijv. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Roo Code Cloud inschakelen." + "settings.rooCodeCloudEnabled.description": "Roo Code Cloud inschakelen.", + "settings.includeDiagnostics.description": "Diagnostiek (fouten/waarschuwingen) opnemen in API-verzoeken. Schakel dit uit bij het maken van functies met meerdere bestanden om te voorkomen dat tijdelijke fouten de AI afleiden.", + "settings.maxDiagnosticsCount.description": "Maximum aantal diagnostische gegevens dat in API-verzoeken moet worden opgenomen (0 voor onbeperkt). Helpt het tokengebruik te beheersen.", + "settings.diagnosticsFilter.description": "Filter diagnostiek op code of bron. Voeg diagnostische codes toe (bijv. 'dart Error', 'eslint/no-unused-vars') om specifieke typen uit te sluiten." } diff --git a/src/package.nls.pl.json b/src/package.nls.pl.json index 1565299f43..30ecd0540b 100644 --- a/src/package.nls.pl.json +++ b/src/package.nls.pl.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Dostawca modelu językowego (np. copilot)", "settings.vsCodeLmModelSelector.family.description": "Rodzina modelu językowego (np. gpt-4)", "settings.customStoragePath.description": "Niestandardowa ścieżka przechowywania. Pozostaw puste, aby użyć domyślnej lokalizacji. Obsługuje ścieżki bezwzględne (np. 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Włącz Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Włącz Roo Code Cloud.", + "settings.includeDiagnostics.description": "Dołącz diagnostykę (błędy/ostrzeżenia) do żądań API. Wyłącz tę opcję podczas tworzenia funkcji wieloplikowych, aby uniknąć rozpraszania AI przez tymczasowe błędy.", + "settings.maxDiagnosticsCount.description": "Maksymalna liczba diagnostyk do uwzględnienia w żądaniach API (0 dla nieograniczonej). Pomaga kontrolować zużycie tokenów.", + "settings.diagnosticsFilter.description": "Filtruj diagnostykę według kodu lub źródła. Dodaj kody diagnostyczne (np. 'dart Error', 'eslint/no-unused-vars'), aby wykluczyć określone typy." } diff --git a/src/package.nls.pt-BR.json b/src/package.nls.pt-BR.json index ce21b7d7f6..472c320fac 100644 --- a/src/package.nls.pt-BR.json +++ b/src/package.nls.pt-BR.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "O fornecedor do modelo de linguagem (ex: copilot)", "settings.vsCodeLmModelSelector.family.description": "A família do modelo de linguagem (ex: gpt-4)", "settings.customStoragePath.description": "Caminho de armazenamento personalizado. Deixe vazio para usar o local padrão. Suporta caminhos absolutos (ex: 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Habilitar Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Habilitar Roo Code Cloud.", + "settings.includeDiagnostics.description": "Incluir diagnósticos (erros/avisos) nas solicitações de API. Desative isso ao criar recursos de vários arquivos para evitar que erros temporários distraiam a IA.", + "settings.maxDiagnosticsCount.description": "Número máximo de diagnósticos a serem incluídos nas solicitações de API (0 para ilimitado). Ajuda a controlar o uso de tokens.", + "settings.diagnosticsFilter.description": "Filtrar diagnósticos por código ou fonte. Adicione códigos de diagnóstico (por exemplo, 'dart Error', 'eslint/no-unused-vars') para excluir tipos específicos." } diff --git a/src/package.nls.ru.json b/src/package.nls.ru.json index 5c2b6a030b..0abdaea74c 100644 --- a/src/package.nls.ru.json +++ b/src/package.nls.ru.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Поставщик языковой модели (например, copilot)", "settings.vsCodeLmModelSelector.family.description": "Семейство языковой модели (например, gpt-4)", "settings.customStoragePath.description": "Пользовательский путь хранения. Оставьте пустым для использования пути по умолчанию. Поддерживает абсолютные пути (например, 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Включить Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Включить Roo Code Cloud.", + "settings.includeDiagnostics.description": "Включать диагностику (ошибки/предупреждения) в запросы API. Отключите это при создании многофайловых функций, чтобы временные ошибки не отвлекали ИИ.", + "settings.maxDiagnosticsCount.description": "Максимальное количество диагностик для включения в запросы API (0 для неограниченного). Помогает контролировать использование токенов.", + "settings.diagnosticsFilter.description": "Фильтровать диагностику по коду или источнику. Добавьте диагностические коды (например, 'dart Error', 'eslint/no-unused-vars') для исключения определенных типов." } diff --git a/src/package.nls.tr.json b/src/package.nls.tr.json index 59d50324d6..3310042f40 100644 --- a/src/package.nls.tr.json +++ b/src/package.nls.tr.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Dil modelinin sağlayıcısı (örn: copilot)", "settings.vsCodeLmModelSelector.family.description": "Dil modelinin ailesi (örn: gpt-4)", "settings.customStoragePath.description": "Özel depolama yolu. Varsayılan konumu kullanmak için boş bırakın. Mutlak yolları destekler (örn: 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Roo Code Cloud'u Etkinleştir." + "settings.rooCodeCloudEnabled.description": "Roo Code Cloud'u Etkinleştir.", + "settings.includeDiagnostics.description": "API isteklerine tanılama (hatalar/uyarılar) ekleyin. Çok dosyalı özellikler oluştururken geçici hataların yapay zekayı rahatsız etmesini önlemek için bunu devre dışı bırakın.", + "settings.maxDiagnosticsCount.description": "API isteklerine dahil edilecek maksimum tanılama sayısı (sınırsız için 0). Jeton kullanımını kontrol etmeye yardımcı olur.", + "settings.diagnosticsFilter.description": "Tanılamayı koda veya kaynağa göre filtreleyin. Belirli türleri hariç tutmak için tanılama kodları (ör. 'dart Error', 'eslint/no-unused-vars') ekleyin." } diff --git a/src/package.nls.vi.json b/src/package.nls.vi.json index 33f54ebe5c..fac2bd0dd3 100644 --- a/src/package.nls.vi.json +++ b/src/package.nls.vi.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "Nhà cung cấp mô hình ngôn ngữ (ví dụ: copilot)", "settings.vsCodeLmModelSelector.family.description": "Họ mô hình ngôn ngữ (ví dụ: gpt-4)", "settings.customStoragePath.description": "Đường dẫn lưu trữ tùy chỉnh. Để trống để sử dụng vị trí mặc định. Hỗ trợ đường dẫn tuyệt đối (ví dụ: 'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "Bật Roo Code Cloud." + "settings.rooCodeCloudEnabled.description": "Bật Roo Code Cloud.", + "settings.includeDiagnostics.description": "Bao gồm chẩn đoán (lỗi/cảnh báo) trong các yêu cầu API. Tắt tính năng này khi tạo các tính năng đa tệp để tránh các lỗi tạm thời làm phân tâm AI.", + "settings.maxDiagnosticsCount.description": "Số lượng chẩn đoán tối đa để bao gồm trong các yêu cầu API (0 cho không giới hạn). Giúp kiểm soát việc sử dụng mã thông báo.", + "settings.diagnosticsFilter.description": "Lọc chẩn đoán theo mã hoặc nguồn. Thêm mã chẩn đoán (ví dụ: 'dart Error', 'eslint/no-unused-vars') để loại trừ các loại cụ thể." } diff --git a/src/package.nls.zh-CN.json b/src/package.nls.zh-CN.json index ad10328e20..4767f457cd 100644 --- a/src/package.nls.zh-CN.json +++ b/src/package.nls.zh-CN.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "语言模型的供应商(例如:copilot)", "settings.vsCodeLmModelSelector.family.description": "语言模型的系列(例如:gpt-4)", "settings.customStoragePath.description": "自定义存储路径。留空以使用默认位置。支持绝对路径(例如:'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "启用 Roo Code Cloud。" + "settings.rooCodeCloudEnabled.description": "启用 Roo Code Cloud。", + "settings.includeDiagnostics.description": "在 API 请求中包含诊断信息(错误/警告)。在创建多文件功能时禁用此功能,以避免临时错误分散 AI 的注意力。", + "settings.maxDiagnosticsCount.description": "在 API 请求中包含的最大诊断数(0 表示无限制)。有助于控制令牌使用。", + "settings.diagnosticsFilter.description": "按代码或来源筛选诊断信息。添加诊断代码(例如 'dart Error'、'eslint/no-unused-vars')以排除特定类型。" } diff --git a/src/package.nls.zh-TW.json b/src/package.nls.zh-TW.json index b903fc6859..683195da7d 100644 --- a/src/package.nls.zh-TW.json +++ b/src/package.nls.zh-TW.json @@ -30,5 +30,8 @@ "settings.vsCodeLmModelSelector.vendor.description": "語言模型供應商(例如:copilot)", "settings.vsCodeLmModelSelector.family.description": "語言模型系列(例如:gpt-4)", "settings.customStoragePath.description": "自訂儲存路徑。留空以使用預設位置。支援絕對路徑(例如:'D:\\RooCodeStorage')", - "settings.rooCodeCloudEnabled.description": "啟用 Roo Code Cloud。" + "settings.rooCodeCloudEnabled.description": "啟用 Roo Code Cloud。", + "settings.includeDiagnostics.description": "在 API 請求中包含診斷資訊(錯誤/警告)。在建立多檔案功能時停用此功能,以避免暫時性錯誤干擾 AI。", + "settings.maxDiagnosticsCount.description": "在 API 請求中包含的最大診斷數(0 表示無限制)。有助於控制權杖使用。", + "settings.diagnosticsFilter.description": "按代碼或來源篩選診斷資訊。新增診斷代碼(例如 'dart Error'、'eslint/no-unused-vars')以排除特定類型。" } diff --git a/src/shared/ExtensionMessage.ts b/src/shared/ExtensionMessage.ts index ac19ba0ef2..95b0bb4451 100644 --- a/src/shared/ExtensionMessage.ts +++ b/src/shared/ExtensionMessage.ts @@ -177,6 +177,9 @@ export type ExtensionState = Pick< // | "showRooIgnoredFiles" // Optional in GlobalSettings, required here. // | "maxReadFileLine" // Optional in GlobalSettings, required here. | "maxConcurrentFileReads" // Optional in GlobalSettings, required here. + | "includeDiagnostics" + | "maxDiagnosticsCount" + | "diagnosticsFilter" | "terminalOutputLineLimit" | "terminalShellIntegrationTimeout" | "terminalShellIntegrationDisabled" @@ -223,6 +226,10 @@ export type ExtensionState = Pick< showRooIgnoredFiles: boolean // Whether to show .rooignore'd files in listings maxReadFileLine: number // Maximum number of lines to read from a file before truncating + includeDiagnostics: boolean // Whether to include diagnostics in context + maxDiagnosticsCount: number // Maximum number of diagnostics to include + diagnosticsFilter: string[] // Filter for diagnostic severities + experiments: Experiments // Map of experiment IDs to their enabled state mcpEnabled: boolean diff --git a/src/shared/WebviewMessage.ts b/src/shared/WebviewMessage.ts index 5186c716b9..c3477a2124 100644 --- a/src/shared/WebviewMessage.ts +++ b/src/shared/WebviewMessage.ts @@ -144,6 +144,9 @@ export interface WebviewMessage { | "language" | "maxReadFileLine" | "maxConcurrentFileReads" + | "includeDiagnostics" + | "maxDiagnosticsCount" + | "diagnosticsFilter" | "searchFiles" | "toggleApiConfigPin" | "setHistoryPreviewCollapsed" diff --git a/webview-ui/src/components/settings/DiagnosticsSettings.tsx b/webview-ui/src/components/settings/DiagnosticsSettings.tsx new file mode 100644 index 0000000000..23e9e0372f --- /dev/null +++ b/webview-ui/src/components/settings/DiagnosticsSettings.tsx @@ -0,0 +1,109 @@ +import { HTMLAttributes } from "react" +import { useAppTranslation } from "@/i18n/TranslationContext" +import { VSCodeCheckbox } from "@vscode/webview-ui-toolkit/react" +import { AlertCircle } from "lucide-react" + +import { cn } from "@/lib/utils" +import { Input, Slider } from "@/components/ui" + +import { SetCachedStateField } from "./types" +import { SectionHeader } from "./SectionHeader" +import { Section } from "./Section" + +type DiagnosticsSettingsProps = HTMLAttributes & { + includeDiagnostics?: boolean + maxDiagnosticsCount?: number + diagnosticsFilter?: string[] + setCachedStateField: SetCachedStateField<"includeDiagnostics" | "maxDiagnosticsCount" | "diagnosticsFilter"> +} + +export const DiagnosticsSettings = ({ + includeDiagnostics, + maxDiagnosticsCount, + diagnosticsFilter, + setCachedStateField, + className, + ...props +}: DiagnosticsSettingsProps) => { + const { t } = useAppTranslation() + + const handleFilterChange = (value: string) => { + const filters = value + .split(",") + .map((f) => f.trim()) + .filter((f) => f.length > 0) + setCachedStateField("diagnosticsFilter", filters) + } + + return ( +
+ +
+ +
{t("settings:sections.diagnostics")}
+
+
+ +
+
+ setCachedStateField("includeDiagnostics", e.target.checked)} + data-testid="include-diagnostics-checkbox"> + + +
+ {t("settings:diagnostics.includeDiagnostics.description")} +
+
+ + {includeDiagnostics && ( +
+
+ + {t("settings:diagnostics.maxDiagnosticsCount.label")} + +
+ { + if (value >= 0 && value <= 200) { + setCachedStateField("maxDiagnosticsCount", value) + } + }} + data-testid="max-diagnostics-count-slider" + /> + {maxDiagnosticsCount ?? 50} +
+
+ {t("settings:diagnostics.maxDiagnosticsCount.description")} +
+
+ +
+ + {t("settings:diagnostics.diagnosticsFilter.label")} + + handleFilterChange(e.target.value)} + placeholder="e.g., dart Error, eslint/no-unused-vars" + data-testid="diagnostics-filter-input" + /> +
+ {t("settings:diagnostics.diagnosticsFilter.description")} +
+
+
+ )} +
+
+ ) +} diff --git a/webview-ui/src/components/settings/SettingsView.tsx b/webview-ui/src/components/settings/SettingsView.tsx index 5a330c8996..a383b5142c 100644 --- a/webview-ui/src/components/settings/SettingsView.tsx +++ b/webview-ui/src/components/settings/SettingsView.tsx @@ -64,6 +64,7 @@ import { LanguageSettings } from "./LanguageSettings" import { About } from "./About" import { Section } from "./Section" import PromptsSettings from "./PromptsSettings" +import { DiagnosticsSettings } from "./DiagnosticsSettings" import { cn } from "@/lib/utils" export const settingsTabsContainer = "flex flex-1 overflow-hidden [&.narrow_.tab-label]:hidden" @@ -84,6 +85,7 @@ const sectionNames = [ "checkpoints", "notifications", "contextManagement", + "diagnostics", "terminal", "prompts", "experimental", @@ -172,6 +174,9 @@ const SettingsView = forwardRef(({ onDone, t codebaseIndexConfig, codebaseIndexModels, customSupportPrompts, + includeDiagnostics, + maxDiagnosticsCount, + diagnosticsFilter, } = cachedState const apiConfiguration = useMemo(() => cachedState.apiConfiguration ?? {}, [cachedState.apiConfiguration]) @@ -315,6 +320,9 @@ const SettingsView = forwardRef(({ onDone, t vscode.postMessage({ type: "upsertApiConfiguration", text: currentApiConfigName, apiConfiguration }) vscode.postMessage({ type: "telemetrySetting", text: telemetrySetting }) vscode.postMessage({ type: "codebaseIndexConfig", values: codebaseIndexConfig }) + vscode.postMessage({ type: "includeDiagnostics", bool: includeDiagnostics }) + vscode.postMessage({ type: "maxDiagnosticsCount", value: maxDiagnosticsCount }) + vscode.postMessage({ type: "diagnosticsFilter", values: diagnosticsFilter }) setChangeDetected(false) } } @@ -390,6 +398,7 @@ const SettingsView = forwardRef(({ onDone, t { id: "checkpoints", icon: GitBranch }, { id: "notifications", icon: Bell }, { id: "contextManagement", icon: Database }, + { id: "diagnostics", icon: AlertTriangle }, { id: "terminal", icon: SquareTerminal }, { id: "prompts", icon: MessageSquare }, { id: "experimental", icon: FlaskConical }, @@ -648,6 +657,16 @@ const SettingsView = forwardRef(({ onDone, t /> )} + {/* Diagnostics Section */} + {activeTab === "diagnostics" && ( + + )} + {/* Terminal Section */} {activeTab === "terminal" && ( ({ + useAppTranslation: () => ({ + t: (key: string) => key, + }), +})) + +// Mock VSCode components +jest.mock("@vscode/webview-ui-toolkit/react", () => ({ + VSCodeCheckbox: ({ children, onChange, checked, ...props }: any) => ( + + ), +})) + +// Mock Slider component +jest.mock("@src/components/ui/slider", () => ({ + Slider: ({ value, onValueChange, min, max, ...props }: any) => ( + onValueChange([parseInt(e.target.value)])} + min={min} + max={max} + {...props} + /> + ), +})) + +// Mock Input component +jest.mock("@src/components/ui/input", () => ({ + Input: (props: any) => , +})) + +// Mock SectionHeader component +jest.mock("../SectionHeader", () => ({ + SectionHeader: ({ children, description }: any) => ( +
+
{children}
+ {description &&
{description}
} +
+ ), +})) + +// Mock Section component +jest.mock("../Section", () => ({ + Section: ({ children }: any) =>
{children}
, +})) + +describe("DiagnosticsSettings", () => { + const mockSetCachedStateField = jest.fn() + + const defaultProps = { + includeDiagnostics: false, + maxDiagnosticsCount: 50, + diagnosticsFilter: ["error", "warning"], + setCachedStateField: mockSetCachedStateField, + } + + beforeEach(() => { + jest.clearAllMocks() + }) + + it("renders all diagnostic settings", () => { + render() + + expect(screen.getByText("settings:sections.diagnostics")).toBeInTheDocument() + expect(screen.getByText("settings:diagnostics.description")).toBeInTheDocument() + expect(screen.getByTestId("include-diagnostics-checkbox")).toBeInTheDocument() + expect(screen.getByTestId("max-diagnostics-count-slider")).toBeInTheDocument() + expect(screen.getByTestId("diagnostics-filter-input")).toBeInTheDocument() + }) + + it("displays current values correctly", () => { + render() + + const checkbox = screen.getByTestId("include-diagnostics-checkbox") as HTMLInputElement + expect(checkbox.checked).toBe(true) + + const slider = screen.getByTestId("max-diagnostics-count-slider") as HTMLInputElement + expect(slider.value).toBe("50") + + const filterInput = screen.getByTestId("diagnostics-filter-input") as HTMLInputElement + expect(filterInput.value).toBe("error, warning") + }) + + it("calls setCachedStateField when checkbox is toggled", () => { + render() + + // The mock renders the input with data-testid + const checkbox = screen.getByTestId("include-diagnostics-checkbox") as HTMLInputElement + + // Verify it's unchecked initially + expect(checkbox.checked).toBe(false) + + // Toggle the checkbox + fireEvent.click(checkbox) + + expect(mockSetCachedStateField).toHaveBeenCalledWith("includeDiagnostics", true) + }) + + it("calls setCachedStateField when slider value changes", () => { + render() + + const slider = screen.getByTestId("max-diagnostics-count-slider") + fireEvent.change(slider, { target: { value: "75" } }) + + expect(mockSetCachedStateField).toHaveBeenCalledWith("maxDiagnosticsCount", 75) + }) + + it("validates slider value range", () => { + render() + + const slider = screen.getByTestId("max-diagnostics-count-slider") + + // Test value above max + fireEvent.change(slider, { target: { value: "250" } }) + expect(mockSetCachedStateField).not.toHaveBeenCalledWith("maxDiagnosticsCount", 250) + + // Test negative value + fireEvent.change(slider, { target: { value: "-10" } }) + expect(mockSetCachedStateField).not.toHaveBeenCalledWith("maxDiagnosticsCount", -10) + + // Test valid value + fireEvent.change(slider, { target: { value: "100" } }) + expect(mockSetCachedStateField).toHaveBeenCalledWith("maxDiagnosticsCount", 100) + }) + + it("calls setCachedStateField when filter input changes", () => { + render() + + const filterInput = screen.getByTestId("diagnostics-filter-input") + fireEvent.change(filterInput, { target: { value: "eslint, typescript" } }) + + expect(mockSetCachedStateField).toHaveBeenCalledWith("diagnosticsFilter", ["eslint", "typescript"]) + }) + + it("handles empty filter input", () => { + render() + + const filterInput = screen.getByTestId("diagnostics-filter-input") + fireEvent.change(filterInput, { target: { value: "" } }) + + expect(mockSetCachedStateField).toHaveBeenCalledWith("diagnosticsFilter", []) + }) + + it("trims whitespace from filter values", () => { + render() + + const filterInput = screen.getByTestId("diagnostics-filter-input") + fireEvent.change(filterInput, { target: { value: " eslint , typescript " } }) + + expect(mockSetCachedStateField).toHaveBeenCalledWith("diagnosticsFilter", ["eslint", "typescript"]) + }) + + it("renders with undefined props", () => { + render() + + const checkbox = screen.getByTestId("include-diagnostics-checkbox") as HTMLInputElement + expect(checkbox.checked).toBe(false) + + // Slider and filter input won't be rendered when includeDiagnostics is false/undefined + expect(screen.queryByTestId("max-diagnostics-count-slider")).not.toBeInTheDocument() + expect(screen.queryByTestId("diagnostics-filter-input")).not.toBeInTheDocument() + }) + + it("shows/hides additional settings based on checkbox state", () => { + const { rerender } = render() + + // Initially hidden + expect(screen.queryByTestId("max-diagnostics-count-slider")).not.toBeInTheDocument() + expect(screen.queryByTestId("diagnostics-filter-input")).not.toBeInTheDocument() + + // Show when checkbox is checked + rerender() + expect(screen.getByTestId("max-diagnostics-count-slider")).toBeInTheDocument() + expect(screen.getByTestId("diagnostics-filter-input")).toBeInTheDocument() + }) + + it("displays correct count value next to slider", () => { + render() + + expect(screen.getByText("75")).toBeInTheDocument() + }) + + it("applies custom className", () => { + const { container } = render() + + const rootElement = container.firstChild as HTMLElement + expect(rootElement).toHaveClass("custom-class") + }) +}) diff --git a/webview-ui/src/context/ExtensionStateContext.tsx b/webview-ui/src/context/ExtensionStateContext.tsx index ab79f63df8..d8fdc9b1c4 100644 --- a/webview-ui/src/context/ExtensionStateContext.tsx +++ b/webview-ui/src/context/ExtensionStateContext.tsx @@ -118,6 +118,12 @@ export interface ExtensionStateContextType extends ExtensionState { autoCondenseContextPercent: number setAutoCondenseContextPercent: (value: number) => void routerModels?: RouterModels + includeDiagnostics: boolean + setIncludeDiagnostics: (value: boolean) => void + maxDiagnosticsCount: number + setMaxDiagnosticsCount: (value: number) => void + diagnosticsFilter: string[] + setDiagnosticsFilter: (value: string[]) => void } export const ExtensionStateContext = createContext(undefined) @@ -206,6 +212,9 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode codebaseIndexEmbedderModelId: "", }, codebaseIndexModels: { ollama: {}, openai: {} }, + includeDiagnostics: false, + maxDiagnosticsCount: 5, + diagnosticsFilter: ["error", "warning"], }) const [didHydrateState, setDidHydrateState] = useState(false) @@ -403,6 +412,9 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode setCondensingApiConfigId: (value) => setState((prevState) => ({ ...prevState, condensingApiConfigId: value })), setCustomCondensingPrompt: (value) => setState((prevState) => ({ ...prevState, customCondensingPrompt: value })), + setIncludeDiagnostics: (value) => setState((prevState) => ({ ...prevState, includeDiagnostics: value })), + setMaxDiagnosticsCount: (value) => setState((prevState) => ({ ...prevState, maxDiagnosticsCount: value })), + setDiagnosticsFilter: (value) => setState((prevState) => ({ ...prevState, diagnosticsFilter: value })), } return {children} diff --git a/webview-ui/src/context/__tests__/ExtensionStateContext.test.tsx b/webview-ui/src/context/__tests__/ExtensionStateContext.test.tsx index b8a6cadf98..7e9fab8dad 100644 --- a/webview-ui/src/context/__tests__/ExtensionStateContext.test.tsx +++ b/webview-ui/src/context/__tests__/ExtensionStateContext.test.tsx @@ -209,6 +209,9 @@ describe("mergeExtensionState", () => { autoCondenseContextPercent: 100, cloudIsAuthenticated: false, sharingEnabled: false, + includeDiagnostics: false, + maxDiagnosticsCount: 5, + diagnosticsFilter: ["error", "warning"], } const prevState: ExtensionState = { diff --git a/webview-ui/src/i18n/locales/ca/settings.json b/webview-ui/src/i18n/locales/ca/settings.json index c88005ea61..88cd891486 100644 --- a/webview-ui/src/i18n/locales/ca/settings.json +++ b/webview-ui/src/i18n/locales/ca/settings.json @@ -31,7 +31,8 @@ "prompts": "Indicacions", "experimental": "Experimental", "language": "Idioma", - "about": "Sobre Roo Code" + "about": "Sobre Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Configura les indicacions de suport utilitzades per a accions ràpides com millorar indicacions, explicar codi i solucionar problemes. Aquestes indicacions ajuden Roo a proporcionar millor assistència per a tasques comunes de desenvolupament." @@ -614,6 +615,21 @@ "customArn": "ARN personalitzat", "useCustomArn": "Utilitza ARN personalitzat..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Incloure tokens màxims de sortida", "includeMaxOutputTokensDescription": "Enviar el paràmetre de tokens màxims de sortida a les sol·licituds API. Alguns proveïdors poden no admetre això." } diff --git a/webview-ui/src/i18n/locales/de/settings.json b/webview-ui/src/i18n/locales/de/settings.json index 27a7486436..4de34ea44f 100644 --- a/webview-ui/src/i18n/locales/de/settings.json +++ b/webview-ui/src/i18n/locales/de/settings.json @@ -31,7 +31,8 @@ "prompts": "Eingabeaufforderungen", "experimental": "Experimentell", "language": "Sprache", - "about": "Über Roo Code" + "about": "Über Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Konfiguriere Support-Prompts, die für schnelle Aktionen wie das Verbessern von Prompts, das Erklären von Code und das Beheben von Problemen verwendet werden. Diese Prompts helfen Roo dabei, bessere Unterstützung für häufige Entwicklungsaufgaben zu bieten." @@ -614,6 +615,21 @@ "customArn": "Benutzerdefinierte ARN", "useCustomArn": "Benutzerdefinierte ARN verwenden..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Maximale Ausgabe-Tokens einbeziehen", "includeMaxOutputTokensDescription": "Sende den Parameter für maximale Ausgabe-Tokens in API-Anfragen. Einige Anbieter unterstützen dies möglicherweise nicht." } diff --git a/webview-ui/src/i18n/locales/en/settings.json b/webview-ui/src/i18n/locales/en/settings.json index b8e51afc50..555aed1c84 100644 --- a/webview-ui/src/i18n/locales/en/settings.json +++ b/webview-ui/src/i18n/locales/en/settings.json @@ -27,6 +27,7 @@ "checkpoints": "Checkpoints", "notifications": "Notifications", "contextManagement": "Context", + "diagnostics": "Diagnostics", "terminal": "Terminal", "prompts": "Prompts", "experimental": "Experimental", @@ -395,6 +396,21 @@ "always_full_read": "Always read entire file" } }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "terminal": { "basic": { "label": "Terminal Settings: Basic", diff --git a/webview-ui/src/i18n/locales/es/settings.json b/webview-ui/src/i18n/locales/es/settings.json index db8b4736eb..0d787a2c53 100644 --- a/webview-ui/src/i18n/locales/es/settings.json +++ b/webview-ui/src/i18n/locales/es/settings.json @@ -31,7 +31,8 @@ "prompts": "Indicaciones", "experimental": "Experimental", "language": "Idioma", - "about": "Acerca de Roo Code" + "about": "Acerca de Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Configura indicaciones de soporte que se utilizan para acciones rápidas como mejorar indicaciones, explicar código y solucionar problemas. Estas indicaciones ayudan a Roo a brindar mejor asistencia para tareas comunes de desarrollo." @@ -614,6 +615,21 @@ "customArn": "ARN personalizado", "useCustomArn": "Usar ARN personalizado..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Incluir tokens máximos de salida", "includeMaxOutputTokensDescription": "Enviar parámetro de tokens máximos de salida en solicitudes API. Algunos proveedores pueden no soportar esto." } diff --git a/webview-ui/src/i18n/locales/fr/settings.json b/webview-ui/src/i18n/locales/fr/settings.json index 0bf837accb..df8d67848d 100644 --- a/webview-ui/src/i18n/locales/fr/settings.json +++ b/webview-ui/src/i18n/locales/fr/settings.json @@ -31,7 +31,8 @@ "prompts": "Invites", "experimental": "Expérimental", "language": "Langue", - "about": "À propos de Roo Code" + "about": "À propos de Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Configurez les invites de support utilisées pour les actions rapides comme l'amélioration des invites, l'explication du code et la résolution des problèmes. Ces invites aident Roo à fournir une meilleure assistance pour les tâches de développement courantes." @@ -614,6 +615,21 @@ "customArn": "ARN personnalisé", "useCustomArn": "Utiliser un ARN personnalisé..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Inclure les tokens de sortie maximum", "includeMaxOutputTokensDescription": "Envoyer le paramètre de tokens de sortie maximum dans les requêtes API. Certains fournisseurs peuvent ne pas supporter cela." } diff --git a/webview-ui/src/i18n/locales/hi/settings.json b/webview-ui/src/i18n/locales/hi/settings.json index fec1b27007..b90dc83e69 100644 --- a/webview-ui/src/i18n/locales/hi/settings.json +++ b/webview-ui/src/i18n/locales/hi/settings.json @@ -31,7 +31,8 @@ "prompts": "प्रॉम्प्ट्स", "experimental": "प्रायोगिक", "language": "भाषा", - "about": "परिचय" + "about": "परिचय", + "diagnostics": "Diagnostics" }, "prompts": { "description": "प्रॉम्प्ट्स को बेहतर बनाना, कोड की व्याख्या करना और समस्याओं को ठीक करना जैसी त्वरित कार्रवाइयों के लिए उपयोग किए जाने वाले सहायक प्रॉम्प्ट्स को कॉन्फ़िगर करें। ये प्रॉम्प्ट्स Roo को सामान्य विकास कार्यों के लिए बेहतर सहायता प्रदान करने में मदद करते हैं।" @@ -614,6 +615,21 @@ "customArn": "कस्टम ARN", "useCustomArn": "कस्टम ARN का उपयोग करें..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "अधिकतम आउटपुट टोकन शामिल करें", "includeMaxOutputTokensDescription": "API अनुरोधों में अधिकतम आउटपुट टोकन पैरामीटर भेजें। कुछ प्रदाता इसका समर्थन नहीं कर सकते हैं।" } diff --git a/webview-ui/src/i18n/locales/id/settings.json b/webview-ui/src/i18n/locales/id/settings.json index 6d6a8e93b1..9989d89ec6 100644 --- a/webview-ui/src/i18n/locales/id/settings.json +++ b/webview-ui/src/i18n/locales/id/settings.json @@ -31,7 +31,8 @@ "prompts": "Prompt", "experimental": "Eksperimental", "language": "Bahasa", - "about": "Tentang Roo Code" + "about": "Tentang Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Konfigurasi support prompt yang digunakan untuk aksi cepat seperti meningkatkan prompt, menjelaskan kode, dan memperbaiki masalah. Prompt ini membantu Roo memberikan bantuan yang lebih baik untuk tugas pengembangan umum." @@ -643,6 +644,21 @@ "customArn": "ARN Kustom", "useCustomArn": "Gunakan ARN kustom..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Sertakan token output maksimum", "includeMaxOutputTokensDescription": "Kirim parameter token output maksimum dalam permintaan API. Beberapa provider mungkin tidak mendukung ini." } diff --git a/webview-ui/src/i18n/locales/it/settings.json b/webview-ui/src/i18n/locales/it/settings.json index fcb389a4a7..509c4a9f2d 100644 --- a/webview-ui/src/i18n/locales/it/settings.json +++ b/webview-ui/src/i18n/locales/it/settings.json @@ -31,7 +31,8 @@ "prompts": "Prompt", "experimental": "Sperimentale", "language": "Lingua", - "about": "Informazioni su Roo Code" + "about": "Informazioni su Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Configura i prompt di supporto utilizzati per azioni rapide come il miglioramento dei prompt, la spiegazione del codice e la risoluzione dei problemi. Questi prompt aiutano Roo a fornire una migliore assistenza per le attività di sviluppo comuni." @@ -614,6 +615,21 @@ "customArn": "ARN personalizzato", "useCustomArn": "Usa ARN personalizzato..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Includi token di output massimi", "includeMaxOutputTokensDescription": "Invia il parametro dei token di output massimi nelle richieste API. Alcuni provider potrebbero non supportarlo." } diff --git a/webview-ui/src/i18n/locales/ja/settings.json b/webview-ui/src/i18n/locales/ja/settings.json index eabd751308..7f1481ac56 100644 --- a/webview-ui/src/i18n/locales/ja/settings.json +++ b/webview-ui/src/i18n/locales/ja/settings.json @@ -31,7 +31,8 @@ "prompts": "プロンプト", "experimental": "実験的", "language": "言語", - "about": "Roo Codeについて" + "about": "Roo Codeについて", + "diagnostics": "Diagnostics" }, "prompts": { "description": "プロンプトの強化、コードの説明、問題の修正などの迅速なアクションに使用されるサポートプロンプトを設定します。これらのプロンプトは、Rooが一般的な開発タスクでより良いサポートを提供するのに役立ちます。" @@ -614,6 +615,21 @@ "customArn": "カスタム ARN", "useCustomArn": "カスタム ARN を使用..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "最大出力トークンを含める", "includeMaxOutputTokensDescription": "APIリクエストで最大出力トークンパラメータを送信します。一部のプロバイダーはこれをサポートしていない場合があります。" } diff --git a/webview-ui/src/i18n/locales/ko/settings.json b/webview-ui/src/i18n/locales/ko/settings.json index 68ca2a963c..6fb5155d8b 100644 --- a/webview-ui/src/i18n/locales/ko/settings.json +++ b/webview-ui/src/i18n/locales/ko/settings.json @@ -31,7 +31,8 @@ "prompts": "프롬프트", "experimental": "실험적", "language": "언어", - "about": "Roo Code 정보" + "about": "Roo Code 정보", + "diagnostics": "Diagnostics" }, "prompts": { "description": "프롬프트 향상, 코드 설명, 문제 해결과 같은 빠른 작업에 사용되는 지원 프롬프트를 구성합니다. 이러한 프롬프트는 Roo가 일반적인 개발 작업에 대해 더 나은 지원을 제공하는 데 도움이 됩니다." @@ -614,6 +615,21 @@ "customArn": "사용자 지정 ARN", "useCustomArn": "사용자 지정 ARN 사용..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "최대 출력 토큰 포함", "includeMaxOutputTokensDescription": "API 요청에서 최대 출력 토큰 매개변수를 전송합니다. 일부 제공업체는 이를 지원하지 않을 수 있습니다." } diff --git a/webview-ui/src/i18n/locales/nl/settings.json b/webview-ui/src/i18n/locales/nl/settings.json index 996c0c673c..d42a02724a 100644 --- a/webview-ui/src/i18n/locales/nl/settings.json +++ b/webview-ui/src/i18n/locales/nl/settings.json @@ -31,7 +31,8 @@ "prompts": "Prompts", "experimental": "Experimenteel", "language": "Taal", - "about": "Over Roo Code" + "about": "Over Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Configureer ondersteuningsprompts die worden gebruikt voor snelle acties zoals het verbeteren van prompts, het uitleggen van code en het oplossen van problemen. Deze prompts helpen Roo om betere ondersteuning te bieden voor veelvoorkomende ontwikkelingstaken." @@ -614,6 +615,21 @@ "customArn": "Aangepaste ARN", "useCustomArn": "Aangepaste ARN gebruiken..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Maximale output tokens opnemen", "includeMaxOutputTokensDescription": "Stuur maximale output tokens parameter in API-verzoeken. Sommige providers ondersteunen dit mogelijk niet." } diff --git a/webview-ui/src/i18n/locales/pl/settings.json b/webview-ui/src/i18n/locales/pl/settings.json index cf4421e00e..265165b118 100644 --- a/webview-ui/src/i18n/locales/pl/settings.json +++ b/webview-ui/src/i18n/locales/pl/settings.json @@ -31,7 +31,8 @@ "prompts": "Podpowiedzi", "experimental": "Eksperymentalne", "language": "Język", - "about": "O Roo Code" + "about": "O Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Skonfiguruj podpowiedzi wsparcia używane do szybkich działań, takich jak ulepszanie podpowiedzi, wyjaśnianie kodu i rozwiązywanie problemów. Te podpowiedzi pomagają Roo zapewnić lepsze wsparcie dla typowych zadań programistycznych." @@ -614,6 +615,21 @@ "customArn": "Niestandardowy ARN", "useCustomArn": "Użyj niestandardowego ARN..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Uwzględnij maksymalne tokeny wyjściowe", "includeMaxOutputTokensDescription": "Wyślij parametr maksymalnych tokenów wyjściowych w żądaniach API. Niektórzy dostawcy mogą tego nie obsługiwać." } diff --git a/webview-ui/src/i18n/locales/pt-BR/settings.json b/webview-ui/src/i18n/locales/pt-BR/settings.json index 229419dd23..5174c7f15e 100644 --- a/webview-ui/src/i18n/locales/pt-BR/settings.json +++ b/webview-ui/src/i18n/locales/pt-BR/settings.json @@ -31,7 +31,8 @@ "prompts": "Prompts", "experimental": "Experimental", "language": "Idioma", - "about": "Sobre" + "about": "Sobre", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Configure prompts de suporte usados para ações rápidas como melhorar prompts, explicar código e corrigir problemas. Esses prompts ajudam o Roo a fornecer melhor assistência para tarefas comuns de desenvolvimento." @@ -614,6 +615,21 @@ "customArn": "ARN personalizado", "useCustomArn": "Usar ARN personalizado..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Incluir tokens máximos de saída", "includeMaxOutputTokensDescription": "Enviar parâmetro de tokens máximos de saída nas solicitações de API. Alguns provedores podem não suportar isso." } diff --git a/webview-ui/src/i18n/locales/ru/settings.json b/webview-ui/src/i18n/locales/ru/settings.json index dcce5e5b1a..a4f3ac4365 100644 --- a/webview-ui/src/i18n/locales/ru/settings.json +++ b/webview-ui/src/i18n/locales/ru/settings.json @@ -31,7 +31,8 @@ "prompts": "Промпты", "experimental": "Экспериментальное", "language": "Язык", - "about": "О Roo Code" + "about": "О Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Настройте промпты поддержки, используемые для быстрых действий, таких как улучшение промптов, объяснение кода и исправление проблем. Эти промпты помогают Roo обеспечить лучшую поддержку для общих задач разработки." @@ -614,6 +615,21 @@ "customArn": "Пользовательский ARN", "useCustomArn": "Использовать пользовательский ARN..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Включить максимальные выходные токены", "includeMaxOutputTokensDescription": "Отправлять параметр максимальных выходных токенов в API-запросах. Некоторые провайдеры могут не поддерживать это." } diff --git a/webview-ui/src/i18n/locales/tr/settings.json b/webview-ui/src/i18n/locales/tr/settings.json index f8f53ae21c..914db0edc7 100644 --- a/webview-ui/src/i18n/locales/tr/settings.json +++ b/webview-ui/src/i18n/locales/tr/settings.json @@ -31,7 +31,8 @@ "prompts": "Promptlar", "experimental": "Deneysel", "language": "Dil", - "about": "Roo Code Hakkında" + "about": "Roo Code Hakkında", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Prompt geliştirme, kod açıklama ve sorun çözme gibi hızlı eylemler için kullanılan destek promptlarını yapılandırın. Bu promptlar, Roo'nun yaygın geliştirme görevleri için daha iyi destek sağlamasına yardımcı olur." @@ -614,6 +615,21 @@ "customArn": "Özel ARN", "useCustomArn": "Özel ARN kullan..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Maksimum çıktı tokenlerini dahil et", "includeMaxOutputTokensDescription": "API isteklerinde maksimum çıktı token parametresini gönder. Bazı sağlayıcılar bunu desteklemeyebilir." } diff --git a/webview-ui/src/i18n/locales/vi/settings.json b/webview-ui/src/i18n/locales/vi/settings.json index edb2b386b2..a43894e106 100644 --- a/webview-ui/src/i18n/locales/vi/settings.json +++ b/webview-ui/src/i18n/locales/vi/settings.json @@ -31,7 +31,8 @@ "prompts": "Lời nhắc", "experimental": "Thử nghiệm", "language": "Ngôn ngữ", - "about": "Giới thiệu" + "about": "Giới thiệu", + "diagnostics": "Diagnostics" }, "prompts": { "description": "Cấu hình các lời nhắc hỗ trợ được sử dụng cho các hành động nhanh như cải thiện lời nhắc, giải thích mã và khắc phục sự cố. Những lời nhắc này giúp Roo cung cấp hỗ trợ tốt hơn cho các tác vụ phát triển phổ biến." @@ -614,6 +615,21 @@ "customArn": "ARN tùy chỉnh", "useCustomArn": "Sử dụng ARN tùy chỉnh..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "Bao gồm token đầu ra tối đa", "includeMaxOutputTokensDescription": "Gửi tham số token đầu ra tối đa trong các yêu cầu API. Một số nhà cung cấp có thể không hỗ trợ điều này." } diff --git a/webview-ui/src/i18n/locales/zh-CN/settings.json b/webview-ui/src/i18n/locales/zh-CN/settings.json index 51ae2269e4..b57409626e 100644 --- a/webview-ui/src/i18n/locales/zh-CN/settings.json +++ b/webview-ui/src/i18n/locales/zh-CN/settings.json @@ -31,7 +31,8 @@ "prompts": "提示词", "experimental": "实验性", "language": "语言", - "about": "关于 Roo Code" + "about": "关于 Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "配置用于快速操作的支持提示词,如增强提示词、解释代码和修复问题。这些提示词帮助 Roo 为常见开发任务提供更好的支持。" @@ -614,6 +615,21 @@ "customArn": "自定义 ARN", "useCustomArn": "使用自定义 ARN..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "包含最大输出 Token 数", "includeMaxOutputTokensDescription": "在 API 请求中发送最大输出 Token 参数。某些提供商可能不支持此功能。" } diff --git a/webview-ui/src/i18n/locales/zh-TW/settings.json b/webview-ui/src/i18n/locales/zh-TW/settings.json index 07544879cd..14fec6be6b 100644 --- a/webview-ui/src/i18n/locales/zh-TW/settings.json +++ b/webview-ui/src/i18n/locales/zh-TW/settings.json @@ -31,7 +31,8 @@ "prompts": "提示詞", "experimental": "實驗性", "language": "語言", - "about": "關於 Roo Code" + "about": "關於 Roo Code", + "diagnostics": "Diagnostics" }, "prompts": { "description": "設定用於快速操作的支援提示詞,如增強提示詞、解釋程式碼和修復問題。這些提示詞幫助 Roo 為常見開發工作提供更好的支援。" @@ -614,6 +615,21 @@ "customArn": "自訂 ARN", "useCustomArn": "使用自訂 ARN..." }, + "diagnostics": { + "description": "Configure how workspace diagnostics (errors and warnings) are included in the AI's context", + "includeDiagnostics": { + "label": "Include diagnostics in context", + "description": "When enabled, workspace errors and warnings will be included when using @problems mention" + }, + "maxDiagnosticsCount": { + "label": "Maximum diagnostics count", + "description": "Limit the number of diagnostics included to prevent excessive token usage" + }, + "diagnosticsFilter": { + "label": "Diagnostics filter", + "description": "Filter diagnostics by source and code (e.g., 'eslint', 'typescript', 'dart Error'). Leave empty to include all diagnostics" + } + }, "includeMaxOutputTokens": "包含最大輸出 Token 數", "includeMaxOutputTokensDescription": "在 API 請求中傳送最大輸出 Token 參數。某些提供商可能不支援此功能。" }