fix(sandbox): declarative engine strips JSONC comments inside strings; sql.format and sql.parse are regex-based
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 75/100
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Dart
- Estrelas
- 23
- Forks
- 1
- Merge médio
- 31min
- PRs com merge (30d)
- 570
Preparar o ambiente
Inicia o contêiner de desenvolvimento do projeto no navegador, com a sua própria conta do GitHub.
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de QueryaHub/Querya-Desktop
-
enhancement ui
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1689 ·
Mantenedores costumam responder em até 1 dia
-
ui(dialogs): make destructive query and DML preview dialogs adaptive and prevent table name overflowAbertabug frontend
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
QueryaHub/Querya-Desktop#1642 ·
Mantenedores costumam responder em até 1 dia
-
bug error-handling settings
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1637 ·
Mantenedores costumam responder em até 1 dia
-
enhancement
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
QueryaHub/Querya-Desktop#1636 ·
Mantenedores costumam responder em até 1 dia
-
enhancement marketplace
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
QueryaHub/Querya-Desktop#1635 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de QueryaHub/Querya-Desktop
Issues semelhantes
-
bug
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 65/100
chriskelly/wish-together#36 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
AppFlowy-IO/AppFlowy#9075 ·
-
Paste asks for iOS paste permission because the default context menu ignores SystemContextMenuTalvez já em andamento @dorklein assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
maheshj01/searchfield#267 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 67/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
hajisensai/Fushi#2340 · 2 comentários ·
Mantenedores costumam responder em até 1 dia