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

Unified Diff: pkg/analysis_server/lib/src/protocol_server.dart

Issue 1157113004: add enum suggestions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 913e1f2bb2d1e9a9c74f1914c2f83043d987f9fd..071b678867d8f35ac1dcb5329106e1054e3802b5 100644
--- a/pkg/analysis_server/lib/src/protocol_server.dart
+++ b/pkg/analysis_server/lib/src/protocol_server.dart
@@ -87,7 +87,12 @@ Element newElement_fromEngine(engine.Element element) {
String elementTypeParameters = _getTypeParametersString(element);
String elementParameters = _getParametersString(element);
String elementReturnType = _getReturnTypeString(element);
- return new Element(newElementKind_fromEngine(element.kind), name, Element
+ ElementKind kind = newElementKind_fromEngine(element.kind);
+ // TODO(danrubel) this check should be in newElementKind_fromEngine
+ if (element is engine.ClassElement && element.isEnum) {
+ kind = ElementKind.ENUM;
+ }
+ return new Element(kind, name, Element
.makeFlags(
isPrivate: element.isPrivate,
isDeprecated: element.isDeprecated,
@@ -106,6 +111,7 @@ Element newElement_fromEngine(engine.Element element) {
*/
ElementKind newElementKind_fromEngine(engine.ElementKind kind) {
if (kind == engine.ElementKind.CLASS) {
+ // TODO(danrubel) check if element.isEnum and return ElementKind.ENUM
return ElementKind.CLASS;
}
if (kind == engine.ElementKind.COMPILATION_UNIT) {
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698