[API Proposal]: Save comma flag in `JsonReaderState`.
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Start by reading the JsonReaderState and Utf8JsonReader code that tracks commas, including the existing _trailingCommaBeforeComment flag. The issue proposes preserving comma state so streamed reads can advance to the next token; check the reader’s state and streaming tests to understand current behavior. Done means partial-token reads can resume at the token start after consuming the comma, with existing reader behavior covered.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background and motivation
When large json is iterated in streamed way and doesn't fit the buffer, it is preferred to leave the buffer at the start of the next token since token is what we are gonna read. Commas are for syntax only, they are not meant to be consumed, reader doesn't even return them.
However, at the moment reader stops consuming right before the comma when next token is partial.
Assume that we are reading [ "token 1" , "token 2" ]. Minimum reading steps are: [, , "token 1", , , "token 2", , ].
First two whitespaces are independent since they are handled by SkipWhiteSpace(). However, since encountered comma is not saved in a JsonReaderState, reader can't advance past comma between two tokens, thus both comma and all whitespaces after it have to be present along with token 2, otherwise token 2 will throw as unexpected(because reader expects a comma).
API Proposal
Add a flag to JsonReaderState to note that comma is encountered. Thus reader will be able to consume past comma and stop right at the beginning of the token.
The flag probably can replace previous _trailingCommaBeforeComment as well.
API Usage
Alternative Designs
No response
Risks
No response
- Lingua principale
- C#
- Stelle
- 18.5k
- Fork
- 5.8k
- Merge medio
- 2g 18h
- PR unite (30g)
- 588
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di dotnet/runtime
-
area-CodeGen-coreclr untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
dotnet/runtime#138181 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-System.Collections untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
dotnet/runtime#138090 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-System.Text.Json untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dotnet/runtime#138089 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-Setup untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
dotnet/runtime#137376 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
area-System.Memory untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
dotnet/runtime#137334 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di dotnet/runtime
Issue simili
-
Add `net10.0`Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
dotnet-outdated/dotnet-outdated#871 ·
I maintainer di solito rispondono entro 1 giorno
-
triage/untriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
unoplatform/uno#26676 ·
I maintainer di solito rispondono entro 1 giorno
-
.NET bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
[问题] 导出文件时,提示后面还有1243390911步Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
jhaizhou-ops/S2Arm#2177 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno