Skip to content

Commit 9391343

Browse files
scheglovCommit Bot
authored and
Commit Bot
committed
Invoke analyzeFiles() from handleAffectedFiles() only for analyzed files.
Bug: #49404 Change-Id: I6e80394d28a51182b622ab113a5a6376dbde13ef Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/251442 Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Brian Wilkerson <[email protected]>
1 parent 57a3598 commit 9391343

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

pkg/analyzer_plugin/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.11.1
2+
- Call `analyzeFiles` from `handleAffectedFiles` only for files that are
3+
analyzed in this analysis context.
4+
15
## 0.11.0
26
- Using `AnalysisContextCollection` and `AnalysisContext` for analysis.
37

pkg/analyzer_plugin/lib/plugin/plugin.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,19 @@ abstract class ServerPlugin {
198198
/// one or more files. The implementation may check if these files should
199199
/// be analyzed, do such analysis, and send diagnostics.
200200
///
201-
/// By default invokes [analyzeFiles].
201+
/// By default invokes [analyzeFiles] only for files that are analyzed in
202+
/// this [analysisContext].
202203
Future<void> handleAffectedFiles({
203204
required AnalysisContext analysisContext,
204205
required List<String> paths,
205206
}) async {
207+
final analyzedPaths = paths
208+
.where(analysisContext.contextRoot.isAnalyzed)
209+
.toList(growable: false);
210+
206211
await analyzeFiles(
207212
analysisContext: analysisContext,
208-
paths: paths,
213+
paths: analyzedPaths,
209214
);
210215
}
211216

pkg/analyzer_plugin/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: analyzer_plugin
22
description: A framework and support code for building plugins for the analysis server.
3-
version: 0.11.0
3+
version: 0.11.1
44
repository: https://github.com/dart-lang/sdk/tree/main/pkg/analyzer_plugin
55

66
environment:

0 commit comments

Comments
 (0)