Skip to content

Commit 75ef4ef

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Add --with-fine-dependencies option for DAS.
Change-Id: I40d600320d30ee8a31b2392ad3106e43f58e12f2 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/450942 Reviewed-by: Samuel Rawlins <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]>
1 parent 4343884 commit 75ef4ef

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

pkg/analysis_server/lib/src/analysis_server.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,7 @@ abstract class AnalysisServer {
381381
analysisDriverScheduler,
382382
instrumentationService,
383383
enableBlazeWatcher: enableBlazeWatcher,
384+
withFineDependencies: options.withFineDependencies,
384385
);
385386

386387
_dartFixPrompt =

pkg/analysis_server/lib/src/context_manager.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ class ContextManagerImpl implements ContextManager {
256256
/// `--enable-experiment` command-line option.
257257
final List<String> _enabledExperiments;
258258

259+
/// Whether to enable fine-grained dependencies.
260+
final bool withFineDependencies;
261+
259262
/// Information about the current/last queued context rebuild.
260263
///
261264
/// This is used when a new build is requested to cancel any in-progress
@@ -274,6 +277,7 @@ class ContextManagerImpl implements ContextManager {
274277
this._scheduler,
275278
this._instrumentationService, {
276279
required bool enableBlazeWatcher,
280+
this.withFineDependencies = false,
277281
}) : pathContext = resourceProvider.pathContext {
278282
if (enableBlazeWatcher) {
279283
blazeWatcherService = BlazeFileWatcherService(_instrumentationService);
@@ -597,6 +601,7 @@ class ContextManagerImpl implements ContextManager {
597601
fileContentCache: _fileContentCache,
598602
unlinkedUnitStore: _unlinkedUnitStore,
599603
enabledExperiments: _enabledExperiments,
604+
withFineDependencies: withFineDependencies,
600605
);
601606

602607
for (var analysisContext in collection.contexts) {

pkg/analysis_server/lib/src/legacy_analysis_server.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ class AnalysisServerOptions {
175175
/// Experiments which have been enabled (or disabled) via the
176176
/// `--enable-experiment` command-line option.
177177
List<String> enabledExperiments = [];
178+
179+
/// Whether to enable fine-grained dependencies.
180+
bool withFineDependencies = false;
178181
}
179182

180183
/// Instances of the class [LegacyAnalysisServer] implement a server that

pkg/analysis_server/lib/src/server/driver.dart

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ class Driver implements ServerStarter {
136136
/// Flag to not use a (Evicting)FileByteStore.
137137
static const String DISABLE_FILE_BYTE_STORE = 'disable-file-byte-store';
138138

139+
/// The name of the flag to enable fine-grained dependencies.
140+
static const String WITH_FINE_DEPENDENCIES = 'with-fine-dependencies';
141+
139142
/// The builder for attachments that should be included into crash reports.
140143
CrashReportingAttachmentsBuilder crashReportingAttachmentsBuilder =
141144
CrashReportingAttachmentsBuilder.empty;
@@ -185,6 +188,9 @@ class Driver implements ServerStarter {
185188
analysisServerOptions.reportProtocolVersion = results.option(
186189
REPORT_PROTOCOL_VERSION,
187190
);
191+
analysisServerOptions.withFineDependencies = results.flag(
192+
WITH_FINE_DEPENDENCIES,
193+
);
188194

189195
analysisServerOptions.enabledExperiments = results.multiOption(
190196
ENABLE_EXPERIMENT,
@@ -851,6 +857,11 @@ class Driver implements ServerStarter {
851857
'Disable use of (Evicting)FileByteStore. Intended for benchmarking.',
852858
hide: true,
853859
);
860+
parser.addFlag(
861+
WITH_FINE_DEPENDENCIES,
862+
help: 'Enable fine-grained dependencies.',
863+
hide: true,
864+
);
854865
parser.addFlag(
855866
DISABLE_SERVER_EXCEPTION_HANDLING,
856867
// TODO(jcollins-g): Pipeline option through and apply to all

0 commit comments

Comments
 (0)