Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

fix(sandbox): declarative engine strips JSONC comments inside strings; sql.format and sql.parse are regex-based

Abierto
#1,567 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
dart

Línea de trabajo

Read lib/core/extensions/sandbox/embedded/declarative_embedded_engine.dart alongside lib/core/theme/parser/jsonc_preprocessor.dart and the core/database helper mentioned for leading comments. Check the editor fix in issue #1566 for the segment-aware SQL formatter. Add tests for the listed JSONC and SQL cases; done means strings remain intact, trailing commas parse, and sql.parse skips leading comments.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug core P3 parser

Problem

DeclarativeEmbeddedEngine (lib/core/extensions/sandbox/embedded/declarative_embedded_engine.dart) runs Level-1 JSON/JSONC modules for extensions. Three of its helpers use regexes where a scanner is needed:

  1. _parseJsoncObject (:230-238) breaks on any // or /* inside a string. It removes comments with //[^\n]* and /\*[\s\S]*?\*/ over the raw text, so {"homepage": "https://example.com"} becomes {"homepage": "https: and the module fails with FormatException. Trailing commas, which JSONC allows, are not handled either. The repo already has a correct scanner: stripJsonc in lib/core/theme/parser/jsonc_preprocessor.dart (string-aware, handles trailing commas). Use it.
  2. sql.format (:120-164) changes literals and does extra work. It compiles 21 RegExps per call (one per keyword plus two) and makes 23 passes over the string. [ \t]+ -> ' ' collapses spaces inside string literals; \s*;\s* -> ';\n' inserts newlines inside literals; keyword uppercasing rewrites 'order by' and "select". Use the segment-aware formatter from the editor fix (#1566) instead of a second implementation.
  3. sql.parse (:219) splits the whole statement on whitespace to read the first word, and returns -- / /* when the statement starts with a comment. Use one firstMatch after skipping leading comments (stripLeadingWhitespaceAndLineComments exists in core/database).

Scope

EmbeddedSandboxRuntime has no callers outside lib/core/extensions/sandbox/embedded/ yet (only tests), so nothing breaks for users today. Fix before the runtime is wired to extensions.

Tests

JSONC with a URL value, /* inside a string, trailing comma; sql.format with keywords and ; inside literals; sql.parse with a leading comment.

Lenguaje dominante
Dart
Estrellas
23
Forks
1
Merge medio
31 min
PR fusionados (30 d)
570

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de QueryaHub/Querya-Desktop

Todos los issues de QueryaHub/Querya-Desktop

Issues similares

Más issues de Dart

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.