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

Unified Diff: pkg/analysis_server/lib/src/services/correction/assist_internal.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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/util.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/correction/assist_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
index 9f5bb8790815fb5bc3d600e99e19747f7c0bc94c..3bed9ab989b22baad6804a8d3253d43cdd1c7209 100644
--- a/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/assist_internal.dart
@@ -204,6 +204,11 @@ class AssistProcessor {
_coverageMarker();
return;
}
+ // type source might be null, if the type is private
+ if (typeSource == null) {
+ _coverageMarker();
+ return;
+ }
// add edit
Token keyword = declaredIdentifier.keyword;
if (keyword is KeywordToken && keyword.keyword == Keyword.VAR) {
@@ -248,6 +253,11 @@ class AssistProcessor {
typeSource = utils.getTypeSource(type, librariesToImport);
addLibraryImports(change, unitLibraryElement, librariesToImport);
}
+ // type source might be null, if the type is private
+ if (typeSource == null) {
+ _coverageMarker();
+ return;
+ }
// add edit
_addInsertEdit(name.offset, '$typeSource ');
// add proposal
@@ -297,6 +307,11 @@ class AssistProcessor {
_coverageMarker();
return;
}
+ // type source might be null, if the type is private
+ if (typeSource == null) {
+ _coverageMarker();
+ return;
+ }
// add edit
Token keyword = declarationList.keyword;
if (keyword is KeywordToken && keyword.keyword == Keyword.VAR) {
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698