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

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

Issue 2539243002: Transition analyzer and analysis_server to new astFactory; remove old AST factory methods. (Closed)
Patch Set: Update CHANGELOG Created 4 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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_ref; 5 library services.completion.contributor.dart.local_ref;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol
10 show Element, ElementKind; 10 show Element, ElementKind;
11 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart'; 11 import 'package:analysis_server/src/provisional/completion/dart/completion_dart. dart';
12 import 'package:analysis_server/src/services/completion/dart/completion_manager. dart' 12 import 'package:analysis_server/src/services/completion/dart/completion_manager. dart'
13 show DartCompletionRequestImpl; 13 show DartCompletionRequestImpl;
14 import 'package:analysis_server/src/services/completion/dart/local_declaration_v isitor.dart' 14 import 'package:analysis_server/src/services/completion/dart/local_declaration_v isitor.dart'
15 show LocalDeclarationVisitor; 15 show LocalDeclarationVisitor;
16 import 'package:analysis_server/src/services/completion/dart/optype.dart'; 16 import 'package:analysis_server/src/services/completion/dart/optype.dart';
17 import 'package:analysis_server/src/services/correction/strings.dart'; 17 import 'package:analysis_server/src/services/correction/strings.dart';
18 import 'package:analysis_server/src/utilities/documentation.dart'; 18 import 'package:analysis_server/src/utilities/documentation.dart';
19 import 'package:analyzer/dart/ast/ast.dart'; 19 import 'package:analyzer/dart/ast/ast.dart';
20 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
20 import 'package:analyzer/dart/ast/token.dart'; 21 import 'package:analyzer/dart/ast/token.dart';
21 import 'package:analyzer/dart/element/element.dart'; 22 import 'package:analyzer/dart/element/element.dart';
22 import 'package:analyzer/dart/element/type.dart'; 23 import 'package:analyzer/dart/element/type.dart';
23 import 'package:analyzer/src/dart/ast/token.dart'; 24 import 'package:analyzer/src/dart/ast/token.dart';
24 import 'package:analyzer/src/generated/source.dart'; 25 import 'package:analyzer/src/generated/source.dart';
25 import 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind; 26 import 'package:analyzer/src/generated/utilities_dart.dart' show ParameterKind;
26 27
27 import '../../../protocol_server.dart' 28 import '../../../protocol_server.dart'
28 show CompletionSuggestion, CompletionSuggestionKind, Location; 29 show CompletionSuggestion, CompletionSuggestionKind, Location;
29 30
30 const DYNAMIC = 'dynamic'; 31 const DYNAMIC = 'dynamic';
31 32
32 final TypeName NO_RETURN_TYPE = new TypeName( 33 final TypeName NO_RETURN_TYPE = astFactory.typeName(
33 new SimpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)), null); 34 astFactory.simpleIdentifier(new StringToken(TokenType.IDENTIFIER, '', 0)),
35 null);
34 36
35 /** 37 /**
36 * Create a new protocol Element for inclusion in a completion suggestion. 38 * Create a new protocol Element for inclusion in a completion suggestion.
37 */ 39 */
38 protocol.Element _createLocalElement( 40 protocol.Element _createLocalElement(
39 Source source, protocol.ElementKind kind, SimpleIdentifier id, 41 Source source, protocol.ElementKind kind, SimpleIdentifier id,
40 {String parameters, 42 {String parameters,
41 TypeName returnType, 43 TypeName returnType,
42 bool isAbstract: false, 44 bool isAbstract: false,
43 bool isDeprecated: false}) { 45 bool isDeprecated: false}) {
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 String text = documentationComment.tokens 617 String text = documentationComment.tokens
616 .map((Token t) => t.toString()) 618 .map((Token t) => t.toString())
617 .join('\n') 619 .join('\n')
618 .replaceAll('\r\n', '\n'); 620 .replaceAll('\r\n', '\n');
619 String doc = removeDartDocDelimiters(text); 621 String doc = removeDartDocDelimiters(text);
620 suggestion.docComplete = doc; 622 suggestion.docComplete = doc;
621 suggestion.docSummary = getDartDocSummary(doc); 623 suggestion.docSummary = getDartDocSummary(doc);
622 } 624 }
623 } 625 }
624 } 626 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698