English | 简体中文
A transparent LSP proxy between Dart-Code and the Dart analysis server. It
lets dana, CLI tools and AI
agents reuse the analyzer your IDE has already warmed up, instead of starting
another one that costs minutes and gigabytes.
The IDE behaves exactly as before: every LSP message is forwarded unchanged. The proxy itself uses well under 100 MB and does not change the analyzer's memory. Dart-Code, the Dart SDK and the analysis server are not modified.
Supported platforms: macOS and Windows.
Dart-Code <-> proxy <-> Dart analysis server
^
| authenticated loopback bridge
dana
After the IDE initializes, the proxy writes .dart_tool/dana-ide-bridge.json
in each workspace root. dana finds it, connects with the token in it, and
asks for diagnostics the IDE analyzer already holds.
dart pub global activate dart_analysis_server_proxy
dana_analysis_server analyzer-path --output <dir>/dana_analysis_server_proxy.dillanalyzer-path compiles the proxy with the current Dart SDK, writes it where
you ask, and prints the setting to add. Put dart.analyzerPath in one of
these places and restart the analyzer:
| Scope | Setting goes in | Relative path starts from | Applies to |
|---|---|---|---|
| Single project | the project's .vscode/settings.json (can be committed) |
the project folder | windows that open this project as a single folder; ignored in multi-root windows |
| Multi-project | the settings block of a .code-workspace file |
the workspace file's directory | windows opened through that file, all of their folders |
| Global | user settings, absolute or ~/ path |
— | every window |
A project or workspace setting overrides the global one. Example for a workspace file next to the project folder:
Things to know:
- The
.dillfile only loads on the Dart SDK that compiled it. Runanalyzer-pathagain after changing the SDK. If the file is missing or cannot be loaded, Dart-Code reports an error and the analyzer does not start. - A team can commit the
.dillfile (about 8 MB) with the project setting when everyone uses the same SDK, for example through FVM; regenerate it in the same change that bumps the SDK. For personal use,.dart_tool/dana/is git-ignored but removed byflutter clean. - To check it is active: the analyzer process runs your
.dillwith--lspand.dart_tool/dana-ide-bridge.jsonexists. Without the proxy the process isdart language-server --protocol=lspand there is no bridge file. - To go back, remove the setting and restart the analyzer.
# Require the IDE analyzer (exit 69 when no bridge is available).
dana check --root path/to/project --mode full --reuse-ide require
dana check --root path/to/project --files lib/main.dart --reuse-ide requireWith the default --reuse-ide auto, dana uses the bridge when present and
its own session otherwise.
- Results reflect the IDE's current state, unsaved edits included. Use
--reuse-ide neverwhen a gate must check only what is on disk. - Right after the IDE starts or reloads, plugins may still be loading and publish nothing for a while, so a settled result can lack plugin lints. If you rely on plugin lints, keep a file that always yields one plugin diagnostic and retry while it is missing.
status,checkfor given files or folders, andfullCheckfor the whole root, answered from the diagnostics the IDE analyzer has published; nothing is re-analyzed.fullCheckfirst tells the analyzer about Dart files changed since it was last idle, waits for the analysis pass, then waits until no diagnostics have arrived for 2 seconds, because plugins publish after the server goes idle. That last wait is capped (default 180 s, per request viasettleLimitSeconds, 1–3600); reaching it answerssettled: false.- One endpoint per workspace root, each with its own token; results are limited to that root. The bridge listens on loopback only, cannot shut the analyzer down and never changes the IDE's unsaved content.
| Variable | Default | Effect |
|---|---|---|
DANA_PROXY_LOG |
unset | also append proxy diagnostics (upstream start failures and exits, upstream stderr, LSP framing errors) to this file; they always go to stderr |
DANA_ANALYSIS_TIMEOUT_SECONDS |
1800 | limit for upstream requests and fullCheck waits; 0 disables it |
DANA_DART_EXECUTABLE |
discovered | Dart runtime used to start the upstream analyzer when the proxy runs as a native executable; otherwise DART_SDK, FLUTTER_ROOT and PATH are tried |
Run dana_analysis_server --help or dana_analysis_server help <command>.
Arguments that are not one of its commands are forwarded to the analyzer
unchanged; the proxy option --upstream-executable <dart> goes before --,
for example dana_analysis_server --upstream-executable <dart> -- --lsp.
After changing SDK, rerun analyzer-path with that SDK and restart the IDE
analyzer.
To uninstall, remove dart.analyzerPath from the settings where it was
configured and restart the analyzer, then run
dart pub global deactivate dart_analysis_server_proxy.