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

Side by Side Diff: pkg/analysis_server/lib/src/services/completion/local_reference_contributor.dart

Issue 1385213002: fix call to get current source - fixes #24509 (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 services.completion.contributor.dart.local; 5 library services.completion.contributor.dart.local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/protocol.dart' as protocol 9 import 'package:analysis_server/src/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after
349 * that contains the completion offset to the [CompilationUnit]. 349 * that contains the completion offset to the [CompilationUnit].
350 */ 350 */
351 class _LocalVisitor extends LocalDeclarationVisitor { 351 class _LocalVisitor extends LocalDeclarationVisitor {
352 final DartCompletionRequest request; 352 final DartCompletionRequest request;
353 final OpType optype; 353 final OpType optype;
354 int privateMemberRelevance = DART_RELEVANCE_DEFAULT; 354 int privateMemberRelevance = DART_RELEVANCE_DEFAULT;
355 355
356 _LocalVisitor(this.request, int offset, this.optype) : super(offset) { 356 _LocalVisitor(this.request, int offset, this.optype) : super(offset) {
357 includeLocalInheritedTypes = !optype.inStaticMethodBody; 357 includeLocalInheritedTypes = !optype.inStaticMethodBody;
358 if (request.replacementLength > 0) { 358 if (request.replacementLength > 0) {
359 var contents = request.source.contents; 359 var contents = request.context.getContents(request.source);
360 if (contents != null && 360 if (contents != null &&
361 contents.data != null && 361 contents.data != null &&
362 contents.data.startsWith('_', request.replacementOffset)) { 362 contents.data.startsWith('_', request.replacementOffset)) {
363 // If user typed identifier starting with '_' 363 // If user typed identifier starting with '_'
364 // then do not suppress the relevance of private members 364 // then do not suppress the relevance of private members
365 privateMemberRelevance = null; 365 privateMemberRelevance = null;
366 } 366 }
367 } 367 }
368 } 368 }
369 369
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 bool _isVoid(TypeName returnType) { 586 bool _isVoid(TypeName returnType) {
587 if (returnType != null) { 587 if (returnType != null) {
588 Identifier id = returnType.name; 588 Identifier id = returnType.name;
589 if (id != null && id.name == 'void') { 589 if (id != null && id.name == 'void') {
590 return true; 590 return true;
591 } 591 }
592 } 592 }
593 return false; 593 return false;
594 } 594 }
595 } 595 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698