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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart

Issue 1076773002: do not suggest local functions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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/test/mock_sdk.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
index fb31174f9b6561e8870022ed2bff07ac3832e55e..d8afca40706b15e297f24c3cfa1494ac7718e5a1 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart
@@ -310,9 +310,15 @@ class DartCompletionCache extends CompletionCache {
*/
void _addSuggestion(Element element, int relevance) {
if (element is ExecutableElement) {
+ // Do not suggest operators or local functions
if (element.isOperator) {
return;
}
+ if (element is FunctionElement) {
+ if (element.enclosingElement is! CompilationUnitElement) {
+ return;
+ }
+ }
}
CompletionSuggestion suggestion =
« no previous file with comments | « no previous file | pkg/analysis_server/test/mock_sdk.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698