Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: pkg/analysis_server/lib/src/analysis_server.dart

Issue 1486663003: Ensure that a complete library element has constants evaluated (issue 24890) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analysis.server; 5 library analysis.server;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:core' hide Resource; 9 import 'dart:core' hide Resource;
10 import 'dart:math' show max; 10 import 'dart:math' show max;
(...skipping 16 matching lines...) Expand all
27 import 'package:analyzer/source/pub_package_map_provider.dart'; 27 import 'package:analyzer/source/pub_package_map_provider.dart';
28 import 'package:analyzer/src/generated/ast.dart'; 28 import 'package:analyzer/src/generated/ast.dart';
29 import 'package:analyzer/src/generated/element.dart'; 29 import 'package:analyzer/src/generated/element.dart';
30 import 'package:analyzer/src/generated/engine.dart'; 30 import 'package:analyzer/src/generated/engine.dart';
31 import 'package:analyzer/src/generated/java_engine.dart'; 31 import 'package:analyzer/src/generated/java_engine.dart';
32 import 'package:analyzer/src/generated/java_io.dart'; 32 import 'package:analyzer/src/generated/java_io.dart';
33 import 'package:analyzer/src/generated/sdk.dart'; 33 import 'package:analyzer/src/generated/sdk.dart';
34 import 'package:analyzer/src/generated/source.dart'; 34 import 'package:analyzer/src/generated/source.dart';
35 import 'package:analyzer/src/generated/source_io.dart'; 35 import 'package:analyzer/src/generated/source_io.dart';
36 import 'package:analyzer/src/generated/utilities_general.dart'; 36 import 'package:analyzer/src/generated/utilities_general.dart';
37 import 'package:analyzer/src/task/dart.dart';
37 import 'package:analyzer/src/util/glob.dart'; 38 import 'package:analyzer/src/util/glob.dart';
38 import 'package:plugin/plugin.dart'; 39 import 'package:plugin/plugin.dart';
39 40
40 typedef void OptionUpdater(AnalysisOptionsImpl options); 41 typedef void OptionUpdater(AnalysisOptionsImpl options);
41 42
42 /** 43 /**
43 * Enum representing reasons why analysis might be done for a given file. 44 * Enum representing reasons why analysis might be done for a given file.
44 */ 45 */
45 class AnalysisDoneReason { 46 class AnalysisDoneReason {
46 /** 47 /**
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 * been yet resolved, or any problem happened. 1315 * been yet resolved, or any problem happened.
1315 */ 1316 */
1316 CompilationUnit _getResolvedCompilationUnitToResendNotification( 1317 CompilationUnit _getResolvedCompilationUnitToResendNotification(
1317 AnalysisContext context, Source source) { 1318 AnalysisContext context, Source source) {
1318 List<Source> librarySources = context.getLibrariesContaining(source); 1319 List<Source> librarySources = context.getLibrariesContaining(source);
1319 if (librarySources.isEmpty) { 1320 if (librarySources.isEmpty) {
1320 return null; 1321 return null;
1321 } 1322 }
1322 // if library has not been resolved yet, the unit will be resolved later 1323 // if library has not been resolved yet, the unit will be resolved later
1323 Source librarySource = librarySources[0]; 1324 Source librarySource = librarySources[0];
1324 if (context.getLibraryElement(librarySource) == null) { 1325 if (context.getResult(librarySource, LIBRARY_ELEMENT8) == null) {
Paul Berry 2015/11/30 20:44:35 I'm also concerned about the leakage of LIBRARY_EL
Brian Wilkerson 2015/11/30 21:35:39 As I'm sure you know, the method getLibraryElement
eernst 2015/12/14 10:01:39 DBC: If LIBRARY_ELEMENT8 and maybe other, similarl
Brian Wilkerson 2015/12/14 15:38:26 Absolutely. We had a discussion in the office abou
1325 return null; 1326 return null;
1326 } 1327 }
1327 // if library has been already resolved, resolve unit 1328 // if library has been already resolved, resolve unit
1328 return runWithWorkingCacheSize(context, () { 1329 return runWithWorkingCacheSize(context, () {
1329 return context.resolveCompilationUnit2(source, librarySource); 1330 return context.resolveCompilationUnit2(source, librarySource);
1330 }); 1331 });
1331 } 1332 }
1332 1333
1333 _scheduleAnalysisImplementedNotification() async { 1334 _scheduleAnalysisImplementedNotification() async {
1334 Set<String> files = analysisServices[AnalysisService.IMPLEMENTED]; 1335 Set<String> files = analysisServices[AnalysisService.IMPLEMENTED];
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
1667 /** 1668 /**
1668 * The [PerformanceTag] for time spent in server request handlers. 1669 * The [PerformanceTag] for time spent in server request handlers.
1669 */ 1670 */
1670 static PerformanceTag serverRequests = new PerformanceTag('serverRequests'); 1671 static PerformanceTag serverRequests = new PerformanceTag('serverRequests');
1671 1672
1672 /** 1673 /**
1673 * The [PerformanceTag] for time spent in split store microtasks. 1674 * The [PerformanceTag] for time spent in split store microtasks.
1674 */ 1675 */
1675 static PerformanceTag splitStore = new PerformanceTag('splitStore'); 1676 static PerformanceTag splitStore = new PerformanceTag('splitStore');
1676 } 1677 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698