@@ -164,7 +164,7 @@ showModName = T.pack . moduleNameString
164
164
-- Nothing Nothing Nothing Nothing (Just insertText) (Just Snippet)
165
165
-- Nothing Nothing Nothing Nothing Nothing
166
166
167
- mkCompl :: PluginId -> IdeOptions -> CompItem -> IO CompletionItem
167
+ mkCompl :: PluginId -> IdeOptions -> CompItem -> CompletionItem
168
168
mkCompl
169
169
pId
170
170
IdeOptions {.. }
@@ -178,7 +178,7 @@ mkCompl
178
178
docs,
179
179
additionalTextEdits
180
180
} = do
181
- mbCommand <- mkAdditionalEditsCommand pId `traverse ` additionalTextEdits
181
+ let mbCommand = mkAdditionalEditsCommand pId `fmap ` additionalTextEdits
182
182
let ci = CompletionItem
183
183
{_label = label,
184
184
_kind = kind,
@@ -197,7 +197,7 @@ mkCompl
197
197
_commitCharacters = Nothing ,
198
198
_command = mbCommand,
199
199
_xdata = Nothing }
200
- return $ removeSnippetsWhen (isJust isInfix) ci
200
+ removeSnippetsWhen (isJust isInfix) ci
201
201
202
202
where kind = Just compKind
203
203
docs' = imported : spanDocToMarkdown docs
@@ -209,8 +209,8 @@ mkCompl
209
209
MarkupContent MkMarkdown $
210
210
T. intercalate sectionSeparator docs'
211
211
212
- mkAdditionalEditsCommand :: PluginId -> ExtendImport -> IO Command
213
- mkAdditionalEditsCommand pId edits = pure $
212
+ mkAdditionalEditsCommand :: PluginId -> ExtendImport -> Command
213
+ mkAdditionalEditsCommand pId edits =
214
214
mkLspCommand pId (CommandId extendImportCommandId) " extend import" (Just [toJSON edits])
215
215
216
216
mkNameCompItem :: Uri -> Maybe T. Text -> OccName -> ModuleName -> Maybe Type -> Maybe Backtick -> SpanDoc -> Maybe (LImportDecl GhcPs ) -> CompItem
@@ -629,7 +629,7 @@ getCompletions plId ideOpts CC {allModNamesAsNS, anyQualCompls, unqualCompls, qu
629
629
| otherwise -> do
630
630
-- assumes that nubOrdBy is stable
631
631
let uniqueFiltCompls = nubOrdBy uniqueCompl filtCompls
632
- compls <- mapM (mkCompl plId ideOpts) uniqueFiltCompls
632
+ let compls = map (mkCompl plId ideOpts) uniqueFiltCompls
633
633
return $ filtModNameCompls
634
634
++ filtKeywordCompls
635
635
++ map (toggleSnippets caps config) compls
0 commit comments