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

Side by Side Diff: pkg/analyzer/lib/src/summary/summarize_elements.dart

Issue 1689283002: Serialize parameters visible ranges. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Changes for review comments. Created 4 years, 10 months 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 serialization.elements; 5 library serialization.elements;
6 6
7 import 'package:analyzer/dart/element/element.dart'; 7 import 'package:analyzer/dart/element/element.dart';
8 import 'package:analyzer/dart/element/type.dart'; 8 import 'package:analyzer/dart/element/type.dart';
9 import 'package:analyzer/src/dart/element/element.dart'; 9 import 'package:analyzer/src/dart/element/element.dart';
10 import 'package:analyzer/src/dart/element/member.dart'; 10 import 'package:analyzer/src/dart/element/member.dart';
(...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after
691 b.type = serializeTypeRef(type, context); 691 b.type = serializeTypeRef(type, context);
692 } 692 }
693 } 693 }
694 if (parameter is ConstVariableElement) { 694 if (parameter is ConstVariableElement) {
695 ConstVariableElement constParameter = parameter as ConstVariableElement; 695 ConstVariableElement constParameter = parameter as ConstVariableElement;
696 Expression initializer = constParameter.constantInitializer; 696 Expression initializer = constParameter.constantInitializer;
697 if (initializer != null) { 697 if (initializer != null) {
698 b.defaultValue = serializeConstExpr(initializer); 698 b.defaultValue = serializeConstExpr(initializer);
699 } 699 }
700 } 700 }
701 {
702 SourceRange visibleRange = parameter.visibleRange;
703 if (visibleRange != null) {
704 b.visibleOffset = visibleRange.offset;
705 b.visibleLength = visibleRange.length;
706 }
707 }
701 return b; 708 return b;
702 } 709 }
703 710
704 /** 711 /**
705 * Serialize the given [prefix] into an index into the references table. 712 * Serialize the given [prefix] into an index into the references table.
706 */ 713 */
707 int serializePrefix(PrefixElement element) { 714 int serializePrefix(PrefixElement element) {
708 return referenceMap.putIfAbsent(element, 715 return referenceMap.putIfAbsent(element,
709 () => serializeUnlinkedReference(element.name, ReferenceKind.prefix)); 716 () => serializeUnlinkedReference(element.name, ReferenceKind.prefix));
710 } 717 }
(...skipping 592 matching lines...) Expand 10 before | Expand all | Expand 10 after
1303 exportNames.add(new LinkedExportNameBuilder( 1310 exportNames.add(new LinkedExportNameBuilder(
1304 name: name, 1311 name: name,
1305 dependency: serializeDependency(dependentLibrary), 1312 dependency: serializeDependency(dependentLibrary),
1306 unit: unit, 1313 unit: unit,
1307 kind: kind)); 1314 kind: kind));
1308 } 1315 }
1309 pb.exportNames = exportNames; 1316 pb.exportNames = exportNames;
1310 return pb; 1317 return pb;
1311 } 1318 }
1312 } 1319 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/summary/summarize_ast.dart ('k') | pkg/analyzer/test/src/summary/summary_common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698