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

Unified Diff: pkg/analysis_server/lib/src/services/correction/util.dart

Issue 1014503004: Issue 22834. Disable 'Add type annotation' Quick Assist if the type is not accessible. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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
Index: pkg/analysis_server/lib/src/services/correction/util.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/util.dart b/pkg/analysis_server/lib/src/services/correction/util.dart
index d7382bbc04200722a6d28697167372cdfdb5f8a6..0f53ef5e4419c37cd5eb76cdf5c08831d76c7112 100644
--- a/pkg/analysis_server/lib/src/services/correction/util.dart
+++ b/pkg/analysis_server/lib/src/services/correction/util.dart
@@ -1001,6 +1001,11 @@ class CorrectionUtils {
// check if imported
LibraryElement library = element.library;
if (library != null && library != _library) {
+ // no source, if private
+ if (element.isPrivate) {
+ return null;
+ }
+ // ensure import
ImportElement importElement = _getImportElement(element);
if (importElement != null) {
if (importElement.prefix != null) {

Powered by Google App Engine
This is Rietveld 408576698