Summary
Парсер VS Code theme manifest (JSON/JSONC): очистка комментариев, trailing commas, декодирование в Map<String, dynamic>.
Проблема
Темы VS Code часто — JSONC (//, /* */, trailing comma). dart:convert jsonDecode падает с FormatException.
Решение
Отдельный модуль без зависимости от Flutter (чистый Dart, тестируемый):
lib/core/theme/parser/
jsonc_preprocessor.dart
vscode_theme_manifest.dart
JSONC preprocessor
- Удалить
// (не внутри строк)
- Удалить
/* … */
- Заменить
,} → }, ,] → ]
jsonDecode
Модели (freezed/json_serializable опционально)
VsCodeThemeManifest: name, type (dark/light), colors, tokenColors
TokenColorRule: scope (String | List), settings.foreground, fontStyle
Acceptance criteria
Зависимости
Оценка
~1–2 дня
Summary
Парсер VS Code theme manifest (JSON/JSONC): очистка комментариев, trailing commas, декодирование в
Map<String, dynamic>.Проблема
Темы VS Code часто — JSONC (
//,/* */, trailing comma).dart:convertjsonDecodeпадает сFormatException.Решение
Отдельный модуль без зависимости от Flutter (чистый Dart, тестируемый):
JSONC preprocessor
//(не внутри строк)/* … */,}→},,]→]jsonDecodeМодели (freezed/json_serializable опционально)
VsCodeThemeManifest:name,type(dark/light),colors,tokenColorsTokenColorRule:scope(String | List),settings.foreground,fontStyleAcceptance criteria
test/fixtures/themes/)colorsЗависимости
Оценка
~1–2 дня