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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 787603004: Getters should not have parameters. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/lib/src/protocol_server.dart
diff --git a/pkg/analysis_server/lib/src/protocol_server.dart b/pkg/analysis_server/lib/src/protocol_server.dart
index 26caf44a99f7368d6778230746f27831abcad2a1..c1ebd1b7eca3bbd0b29514e61a4f25a143f0b1c7 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -226,8 +226,8 @@ Location newLocation_fromUnit(engine.CompilationUnit unit,
}
-NavigationTarget newNavigationTarget_fromElement(engine.Element element,
- int fileToIndex(String file)) {
+NavigationTarget newNavigationTarget_fromElement(engine.Element element, int
+ fileToIndex(String file)) {
ElementKind kind = newElementKind_fromEngine(element.kind);
Location location = newLocation_fromElement(element);
String file = location.file;
@@ -318,9 +318,15 @@ List<Element> _computePath(engine.Element element) {
String _getParametersString(engine.Element element) {
// TODO(scheglov) expose the corresponding feature from ExecutableElement
if (element is engine.ExecutableElement) {
- var sb = new StringBuffer();
+ // valid getters don't have parameters
+ if (element.kind == engine.ElementKind.GETTER &&
+ element.parameters.isEmpty) {
+ return null;
+ }
+ // append parameters
+ StringBuffer sb = new StringBuffer();
String closeOptionalString = '';
- for (var parameter in element.parameters) {
+ for (engine.ParameterElement parameter in element.parameters) {
if (sb.isNotEmpty) {
sb.write(', ');
}
« no previous file with comments | « pkg/analysis_server/lib/src/generated_protocol.dart ('k') | pkg/analysis_server/test/analysis/notification_outline_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698