Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/types/src/global-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
8 changes: 8 additions & 0 deletions src/core/mentions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ async function getFileOrFolderContent(
}

async function getWorkspaceProblems(cwd: string): Promise<string> {
// Check if diagnostics are enabled
const config = vscode.workspace.getConfiguration("roo-cline")
const includeDiagnostics = config.get<boolean>("includeDiagnostics", false)

if (!includeDiagnostics) {
return "Diagnostics are disabled in settings."
}

const diagnostics = vscode.languages.getDiagnostics()
const result = await diagnosticsToProblemsString(
diagnostics,
Expand Down
9 changes: 9 additions & 0 deletions src/core/webview/ClineProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1329,6 +1329,9 @@ export class ClineProvider
showRooIgnoredFiles,
language,
maxReadFileLine,
includeDiagnostics,
maxDiagnosticsCount,
diagnosticsFilter,
terminalCompressProgressBar,
historyPreviewCollapsed,
cloudUserInfo,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions src/core/webview/__tests__/ClineProvider.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ describe("ClineProvider", () => {
autoCondenseContextPercent: 100,
cloudIsAuthenticated: false,
sharingEnabled: false,
includeDiagnostics: false,
maxDiagnosticsCount: 5,
diagnosticsFilter: ["error", "warning"],
}

const message: ExtensionMessage = {
Expand Down
12 changes: 12 additions & 0 deletions src/core/webview/webviewMessageHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 18 additions & 0 deletions src/i18n/locales/ca/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/de/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
20 changes: 20 additions & 0 deletions src/i18n/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/es/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/fr/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/hi/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
20 changes: 20 additions & 0 deletions src/i18n/locales/id/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/it/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/ja/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/ko/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
20 changes: 20 additions & 0 deletions src/i18n/locales/nl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
18 changes: 18 additions & 0 deletions src/i18n/locales/pl/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Loading