@@ -151,7 +151,7 @@ showModName = T.pack . moduleNameString
151
151
-- Nothing Nothing Nothing Nothing (Just insertText) (Just Snippet)
152
152
-- Nothing Nothing Nothing Nothing Nothing
153
153
154
- mkCompl :: PluginId -> IdeOptions -> CompItem -> IO CompletionItem
154
+ mkCompl :: PluginId -> IdeOptions -> CompItem -> CompletionItem
155
155
mkCompl
156
156
pId
157
157
IdeOptions {.. }
@@ -165,7 +165,7 @@ mkCompl
165
165
docs,
166
166
additionalTextEdits
167
167
} = do
168
- mbCommand <- mkAdditionalEditsCommand pId `traverse ` additionalTextEdits
168
+ let mbCommand = mkAdditionalEditsCommand pId `fmap ` additionalTextEdits
169
169
let ci = CompletionItem
170
170
{_label = label,
171
171
_kind = kind,
@@ -184,7 +184,7 @@ mkCompl
184
184
_commitCharacters = Nothing ,
185
185
_command = mbCommand,
186
186
_xdata = Nothing }
187
- return $ removeSnippetsWhen (isJust isInfix) ci
187
+ removeSnippetsWhen (isJust isInfix) ci
188
188
189
189
where kind = Just compKind
190
190
docs' = imported : spanDocToMarkdown docs
@@ -196,8 +196,8 @@ mkCompl
196
196
MarkupContent MkMarkdown $
197
197
T. intercalate sectionSeparator docs'
198
198
199
- mkAdditionalEditsCommand :: PluginId -> ExtendImport -> IO Command
200
- mkAdditionalEditsCommand pId edits = pure $
199
+ mkAdditionalEditsCommand :: PluginId -> ExtendImport -> Command
200
+ mkAdditionalEditsCommand pId edits =
201
201
mkLspCommand pId (CommandId extendImportCommandId) " extend import" (Just [toJSON edits])
202
202
203
203
mkNameCompItem :: Uri -> Maybe T. Text -> OccName -> ModuleName -> Maybe Type -> Maybe Backtick -> SpanDoc -> Maybe (LImportDecl GhcPs ) -> CompItem
@@ -616,7 +616,7 @@ getCompletions plId ideOpts CC {allModNamesAsNS, anyQualCompls, unqualCompls, qu
616
616
| otherwise -> do
617
617
-- assumes that nubOrdBy is stable
618
618
let uniqueFiltCompls = nubOrdBy uniqueCompl filtCompls
619
- compls <- mapM (mkCompl plId ideOpts) uniqueFiltCompls
619
+ let compls = map (mkCompl plId ideOpts) uniqueFiltCompls
620
620
return $ filtModNameCompls
621
621
++ filtKeywordCompls
622
622
++ map (toggleSnippets caps config) compls
0 commit comments