Chromium Code Reviews| 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 b783e84c903fb39f5c64875930cd68de35186023..2a8e6f53a5ae6d3cd836dc10d46e657151f22a13 100644 |
| --- a/pkg/analysis_server/lib/src/protocol_server.dart |
| +++ b/pkg/analysis_server/lib/src/protocol_server.dart |
| @@ -226,6 +226,22 @@ Location newLocation_fromUnit(engine.CompilationUnit unit, |
| } |
| +NavigationTarget newNavigationTarget_fromElement(engine.Element element, |
| + fileToIndex(String file)) { |
|
Paul Berry
2014/12/01 21:50:37
For additional type safety, let's make this "int f
scheglov
2014/12/01 22:20:32
Done.
|
| + ElementKind kind = newElementKind_fromEngine(element.kind); |
| + Location location = newLocation_fromElement(element); |
| + String file = location.file; |
| + int fileIndex = fileToIndex(file); |
| + return new NavigationTarget( |
| + kind, |
| + fileIndex, |
| + location.offset, |
| + location.length, |
| + location.startLine, |
| + location.startColumn); |
| +} |
| + |
| + |
| /** |
| * Construct based on an element from the analyzer engine. |
| */ |