| Index: pkg/analysis_server/lib/src/computer/computer_navigation.dart
|
| diff --git a/pkg/analysis_server/lib/src/computer/computer_navigation.dart b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
|
| index ab0d8547f53b5cb462b1c4da2deb29dcb1c06b02..c3081ba43d7a7208fd3fd6aa2317812a1c2728ca 100644
|
| --- a/pkg/analysis_server/lib/src/computer/computer_navigation.dart
|
| +++ b/pkg/analysis_server/lib/src/computer/computer_navigation.dart
|
| @@ -33,6 +33,16 @@ class DartUnitNavigationComputer {
|
| _unit.accept(new _DartUnitNavigationComputerVisitor(this));
|
| }
|
|
|
| + int _addFile(String file) {
|
| + int index = fileMap[file];
|
| + if (index == null) {
|
| + index = files.length;
|
| + files.add(file);
|
| + fileMap[file] = index;
|
| + }
|
| + return index;
|
| + }
|
| +
|
| void _addRegion(int offset, int length, Element element) {
|
| if (element is FieldFormalParameterElement) {
|
| element = (element as FieldFormalParameterElement).field;
|
| @@ -48,28 +58,6 @@ class DartUnitNavigationComputer {
|
| new protocol.NavigationRegion(offset, length, <int>[targetIndex]));
|
| }
|
|
|
| - int _addTarget(Element element) {
|
| - int index = targetMap[element];
|
| - if (index == null) {
|
| - index = targets.length;
|
| - protocol.NavigationTarget target =
|
| - protocol.newNavigationTarget_fromElement(element, _addFile);
|
| - targets.add(target);
|
| - targetMap[element] = index;
|
| - }
|
| - return index;
|
| - }
|
| -
|
| - int _addFile(String file) {
|
| - int index = fileMap[file];
|
| - if (index == null) {
|
| - index = files.length;
|
| - files.add(file);
|
| - fileMap[file] = index;
|
| - }
|
| - return index;
|
| - }
|
| -
|
| void _addRegion_nodeStart_nodeEnd(AstNode a, AstNode b, Element element) {
|
| int offset = a.offset;
|
| int length = b.end - offset;
|
| @@ -93,6 +81,18 @@ class DartUnitNavigationComputer {
|
| int length = token.length;
|
| _addRegion(offset, length, element);
|
| }
|
| +
|
| + int _addTarget(Element element) {
|
| + int index = targetMap[element];
|
| + if (index == null) {
|
| + index = targets.length;
|
| + protocol.NavigationTarget target =
|
| + protocol.newNavigationTarget_fromElement(element, _addFile);
|
| + targets.add(target);
|
| + targetMap[element] = index;
|
| + }
|
| + return index;
|
| + }
|
| }
|
|
|
|
|
| @@ -245,6 +245,23 @@ class _DartUnitNavigationComputerVisitor extends RecursiveAstVisitor {
|
| computer._addRegionForNode(node, element);
|
| }
|
|
|
| + @override
|
| + visitSuperConstructorInvocation(SuperConstructorInvocation node) {
|
| + Element element = node.staticElement;
|
| + if (element != null && element.isSynthetic) {
|
| + element = element.enclosingElement;
|
| + }
|
| + // add region
|
| + SimpleIdentifier name = node.constructorName;
|
| + if (name != null) {
|
| + computer._addRegion_nodeStart_nodeEnd(node, name, element);
|
| + } else {
|
| + computer._addRegionForToken(node.keyword, element);
|
| + }
|
| + // process arguments
|
| + _safelyVisit(node.argumentList);
|
| + }
|
| +
|
| void _safelyVisit(AstNode node) {
|
| if (node != null) {
|
| node.accept(this);
|
|
|