File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
ghcide/src/Development/IDE/Plugin Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -108,9 +108,7 @@ codeAction lsp state (TextDocumentIdentifier uri) _range CodeActionContext{_diag
108108 [ mkCA title [x] edit
109109 | x <- xs, (title, tedit) <- suggestAction exportsMap ideOptions parsedModule text x
110110 , let edit = WorkspaceEdit (Just $ Map. singleton uri $ List tedit) Nothing
111- ] <> caRemoveInvalidExports parsedModule text diag xs uri
112- <> caRemoveRedundantImports parsedModule text diag xs uri
113-
111+ ]
114112 actions' =
115113 [mkCA title [x] edit
116114 | x <- xs
@@ -120,7 +118,11 @@ codeAction lsp state (TextDocumentIdentifier uri) _range CodeActionContext{_diag
120118 , let edit = either error id $
121119 rewriteToEdit dynflags uri (annsA ps) graft
122120 ]
123- pure $ Right $ actions' <> actions
121+ actions'' = caRemoveRedundantImports parsedModule text diag xs uri
122+ <> actions
123+ <> actions'
124+ <> caRemoveInvalidExports parsedModule text diag xs uri
125+ pure $ Right actions''
124126
125127mkCA :: T. Text -> [Diagnostic ] -> WorkspaceEdit -> CAResult
126128mkCA title diags edit =
You can’t perform that action at this time.
0 commit comments