2.1.1
Locally built extension packages now include the scanner, so there is nothing to set up by hand. The Saropa Utils findings list now has its own icon in the Activity Bar instead of hiding inside the Explorer.
Fixed
- Extension: local .vsix builds shipped without the scanner —
extension/bin/<platform-arch>/was only filled by the CI release workflow.vscode:prepublishnow runsextension/scripts/bundle_scanner.py(npm run bundle-scanner), which compilestool/scannerfor the host platform and skips when a content hash of the scanner sources plus thedart --versiontext matches a sidecar.hashfile next to the exe (mtime is no longer used, so deleted files and SDK upgrades trigger a rebuild). Coversnpm run vsix*and the release script. - Extension: "Find opportunities" failed with
Could not find package saropa_scan— thedart run saropa_scan:saropa_scanfallback ran in the workspace root, where the package cannot be resolved. WithsaropaUtils.scannerPathempty it now runs in<workspace>/tool/scannerwhen that folder has apubspec.yaml(fallbackScannerCwd). Ifdart runstill cannot find the package, the error now names thesaropaUtils.scannerPathandsaropaUtils.cli.pathsettings. The fallback folder is only used when itspubspec.yamldeclaresname: saropa_scan, so an unrelatedtool/scannerpackage no longer hijacks the working directory. - Scanner: shared JSON readers
jsonReq<T>/jsonOpt<T>(json_access.dart) — one lint-clean place for decoded-JSON map reads (require_null_safe_json_access).jsonReqcheckscontainsKeythenis Tand throws aFormatExceptionnaming the key and actual type (was a bareTypeError);jsonOptreturns null on missing or wrong type.reverse_suggest.dartnow usesjsonReqfor its 17 former inline casts (replaces the private_req). - Scanner: all
require_null_safe_json_accesssites converted — every flagged literal-keym['k'] as Tread acrosstool/scanner/libnow goes through the sharedjsonReq/jsonOpt(map reads) orArgResults.option()/.flag()/.multiOption()(CLI args). Behavior: a missing/mistyped required key now raisesFormatException(wasTypeError); config fields holding a wrong type fall back to their defaults instead of throwing; a CLI option with no value reads as an empty string instead of throwing. - Extension: every scanner command now shares one working-directory rule — "Find repeated code", fix, doctor, explain and exclude edits all pick the
dart runfolder through a single helper (resolveRunCwd), so none can drift from "Find opportunities". Installs built before this fix (such as the 2.1.0 VSIX) must be rebuilt and reinstalled to pick it up. - Extension: the scanner now sets itself up — when no scanner binary is bundled, on PATH or downloaded, the first scan in a trusted workspace asks "Set up scanner (compile from source shipped with the extension)?" and then compiles it with the local Dart SDK (
dart pub get+dart compile exe) from<extension>/scanner-src, in a cancellable progress notification with a visible success or failure message. The binary is cached in extension storage (cli/built-<source hash>/) and rebuilt only when the bundled source changes; the answer is remembered per source. The build is tried before the GitHub download, so a missingscanner-v<version>release (404) no longer ends setup. When setup is impossible, the message names exactly what is missing (for example "Dart SDK not found on PATH") instead of failing withCould not find package saropa_scan. New handlersaropaUtils.setupScannerre-runs setup and clears earlier "no" answers (pure logic inextension/src/cli/cli-build.ts, text incli-setup-messages.tsviavscode.l10n.t). - Extension: security hardening of scanner build-from-source — a review of the first version found that an opened folder could influence what gets compiled and run. Now: (1) nothing is probed, offered or built until the workspace is trusted, and granting trust re-runs setup; (2) only the scanner source shipped inside the extension (
<extension>/scanner-src) is ever built, never a workspacetool/scanner; when it is not bundled the message says "scanner source not bundled with this extension"; (3) the cache key is a SHA-256 of the source content (pubspec.yaml,pubspec.lock,lib/,bin/), so a same-version source with different code can neither reuse nor poison another build, and any source change rebuilds once; (4) the build runs in a private copy under extension storage, so nothing is written into a user repo or the extension folder; (5) each build uses its own random work dir and one atomic rename, and a finished build that another window may be running is never deleted; (6) consent is stored per source hash; (7) the compile output path is a short relative ASCII path, so a Flutterdart.bataccepts it even when the storage path has non-ASCII characters or(x86). Tests:extension/src/test/cli-build.test.ts,extension/src/test/cli-manager.test.ts.
Changed
- Scanner: all
int.parse/double.parse/DateTime.parseintool/scanner/lib/srcreplaced withtryParse— (prefer_try_parse_for_dynamic_data). Rounding goes through oneroundTohelper (src/round_to.dart); regex-matched digit groups skip/return null on overflow;ulfcommand options and corrupt lease/index JSON throwFormatExceptionwith a message; bench/corpus CLI args (bench/src/cli_args.dart) throwArgumentErrornaming the flag and quoting the bad value, and theirfallbackapplies only when the flag is absent. Valid input behaves as before. - CI: scanner source reaches the released VSIX —
extension.ymlandrelease-scanner.ymlnow runactions/setup-pythonbeforevsce package, sovscode:prepublish(python scripts/bundle_scanner.py) always runs and copiestool/scannerintoextension/scanner-srceven withSAROPA_SKIP_SCANNER_BUNDLE=1. - Extension: scanner source ships in the VSIX —
bundle_scanner.pynow always mirrorstool/scanner(pubspec.yaml,pubspec.lock,lib/,bin/) intoextension/scanner-src(gitignored, included in the package), even whenSAROPA_SKIP_SCANNER_BUNDLE=1or no Dart SDK is present, so the extension can build the scanner from<extension>/scanner-src.assets/is left out because the exe and source builds use the catalog embedded inlib/. - Extension: host-only exe bundling made explicit —
bundle_scanner.pywarns whentool/scannerhas uncommitted changes (it builds the working tree), skips writing the host exe whenSAROPA_VSCE_TARGETnames a different platform, and prints which targets have no bundled exe. Thevsce packagesteps inextension.ymlandrelease-scanner.ymlnow setSAROPA_SKIP_SCANNER_BUNDLE=1, so the script docstring claim is true. - Extension: "Set Up Scanner" is now a declared command —
saropaUtils.setupScanner(handler already existed) is contributed inpackage.jsonwith title keycommand.setupScanner.titleand sits in the findings view overflow menu (overflow@5), so the Command Palette and the view menu can re-run scanner setup. The manifest test now pins the Activity Bar container structure (viewsContainers.activitybaridsaropaUtils,views.saropaUtilsholdssaropaUtils.findings) instead of the old Explorer placement. - Extension: more actions surfaced in the findings view — the empty-state welcome now offers Scan Workspace, Find opportunities, Find repeated code, Fix all safe, Check package versions, Open report and Open Settings (text in
viewsWelcome.emptyinpackage.nls.json). The view title bar now shows Scan Workspace, Find opportunities, Find repeated code and Fix all safe as icons ahead of Group by, Open report and Open Settings (navigation@1-@7). Overflow keeps Open HTML report, Refresh catalog, Show run log and Check package versions (overflow@1-@4). Rationale: scans were buried in overflow although they are the first thing a new user needs;package.jsoncannot hold comments, so the reasoning is recorded here. Each command already had a codicon, so nocontributes.commandschange. - Extension: findings view moved to its own Activity Bar container —
saropaUtils.findingswas a collapsed section under Explorer, easy to miss. It now lives in a dedicatedsaropaUtilscontainer (contributes.viewsContainers.activitybar, title keyviewContainer.saropaUtils.title, iconmedia/icon-activitybar.svg, a single-colorcurrentColorSVG as the Activity Bar requires). The view keeps its id, name,saropaUtils.isDartProjectgate and welcome text, sosaropaUtils.findings.focusstill works."visibility": "collapsed"was dropped because a container's only view cannot be meaningfully collapsed.
2.1.0
Changelog links and the package homepage now point to saropa.com, and there is a new optional saropa_scan tool and "Saropa Utils" VS Code extension that find code you could replace with this library.
Added
- Release script: the test step now runs only tests affected since the last release (full suite on config/helper/barrel changes or unmapped files), in parallel batches with live progress; new
--full-testsand--test-workers Nflags - Release script: never prompts (no
input(), no [y/N], no retry/abort/ignore menus). A failing step is recorded and every independent step still runs; steps that depend on a failed one are skipped with the reason, and a final summary lists OK/WARN/FAILED/SKIPPED with exact re-run commands (exit code stays non-zero on any failure). Former prompts are now flags or automatic rules:--audit-only,--skip-audit,--strict-audit,--bump patch|minor|major,--allow-missing-intro. The "Saropa Utils" extension is built to one path,extension/saropa-utils-<version>.vsix(gitignored, printed in the output and summary), that exact file is published withvsce publish --packagePath, and the upload runs in parallel with the pub.dev wait (output prefixed[ext]) unless--skip-extension, so it may go live before pub.dev finishes; both results are reported separately - Extension: the README/CHANGELOG copy bundled in the extension drops SVG images from untrusted hosts (the coverage badge), which
vsce packagerejects; the root README keeps them - Release script: the documentation step skips
dart docwhen no doc input changed since the last successful run and shows live progress; new--full-docsflag - Optional
saropa_scantool in the repository (not part of the published package): finds hand-written code that asaropa_dart_utilscall replaces, finds repeated code worth extracting (useful with or without this package), and applies fixes with undo. A companion VS Code extension, "Saropa Utils", shows both results and can suggest adding or upgradingsaropa_dart_utils. See the README section "Finding opportunities with saropa_scan" - "Saropa Utils" VS Code extension now has its own store icon (a dart in a target, in the same style as the other Saropa extensions) and a matching sidebar glyph
- "Saropa Utils" VS Code extension version now matches the package version (2.1.0), is kept equal by a manifest test, and no longer has its own README or changelog (its docs are the "VS Code extension" section of README.md and the
Extension:entries here) - Extension: findings view in the Explorer (groupable by util member, rule, folder or kind) with two peer groups, "saropa_dart_utils opportunities" and "Repeated code"; Problems panel entries with quick fixes (replace, replace all in file or workspace for safe fixes, ignore a rule here); status bar (
12 utils · 5 repeated); Report screen with two peer sections, filters, adoption trend and JSON, Markdown or CSV export; "Doctor" and "Explain This Finding"; "Add to Exclude List" and "Edit Exclude List"; scan on save for the saved file - Extension: version sync detects
saropa_dart_utilsin every pubspec (hosted, path, git, dev dependency, override, pub workspaces, melos) with the resolved version frompubspec.lock, compares it with the scanner catalog version, and offers "Add saropa_dart_utils" / "Upgrade to <version>" / "Not now" / "Don't ask again for this workspace" (once per session per workspace, trusted workspaces only; the exactdart/flutter pubcommand is shown in a modal and runs in a visible task terminal). Opt-inversionCheck.pubDevadds one cached daily pub.dev lookup; no telemetry - Extension: findings that need a newer
saropa_dart_utilsare marked "needs upgrade to >= x" and offer "Upgrade package then replace" - Extension: scanner discovery via
cli.path, bundled platform binary, PATH, cached download, verified on-demand download (URL, size and SHA-256 shown; checked before first run), thendart run; one scan at a time per window, polite mode (--priority low --jobs auto --lock wait), exit code 75 backoff, scans wait while the machine is busy, child processes are killed as a group on cancel or window close - Extension: versioned API (
apiVersion1, withgetUtilsVersionInfo()and optionalneedsUpgrade/rooton findings) for other Saropa extensions; limited support for untrusted workspaces; settingscli.path,politeMode,scanOnSave.includeRepeatedCode,versionNudge.enabled,versionCheck.pubDev
Changed
- Extension: renamed from "Saropa Dart Scanner" to "Saropa Utils" (id
saropa.saropa-utils); commands, views, context keys and settings use thesaropaUtils.prefix. Settings still written undersaropaScanner.*are read as a fallback when the new key was never set (user settings only for machine-scoped keys); old command ids are not aliased - Extension: "Find opportunities to use saropa_dart_utils" is the first command, "Find repeated code" its peer, "Scan Workspace (both)" runs both; default grouping is by util member; scan on save runs only the fast utils scan (
scanOnSave.includeRepeatedCodeturns repeated-code analysis on); the Report leads with "N opportunities to use saropa_dart_utils" - Release
[log]links inCHANGELOG.mdandCHANGELOG_HISTORY.mdopen the saropa.com changelog pages instead of GitHub, andCHANGELOG.mdlinks to the full release history - Package homepage is now
https://saropa.com/developers/ allSettled,retryTimes,Base64Utils.compressText/decompressTextand theJsonUtilsdecode helpers report failures throughdart:developerlog()with the error and stack trace attached, instead of printing them withdebugPrint- README shows code-card screenshots for String, DateTime, List, Number, Map and Async, and its examples use the real
toUnique()andAsyncSemaphoreUtilsnames - README examples use real API names (
addNotNull,isCaseSensitive,intToHex(),firstCharacter(),CommonRandom) and correct output comments; every README code block was compiled and run
Fixed
- Extension: activation no longer crashes in a real Extension Host (a variable was used before it was declared)
- Extension (Windows): command paths such as
C:\Program Files (x86)\...or containing%,!,^,{}are accepted (no shell is used); the legacydartfallback works under Flutter (dart.exeon PATH, then the Flutter SDK'sdart.exe, elsedart.batthroughcmd.exewith every token allowlist-checked); the busy-machine check works (CPU usage is sampled, sinceos.loadavg()is always 0); process-tree kill usestaskkill /T /F;Pathis found when the env var is not spelledPATH - Extension: exclude globs match case-insensitively on Windows and macOS; quick fixes insert text with the document's line ending (CRLF files no longer get bare LF); workspace-relative paths compare drive letters and case correctly on Windows
- Extension: packaging scripts
vsix:win32-x64,vsix:linux-x64,vsix:linux-arm64,vsix:darwin-x64,vsix:darwin-arm64andvsix:universal parseRrulerejects out-of-rangeUNTILdate or time fields with aFormatExceptioninstead of rolling over into a different datetimeboxno longer leaks an unhandled async error on timeout or when the wrapped function throws
Security
- Extension:
changedSince,fix.git,fix.commitPer,fix.commentandcli.pathare machine-scoped so a repository cannot set them;changedSincemust be a plain git ref (no leading-) and is passed as--changed-since=<ref>, exclude globs as--exclude=<glob>, and a file path starting with-is prefixed with./
2.0.0
The library now uses the material_ui package instead of flutter/material, so date range, time of day and color extensions accept material_ui types.
Added
String.preventOrphansLastGap({int minWrapChars = 4}): fuses only the last gap with a non-breaking space when the last word or the one before it is shorter thanminWrapChars;preventOrphansis unchangedStreamDebounceUtils: stream-based debounce transformer for event streams
Changed
- Imports
package:material_ui/material_ui.dartinstead ofpackage:flutter/material.dart;DateTimeRange,TimeOfDay,ColorandMaterialColorextensions now use the material_ui types - Minimum Flutter is now 3.47.0 and minimum Dart is now 3.13.0
Breaking
- Extensions no longer accept the types from
package:flutter/material.dart; they take the material_ui types - Minimum Flutter 3.47.0 / Dart 3.13.0
Migration
- Replace
package:flutter/material.dartimports withpackage:material_ui/material_ui.dartand addmaterial_ui: ^1.11.0to your dependencies - Upgrade to Flutter 3.47.0+ / Dart 3.13.0+
- Apps still on
package:flutter/material.dartshould stay on 1.6.x
Fixed
- Suppressed 10
unused_resultanalyzer false positives where@useResult-annotated members are correctly consumed in compound boolean expressions (&&/||) but the Dart analyzer does not track usage through boolean operators - Updated VS Code
dart.analysisExcludedFoldersto include all folders listed inanalysis_options.yamlexcludes (.dart_tool,.github,.vscode,assets,build,example,scripts,tool) pluscoverageanddoc