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

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

Issue 1507633002: extract named constructor suggestions from prefixed element contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart » ('j') | 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 protocol.server; 5 library protocol.server;
6 6
7 import 'package:analysis_server/plugin/protocol/protocol.dart'; 7 import 'package:analysis_server/plugin/protocol/protocol.dart';
8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart'; 8 import 'package:analysis_server/plugin/protocol/protocol_dart.dart';
9 import 'package:analysis_server/src/services/correction/fix.dart'; 9 import 'package:analysis_server/src/services/correction/fix.dart';
10 import 'package:analysis_server/src/services/search/search_engine.dart' 10 import 'package:analysis_server/src/services/search/search_engine.dart'
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 String file = source.fullName; 48 String file = source.fullName;
49 int fileStamp = context.getModificationStamp(source); 49 int fileStamp = context.getModificationStamp(source);
50 change.addEdit(file, fileStamp, edit); 50 change.addEdit(file, fileStamp, edit);
51 } 51 }
52 52
53 String getReturnTypeString(engine.Element element) { 53 String getReturnTypeString(engine.Element element) {
54 if (element is engine.ExecutableElement) { 54 if (element is engine.ExecutableElement) {
55 if (element.kind == engine.ElementKind.SETTER) { 55 if (element.kind == engine.ElementKind.SETTER) {
56 return null; 56 return null;
57 } else { 57 } else {
58 return element.returnType.toString(); 58 return element.returnType?.toString();
59 } 59 }
60 } else if (element is engine.VariableElement) { 60 } else if (element is engine.VariableElement) {
61 engine.DartType type = element.type; 61 engine.DartType type = element.type;
62 return type != null ? type.displayName : 'dynamic'; 62 return type != null ? type.displayName : 'dynamic';
63 } else if (element is engine.FunctionTypeAliasElement) { 63 } else if (element is engine.FunctionTypeAliasElement) {
64 return element.returnType.toString(); 64 return element.returnType.toString();
65 } else { 65 } else {
66 return null; 66 return null;
67 } 67 }
68 } 68 }
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 if (lineInfo != null) { 232 if (lineInfo != null) {
233 engine.LineInfo_Location offsetLocation = 233 engine.LineInfo_Location offsetLocation =
234 lineInfo.getLocation(range.offset); 234 lineInfo.getLocation(range.offset);
235 startLine = offsetLocation.lineNumber; 235 startLine = offsetLocation.lineNumber;
236 startColumn = offsetLocation.columnNumber; 236 startColumn = offsetLocation.columnNumber;
237 } 237 }
238 } 238 }
239 return new Location( 239 return new Location(
240 source.fullName, range.offset, range.length, startLine, startColumn); 240 source.fullName, range.offset, range.length, startLine, startColumn);
241 } 241 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/provisional/completion/dart/completion_dart.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698