-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
Right now, with the new analyzer system, the analysis server only searches an analysis options file at the context root for plugins. I don't think we have a published document about what an analysis context / context root is. But I think it is essentially the root of a Pub workspace (either the workspace created by a single package, or a workspace created by a parent pubspec files that specifies workspace:
).
So you can write a plugins
section in an inner analysis options file, and we just don't do anything with it. That's not great. We have some options:
- Statically report this with a diagnostic. This is easy, and a great solution to offer with the current behavior.
- Change the behavior! Start up a separate plugin isolate each time we find
plugins
enabled in any analysis options. This shouldn't be too hard, but the current architecture might make this tricky. Should be doable though. There is a question of whether it is worth it, given it really may accidentally increase folks' DAS memory usage. We specifically went out of our way to ban more than one legacy plugin, because of the accidental memory issues and the perception of memory usage in DAS. The current behavior aligns closer with that "one-legacy-plugin" policy. But maybe we've done enough with the memory issues with the new system that we can get back to the wild west, and allow plugins anywhere.
(There are bigger design possibilities where we look at the whole "context collection" space for all plugin sets, and try to find maximal sets of those sets, and start up a minimum number of isolates to serve all of the contexts. While very cool, this sounds hard, complex, error-prone, and also time-expensive for the user while we seek out all analysis options files and query pub for version constraint compatibilities.)
I think for the MVP release, we should just do 1.