mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: improve JSON readability in MCP tool responses
- Changed JSON indentation from 2 to 4 spaces for better readability - This improves the display of JSON requests/responses with nested structures - Addresses issue #9330 where JSON with escaped newlines was hard to read
This commit is contained in:
parent
e742511d90
commit
df1946e5b0
1 changed files with 7 additions and 1 deletions
|
|
@ -58,11 +58,17 @@ export const McpExecution = ({
|
|||
|
||||
try {
|
||||
const parsed = JSON.parse(text)
|
||||
|
||||
// Format JSON with proper indentation - use 4 spaces for better readability
|
||||
const formatted = JSON.stringify(parsed, null, 4)
|
||||
|
||||
return {
|
||||
isJson: true,
|
||||
formatted: JSON.stringify(parsed, null, 2),
|
||||
formatted: formatted,
|
||||
}
|
||||
} catch {
|
||||
// If it's not valid JSON, return as-is
|
||||
// The Markdown component will handle plain text with actual newlines
|
||||
return {
|
||||
isJson: false,
|
||||
formatted: text,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue