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

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

Issue 2991453002: Restore UriReferencedElement and its uri/uriOffset/uriEnd properties. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 summary_resynthesizer; 5 library summary_resynthesizer;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart'; 9 import 'package:analyzer/dart/ast/ast.dart';
10 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; 10 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1031 * Create a [_UnitResynthesizer] that will resynthesize the part with the 1031 * Create a [_UnitResynthesizer] that will resynthesize the part with the
1032 * given [uri]. Return `null` if the [uri] is invalid. 1032 * given [uri]. Return `null` if the [uri] is invalid.
1033 */ 1033 */
1034 _UnitResynthesizer buildPart(_UnitResynthesizer definingUnitResynthesizer, 1034 _UnitResynthesizer buildPart(_UnitResynthesizer definingUnitResynthesizer,
1035 String uri, UnlinkedPart partDecl, int unitNum) { 1035 String uri, UnlinkedPart partDecl, int unitNum) {
1036 Source unitSource = 1036 Source unitSource =
1037 summaryResynthesizer.sourceFactory.resolveUri(librarySource, uri); 1037 summaryResynthesizer.sourceFactory.resolveUri(librarySource, uri);
1038 _UnitResynthesizer partResynthesizer = 1038 _UnitResynthesizer partResynthesizer =
1039 createUnitResynthesizer(unitNum, unitSource, partDecl); 1039 createUnitResynthesizer(unitNum, unitSource, partDecl);
1040 CompilationUnitElementImpl partUnit = partResynthesizer.unit; 1040 CompilationUnitElementImpl partUnit = partResynthesizer.unit;
1041 partUnit.uriOffset = partDecl.uriOffset;
1042 partUnit.uriEnd = partDecl.uriEnd;
1041 partUnit.source = unitSource; 1043 partUnit.source = unitSource;
1042 partUnit.librarySource = librarySource; 1044 partUnit.librarySource = librarySource;
1045 partUnit.uri = uri;
1043 return partResynthesizer; 1046 return partResynthesizer;
1044 } 1047 }
1045 1048
1046 /** 1049 /**
1047 * Set up data structures for deserializing a compilation unit. 1050 * Set up data structures for deserializing a compilation unit.
1048 */ 1051 */
1049 _UnitResynthesizer createUnitResynthesizer( 1052 _UnitResynthesizer createUnitResynthesizer(
1050 int unitNum, Source unitSource, UnlinkedPart unlinkedPart) { 1053 int unitNum, Source unitSource, UnlinkedPart unlinkedPart) {
1051 LinkedUnit linkedUnit = linkedLibrary.units[unitNum]; 1054 LinkedUnit linkedUnit = linkedLibrary.units[unitNum];
1052 UnlinkedUnit unlinkedUnit = unlinkedUnits[unitNum]; 1055 UnlinkedUnit unlinkedUnit = unlinkedUnits[unitNum];
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 static String _getElementIdentifier(String name, ReferenceKind kind) { 1989 static String _getElementIdentifier(String name, ReferenceKind kind) {
1987 if (kind == ReferenceKind.topLevelPropertyAccessor || 1990 if (kind == ReferenceKind.topLevelPropertyAccessor ||
1988 kind == ReferenceKind.propertyAccessor) { 1991 kind == ReferenceKind.propertyAccessor) {
1989 if (!name.endsWith('=')) { 1992 if (!name.endsWith('=')) {
1990 return name + '?'; 1993 return name + '?';
1991 } 1994 }
1992 } 1995 }
1993 return name; 1996 return name;
1994 } 1997 }
1995 } 1998 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/dart/element/handle.dart ('k') | pkg/analyzer/lib/src/task/dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698