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

Side by Side Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 766323002: Compressed/optimized navigation notification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Updates for review comments. 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 unified diff | Download patch | Annotate | Revision Log
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 protocol.server; 5 library protocol.server;
6 6
7 import 'package:analysis_server/src/protocol.dart'; 7 import 'package:analysis_server/src/protocol.dart';
8 import 'package:analysis_server/src/services/search/search_engine.dart' as 8 import 'package:analysis_server/src/services/search/search_engine.dart' as
9 engine; 9 engine;
10 import 'package:analyzer/src/generated/ast.dart' as engine; 10 import 'package:analyzer/src/generated/ast.dart' as engine;
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 */ 219 */
220 Location newLocation_fromUnit(engine.CompilationUnit unit, 220 Location newLocation_fromUnit(engine.CompilationUnit unit,
221 engine.SourceRange range) { 221 engine.SourceRange range) {
222 engine.CompilationUnitElement unitElement = unit.element; 222 engine.CompilationUnitElement unitElement = unit.element;
223 engine.AnalysisContext context = unitElement.context; 223 engine.AnalysisContext context = unitElement.context;
224 engine.Source source = unitElement.source; 224 engine.Source source = unitElement.source;
225 return _locationForArgs(context, source, range); 225 return _locationForArgs(context, source, range);
226 } 226 }
227 227
228 228
229 NavigationTarget newNavigationTarget_fromElement(engine.Element element,
230 int fileToIndex(String file)) {
231 ElementKind kind = newElementKind_fromEngine(element.kind);
232 Location location = newLocation_fromElement(element);
233 String file = location.file;
234 int fileIndex = fileToIndex(file);
235 return new NavigationTarget(
236 kind,
237 fileIndex,
238 location.offset,
239 location.length,
240 location.startLine,
241 location.startColumn);
242 }
243
244
229 /** 245 /**
230 * Construct based on an element from the analyzer engine. 246 * Construct based on an element from the analyzer engine.
231 */ 247 */
232 OverriddenMember newOverriddenMember_fromEngine(engine.Element member) { 248 OverriddenMember newOverriddenMember_fromEngine(engine.Element member) {
233 Element element = newElement_fromEngine(member); 249 Element element = newElement_fromEngine(member);
234 String className = member.enclosingElement.displayName; 250 String className = member.enclosingElement.displayName;
235 return new OverriddenMember(element, className); 251 return new OverriddenMember(element, className);
236 } 252 }
237 253
238 254
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 startColumn = offsetLocation.columnNumber; 416 startColumn = offsetLocation.columnNumber;
401 } 417 }
402 } 418 }
403 return new Location( 419 return new Location(
404 source.fullName, 420 source.fullName,
405 range.offset, 421 range.offset,
406 range.length, 422 range.length,
407 startLine, 423 startLine,
408 startColumn); 424 startColumn);
409 } 425 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698