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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 1828793002: Fix for searching LocalVariableElement of DeclaredIdentifier. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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) 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 analyzer.src.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 3740 matching lines...) Expand 10 before | Expand all | Expand 10 after
3751 accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this); 3751 accept(ElementVisitor visitor) => visitor.visitLocalVariableElement(this);
3752 3752
3753 @override 3753 @override
3754 void appendTo(StringBuffer buffer) { 3754 void appendTo(StringBuffer buffer) {
3755 buffer.write(type); 3755 buffer.write(type);
3756 buffer.write(" "); 3756 buffer.write(" ");
3757 buffer.write(displayName); 3757 buffer.write(displayName);
3758 } 3758 }
3759 3759
3760 @override 3760 @override
3761 VariableDeclaration computeNode() => 3761 Declaration computeNode() => getNodeMatching(
3762 getNodeMatching((node) => node is VariableDeclaration); 3762 (node) => node is DeclaredIdentifier || node is VariableDeclaration);
3763 3763
3764 /** 3764 /**
3765 * Set the visible range for this element to the range starting at the given 3765 * Set the visible range for this element to the range starting at the given
3766 * [offset] with the given [length]. 3766 * [offset] with the given [length].
3767 */ 3767 */
3768 void setVisibleRange(int offset, int length) { 3768 void setVisibleRange(int offset, int length) {
3769 _visibleRangeOffset = offset; 3769 _visibleRangeOffset = offset;
3770 _visibleRangeLength = length; 3770 _visibleRangeLength = length;
3771 } 3771 }
3772 } 3772 }
(...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after
4930 4930
4931 @override 4931 @override
4932 void visitElement(Element element) { 4932 void visitElement(Element element) {
4933 int offset = element.nameOffset; 4933 int offset = element.nameOffset;
4934 if (offset != -1) { 4934 if (offset != -1) {
4935 map[offset] = element; 4935 map[offset] = element;
4936 } 4936 }
4937 super.visitElement(element); 4937 super.visitElement(element);
4938 } 4938 }
4939 } 4939 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/services/search/search_engine_test.dart ('k') | pkg/analyzer/test/src/dart/element/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698