You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support new command-line flag for the analysis server #9195
A new command-line flag is being added to the analysis server and the IntelliJ plugin should include this flag when the analysis server is started.
The flag is named start-reason and is intended to indicate why the analysis server is being started. For example, there is one value for cases where the plugin is starting the server for the first time, another for when the user requests that the server be restarted, and a couple of values for when the server is being restarted after a crash (depending on what crashed and why it was restarted).
There is a list of reasons that we will be sending from the VS Code plugin and we'd like the list to be consistent between the two plugins. If the list isn't compete or doesn't match the way the VS Code plugin works we're happy to update the list to support your needs. The list can be found here: https://dart-review.googlesource.com/c/sdk/+/570580/2/pkg/analysis_server/lib/src/context_manager.dart (it hasn't landed yet).
We'll need to figure out a way for the plugin to know that the flag is supported. Suggestions welcome.
While it'd be nice to ask the SDK, these versions are unlikely to change and the check is very fast (compared to reading a file or running a process).
(My guess is that IntelliJ has something similar since we often add new flags/features that aren't worth adding a way to interrogate)
Edit: One additional note, is that if the server fails to start, we do look at the stderr output to show a message, because if you often run the server from source, it's easy to have a slight mismatch in these versions - for ex. you updated your bleeding-edge SDK, but switched to an SDK branch without it... It's a very fringe case only likely to be hit by the handful of people that run the server from source though (which might not be many more than just me😄)
Activity
DanTup commentedon Nov 2, 2026
In Dart-Code, we have a
dartCapabilitiesclass where we have flags for things like this against the version number:While it'd be nice to ask the SDK, these versions are unlikely to change and the check is very fast (compared to reading a file or running a process).
(My guess is that IntelliJ has something similar since we often add new flags/features that aren't worth adding a way to interrogate)
Edit: One additional note, is that if the server fails to start, we do look at the stderr output to show a message, because if you often run the server from source, it's easy to have a slight mismatch in these versions - for ex. you updated your bleeding-edge SDK, but switched to an SDK branch without it... It's a very fringe case only likely to be hit by the handful of people that run the server from source though (which might not be many more than just me😄)
bwilkerson commentedon Nov 2, 2026
Being consistent across the two plugins would be ideal (and I should have thought about that possibility).