[API Proposal]: Save comma flag in `JsonReaderState`.
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Lenguaje dominante
- C#
- Estrellas
- 18.5k
- Forks
- 5.8k
- Merge medio
- 2 d 18 h
- PR fusionados (30 d)
- 588
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de dotnet/runtime
-
area-CodeGen-coreclr untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
dotnet/runtime#138181 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-System.Collections untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
dotnet/runtime#138090 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-System.Text.Json untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
dotnet/runtime#138089 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-Setup untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
dotnet/runtime#137376 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
area-System.Memory untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
dotnet/runtime#137334 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de dotnet/runtime
Issues similares
-
Add `net10.0`Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
dotnet-outdated/dotnet-outdated#871 ·
Los mantenedores suelen responder en 1 día
-
triage/untriaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
unoplatform/uno#26676 ·
Los mantenedores suelen responder en 1 día
-
.NET bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
[问题] 导出文件时,提示后面还有1243390911步Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
jhaizhou-ops/S2Arm#2177 · 3 comentarios ·
Los mantenedores suelen responder en 1 día