ServerPlugin class abstract

The abstract superclass of any class implementing a plugin for the analysis server.

Clients may not implement or mix-in this class, but are expected to extend it.

Implementers

Constructors

ServerPlugin({required ResourceProvider resourceProvider})
Initialize a newly created analysis server plugin. If a resource resourceProvider is given, then it will be used to access the file system. Otherwise a resource provider that accesses the physical file system will be used.

Properties

channel PluginCommunicationChannel
Return the communication channel being used to communicate with the analysis server.
no setter
contactInfo String?
Return the user visible information about how to contact the plugin authors with any problems that are found, or null if there is no contact info.
no setter
fileGlobsToAnalyze List<String>
Return a list of glob patterns selecting the files that this plugin is interested in analyzing.
no setter
hashCode int
The hash code for this object.
no setterinherited
name String
Return the user visible name of this plugin.
no setter
priorityPaths Set<String>
Paths of priority files.
getter/setter pair
resourceProvider → OverlayResourceProvider
The resource provider used to access the file system.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
subscriptionManager SubscriptionManager
The object used to manage analysis subscriptions.
final
version String
Return the version number of the plugin spec required by this plugin, encoded as a string.
no setter

Methods

afterNewContextCollection({required AnalysisContextCollection contextCollection}) Future<void>
This method is invoked when a new instance of AnalysisContextCollection is created, so the plugin can perform initial analysis of analyzed files.
analyzeFile({required AnalysisContext analysisContext, required String path}) Future<void>
Analyzes the given file.
analyzeFiles({required AnalysisContext analysisContext, required List<String> paths}) Future<void>
Analyzes the given files. By default invokes analyzeFile for every file. Implementations may override to optimize for batch analysis.
beforeContextCollectionDispose({required AnalysisContextCollection contextCollection}) Future<void>
This method is invoked immediately before the current AnalysisContextCollection is disposed.
contentChanged(List<String> paths) Future<void>
Handle the fact that files with paths were changed.
createByteStore() → ByteStore
This method is invoked once to create the ByteStore that is used for all AnalysisContextCollection instances, and reused when new instances are created (and so can perform analysis faster).
flushAnalysisState({bool elementModels = true}) Future<void>
Plugin implementations can use this method to flush the state of analysis, so reduce the used heap size, after performing a set of operations, e.g. in afterNewContextCollection or handleAffectedFiles.
getResolvedUnitResult(String path) Future<ResolvedUnitResult>
Return the result of analyzing the file with the given path.
handleAffectedFiles({required AnalysisContext analysisContext, required List<String> paths}) Future<void>
Handles files that might have been affected by a content change of one or more files. The implementation may check if these files should be analyzed, do such analysis, and send diagnostics.
handleAnalysisGetNavigation(AnalysisGetNavigationParams parameters) Future<AnalysisGetNavigationResult>
Handle an 'analysis.getNavigation' request.
handleAnalysisHandleWatchEvents(AnalysisHandleWatchEventsParams parameters) Future<AnalysisHandleWatchEventsResult>
Handle an 'analysis.handleWatchEvents' request.
handleAnalysisSetContextRoots(AnalysisSetContextRootsParams parameters) Future<AnalysisSetContextRootsResult>
Handle an 'analysis.setContextRoots' request.
handleAnalysisSetPriorityFiles(AnalysisSetPriorityFilesParams parameters) Future<AnalysisSetPriorityFilesResult>
Handle an 'analysis.setPriorityFiles' request.
handleAnalysisSetSubscriptions(AnalysisSetSubscriptionsParams parameters) Future<AnalysisSetSubscriptionsResult>
Handle an 'analysis.setSubscriptions' request. Most subclasses should not override this method, but should instead use the subscriptionManager to access the list of subscriptions for any given file.
handleAnalysisUpdateContent(AnalysisUpdateContentParams parameters) Future<AnalysisUpdateContentResult>
Handle an 'analysis.updateContent' request. Most subclasses should not override this method, but should instead use the contentCache to access the current content of overlaid files.
handleCompletionGetSuggestions(CompletionGetSuggestionsParams parameters) Future<CompletionGetSuggestionsResult>
Handle a 'completion.getSuggestions' request.
handleEditGetAssists(EditGetAssistsParams parameters) Future<EditGetAssistsResult>
Handle an 'edit.getAssists' request.
handleEditGetAvailableRefactorings(EditGetAvailableRefactoringsParams parameters) Future<EditGetAvailableRefactoringsResult>
Handle an 'edit.getAvailableRefactorings' request. Subclasses that override this method in order to participate in refactorings must also override the method handleEditGetRefactoring.
handleEditGetFixes(EditGetFixesParams parameters) Future<EditGetFixesResult>
Handle an 'edit.getFixes' request.
handleEditGetRefactoring(EditGetRefactoringParams parameters) Future<EditGetRefactoringResult?>
Handle an 'edit.getRefactoring' request.
handlePluginShutdown(PluginShutdownParams parameters) Future<PluginShutdownResult>
Handle a 'plugin.shutdown' request. Subclasses can override this method to perform any required clean-up, but cannot prevent the plugin from shutting down.
handlePluginVersionCheck(PluginVersionCheckParams parameters) Future<PluginVersionCheckResult>
Handle a 'plugin.versionCheck' request.
isCompatibleWith(Version serverVersion) bool
Return true if this plugin is compatible with an analysis server that is using the given version of the plugin API.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onDone() → void
The method that is called when the analysis server closes the communication channel. This method will not be invoked under normal conditions because the server will send a shutdown request and the plugin will stop listening to the channel before the server closes the channel.
onError(Object exception, StackTrace stackTrace) → void
The method that is called when an error has occurred in the analysis server. This method will not be invoked under normal conditions.
sendFoldingNotification(String path) Future<void>
If the plugin provides folding information, send a folding notification for the file with the given path to the server.
sendHighlightsNotification(String path) Future<void>
If the plugin provides highlighting information, send a highlights notification for the file with the given path to the server.
sendNavigationNotification(String path) Future<void>
If the plugin provides navigation information, send a navigation notification for the file with the given path to the server.
sendNotificationsForFile(String path) → void
Send notifications for the services subscribed to for the file with the given path.
sendNotificationsForSubscriptions(Map<String, List<AnalysisService>> subscriptions) → void
Send notifications corresponding to the given description of subscriptions. The map is keyed by the path of each file for which notifications should be sent and has values representing the list of services associated with the notifications to send.
sendOccurrencesNotification(String path) Future<void>
If the plugin provides occurrences information, send an occurrences notification for the file with the given path to the server.
sendOutlineNotification(String path) Future<void>
If the plugin provides outline information, send an outline notification for the file with the given path to the server.
start(PluginCommunicationChannel channel) → void
Start this plugin by listening to the given communication channel.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited