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

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

Issue 2616163002: Remove REPLACE_IMPORT_URI Quick Fix. (Closed)
Patch Set: Created 3 years, 11 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/fix_internal.dart
diff --git a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
index e5c3015fc498eb2f48e12dbc4ad3a9d96623b7a6..257545012305649147dc642dba0954b2ef473ebc 100644
--- a/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
+++ b/pkg/analysis_server/lib/src/services/correction/fix_internal.dart
@@ -210,10 +210,6 @@ class FixProcessor {
if (errorCode == CompileTimeErrorCode.URI_DOES_NOT_EXIST) {
_addFix_createImportUri();
_addFix_createPartUri();
- _addFix_replaceImportUri();
- }
- if (errorCode == CompileTimeErrorCode.URI_HAS_NOT_BEEN_GENERATED) {
- _addFix_replaceImportUri();
}
if (errorCode == HintCode.CAN_BE_NULL_AFTER_NULL_AWARE) {
_addFix_canBeNullAfterNullAware();
@@ -1814,32 +1810,6 @@ class FixProcessor {
_addFix(DartFixKind.REMOVE_UNUSED_IMPORT, []);
}
- void _addFix_replaceImportUri() {
- if (node is SimpleStringLiteral) {
- SimpleStringLiteral stringLiteral = node;
- String uri = stringLiteral.value;
- String uriName = substringAfterLast(uri, '/');
- for (Source libSource in context.librarySources) {
- String libFile = libSource.fullName;
- if (substringAfterLast(libFile, '/') == uriName) {
- String fixedUri;
- // may be "package:" URI
- String libPackageUri = findNonFileUri(context, libFile);
- if (libPackageUri != null) {
- fixedUri = libPackageUri;
- } else {
- String relativeFile = relative(libFile, from: unitLibraryFolder);
- fixedUri = split(relativeFile).join('/');
- }
- // add fix
- SourceRange range = rf.rangeNode(node);
- _addReplaceEdit(range, "'$fixedUri'");
- _addFix(DartFixKind.REPLACE_IMPORT_URI, [fixedUri]);
- }
- }
- }
- }
-
void _addFix_replaceVarWithDynamic() {
SourceRange range = rf.rangeError(error);
_addReplaceEdit(range, 'dynamic');
« no previous file with comments | « pkg/analysis_server/lib/src/services/correction/fix.dart ('k') | pkg/analysis_server/lib/src/services/correction/util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698