diff --git a/lib/src/analyzer_plugin/analyzer_plugin.dart b/lib/src/analyzer_plugin/analyzer_plugin.dart index 23129b2424..7edc407a5a 100644 --- a/lib/src/analyzer_plugin/analyzer_plugin.dart +++ b/lib/src/analyzer_plugin/analyzer_plugin.dart @@ -56,6 +56,11 @@ class AnalyzerPlugin extends ServerPlugin { required AnalysisContext analysisContext, required String path, }) async { + final isAnalyzed = analysisContext.contextRoot.isAnalyzed(path); + if (!isAnalyzed) { + return; + } + try { final resolvedUnit = await analysisContext.currentSession.getResolvedUnit(path);