Skip to content

fix(files): stop validating .jsonl as single-document JSON - #6490

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/jsonl-monaco-language
Aug 10, 2026
Merged

fix(files): stop validating .jsonl as single-document JSON#6490
waleedlatif1 merged 1 commit into
stagingfrom
fix/jsonl-monaco-language

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • .jsonl was mapped to Monaco's json language in the Files editor. JSON Lines holds one independent JSON value per line, so Monaco's single-document parser flags every line after the first as invalid — a wall of false errors on a well-formed file.
  • Map .jsonl to plaintext instead. JSON validation can't be scoped to a single model (jsonDefaults is global), so opting JSONL out of the JSON language is the only per-file lever short of shipping a custom grammar.
  • Trade-off: .jsonl loses syntax coloring but no longer reports false errors. A proper jsonl Monarch grammar would keep both; that's a larger change and not worth it at current usage.
  • Behaviorally identical to deleting the key (no .jsonl MIME is in the MIME map, so the lookup already falls through to plaintext). Keeping the explicit entry plus the comment stops it from being "restored" to json later.

Found while investigating an unrelated editor report — the root cause of that report is still unconfirmed, and this does not claim to address it.

Type of Change

  • Bug fix

Testing

Tested manually. MONACO_LANGUAGE_BY_EXTENSION and resolveMonacoLanguage are module-private with a single consumer, so the change only affects the language prop for .jsonl files — no persisted state, wire format, or contract is involved. plaintext is a Monaco built-in and already the fallback, so nothing new is registered. Typecheck and biome clean.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Aug 10, 2026 3:44pm

Request Review

@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Editor-only language mapping for .jsonl in the Files viewer; no APIs, persistence, or security paths change.

Overview
.jsonl files in the workspace Files editor no longer use Monaco’s json language. They are mapped to plaintext so Monaco’s single-document JSON validator does not mark every line after the first as invalid on valid JSON Lines content.

A short comment documents that global jsonDefaults cannot scope validation per file, so opting out of the JSON language is the practical fix. Trade-off: .jsonl loses JSON syntax highlighting but stops showing false errors.

Reviewed by Cursor Bugbot for commit e068980. Configure here.

@greptile-apps

greptile-apps Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR maps .jsonl files to Monaco’s established plaintext language so valid JSON Lines documents no longer receive false single-document JSON errors.

  • Changes the explicit .jsonl language mapping from json to plaintext.
  • Documents why global JSON diagnostics cannot be disabled for only JSONL models.
  • Preserves the editor’s existing plaintext fallback behavior.

Confidence Score: 5/5

The PR appears safe to merge, with the loss of JSONL syntax coloring being an intentional and documented trade-off.

The changed mapping uses the editor’s existing valid plaintext fallback, prevents the JSON worker from applying single-document diagnostics to JSONL, and does not affect persistence, file contents, or required editor functionality.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/text-editor.tsx Correctly opts JSONL models out of Monaco’s JSON parser using the component’s existing plaintext language path; no actionable issue found.

Reviews (1): Last reviewed commit: "fix(files): stop validating .jsonl as si..." | Re-trigger Greptile

@waleedlatif1
waleedlatif1 merged commit c051c59 into staging Aug 10, 2026
24 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/jsonl-monaco-language branch August 10, 2026 15:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant