Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

create_new_file writes a JSON file on one line when the model sends its contents as a JSON value

Aperta Adatta ai principianti
#13,363 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

@YauhenBichel ci sta già lavorando.

Dal 9/10/2026.

  • #13364 di @YauhenBichel — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
devtools

Direzione di ricerca

Il bug è in createNewFileImpl, che legge contents tramite getStringArg; quell'helper esegue JSON.stringify(value) sugli oggetti, causando l'output su una sola riga. Inizia leggendo getStringArg e come lo usa createNewFileImpl, poi riproduci con la chiamata dell'issue. Il lavoro è completo quando contents oggetto per un file .json viene scritto come JSON indentato (JSON.stringify(value, null, 2)), mentre gli altri argomenti stringa e i test esistenti mantengono il comportamento compatto.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Relevant environment info
  • OS: macOS
  • Continue version: 2.0.0 (also checked on main at 5522c6f)
  • IDE version: VS Code 1.141.0
  • Model: Qwen3.6-Coder 35B, served locally through an OpenAI-compatible API (provider openai)
Description

When a model sends the contents of a new .json file as a JSON value instead of a string, create_new_file writes the file on a single line, for example:

{"name":"app","version":"1.0.0","scripts":{"build":"tsc"},"devDependencies":{"typescript":"^5.6.0"}}

A package.json or tsconfig.json written like this is valid, but nobody would write it that way, and every later edit produces a large diff.

Cause: createNewFileImpl reads the contents with getStringArg, which turns an object back into text with JSON.stringify(value). That compact form is right for other string arguments (and is what the existing tests expect), but for the contents of a file, indented JSON (JSON.stringify(value, null, 2)) is what the model meant.

To reproduce

Call createNewFileImpl({ filepath: "app/package.json", contents: { name: "app", private: true } }, extras): the file is written as {"name":"app","private":true}.

Log output

No response

Lingua principale
TypeScript
Stelle
36.2k
Fork
5.5k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di continuedev/continue

Tutte le issue di continuedev/continue

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.