setSubscriptions method

Future setSubscriptions(
  1. Map<String, List<String>> subscriptions
)

Subscribe for services that are specific to individual files. All previous subscriptions are replaced by the current set of subscriptions. If a given service is not included as a key in the map then no files will be subscribed to the service, exactly as if the service had been included in the map with an explicit empty list of files.

Note that this request determines the set of requested subscriptions. The actual set of subscriptions at any given time is the intersection of this set with the set of files currently subject to analysis. The files currently subject to analysis are the set of files contained within an actual analysis root but not excluded, plus all of the files transitively reachable from those files via import, export and part directives. (See analysis.setAnalysisRoots for an explanation of how the actual analysis roots are determined.) When the actual analysis roots change, the actual set of subscriptions is automatically updated, but the set of requested subscriptions is unchanged.

If a requested subscription is a directory it is ignored, but remains in the set of requested subscriptions so that if it later becomes a file it can be included in the set of actual subscriptions.

It is an error if any of the keys in the map are not valid services. If there is an error, then the existing subscriptions will remain unchanged.

Implementation

Future setSubscriptions(Map<String, List<String>> subscriptions) =>
    _call('analysis.setSubscriptions', {'subscriptions': subscriptions});