Skip to content

Commit 6559416

Browse files
authored
Do not error out on failed rewrite (#1269)
The error call was only for diagnostics, so I have replaced it with a debug trace (commented out)
1 parent 4d99f1a commit 6559416

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

ghcide/src/Development/IDE/Plugin/CodeAction.hs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ codeAction lsp state _ (TextDocumentIdentifier uri) _range CodeActionContext{_di
9797
, Just ps <- [annotatedPS]
9898
, Just dynflags <- [df]
9999
, (title, graft) <- suggestExactAction exportsMap dynflags ps x
100-
, let edit = either error id $
101-
rewriteToEdit dynflags uri (annsA ps) graft
100+
, Right edit <-
101+
[ -- either (Left . traceShow) Right $
102+
rewriteToEdit dynflags uri (annsA ps) graft
103+
]
102104
]
103105
actions'' = caRemoveRedundantImports parsedModule text diag xs uri
104106
<> actions

0 commit comments

Comments
 (0)