fix(sandbox): declarative engine strips JSONC comments inside strings; sql.format and sql.parse are regex-based
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
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
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:
_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 withFormatException. Trailing commas, which JSONC allows, are not handled either. The repo already has a correct scanner:stripJsoncinlib/core/theme/parser/jsonc_preprocessor.dart(string-aware, handles trailing commas). Use it.sql.format(:120-164) changes literals and does extra work. It compiles 21RegExps 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.sql.parse(:219) splits the whole statement on whitespace to read the first word, and returns--//*when the statement starts with a comment. Use onefirstMatchafter skipping leading comments (stripLeadingWhitespaceAndLineCommentsexists 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
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 QueryaHub/Querya-Desktop
-
enhancement ui
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Los mantenedores suelen responder en 1 día
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbiertobug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Los mantenedores suelen responder en 1 día
-
bug error-handling settings
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Los mantenedores suelen responder en 1 día
-
enhancement marketplace
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Los mantenedores suelen responder en 1 día
Todos los issues de QueryaHub/Querya-Desktop
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
0niel/university-app#617 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
linagora/tmail-flutter#5010 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
chriskelly/wish-together#36 ·
Los mantenedores suelen responder en 1 día
-
[Bug] Web Guide has broken linksAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
AppFlowy-IO/AppFlowy#9075 ·