fix(sandbox): declarative engine strips JSONC comments inside strings; sql.format and sql.parse are regex-based
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 75/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Dart
- Stelle
- 23
- Fork
- 1
- Merge medio
- 32m
- PR unite (30g)
- 537
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 QueryaHub/Querya-Desktop
-
enhancement ui
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1689 ·
I maintainer di solito rispondono entro 1 giorno
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowApertabug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
QueryaHub/Querya-Desktop#1642 ·
I maintainer di solito rispondono entro 1 giorno
-
bug error-handling settings
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1637 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
QueryaHub/Querya-Desktop#1636 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement marketplace
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
QueryaHub/Querya-Desktop#1635 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di QueryaHub/Querya-Desktop
Issue simili
-
[FR] 缓存键放置在外面Apertaenhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bggRGjQaUbCoE/PiliPlus#3310 ·
I maintainer di solito rispondono entro 1 giorno
-
package:code_builder type-bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
I maintainer di solito rispondono entro 1 giorno
-
type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
type-documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
dart-lang/build#5229 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
photos
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 91/100
I maintainer di solito rispondono entro 1 giorno