Skip to content

Commit f1d19ba

Browse files
committed
Do not show uris in the argument documentation
Uris are already shown in the function documentation. No need to show them in the argument documentation again.
1 parent eeeb283 commit f1d19ba

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

plugins/hls-signature-help-plugin/src/Ide/Plugin/SignatureHelp.hs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ import Development.IDE.GHC.Compat (FastStringCompat, Name,
3535
sourceNodeInfo)
3636
import Development.IDE.GHC.Compat.Util (LexicalFastString (LexicalFastString))
3737
import Development.IDE.Spans.Common (ArgDocMap, DocMap,
38-
SpanDoc,
38+
SpanDoc (..),
39+
SpanDocUris (SpanDocUris),
3940
spanDocToMarkdown)
4041
import GHC.Core.Map.Type (deBruijnize)
4142
import GHC.Core.Type (FunTyFlag (FTF_T_T),
@@ -142,8 +143,14 @@ mkArguments thisArgDocMap offset functionType =
142143
| (argIndex, range) <- zip [0..] (bimap (+offset) (+offset) <$> findArgumentRanges functionType)
143144
, let mArgDoc = case IntMap.lookup argIndex thisArgDocMap of
144145
Nothing -> Nothing
145-
Just spanDoc -> Just $ InR $ mkMarkdownDoc spanDoc
146+
Just spanDoc -> Just $ InR $ mkMarkdownDoc $ removeUris spanDoc
146147
]
148+
where
149+
-- we already show uris in the function doc, no need to duplicate them in the arg doc
150+
removeUris (SpanDocString docs _uris) = SpanDocString docs emptyUris
151+
removeUris (SpanDocText docs _uris) = SpanDocText docs emptyUris
152+
153+
emptyUris = SpanDocUris Nothing Nothing
147154

148155
mkMarkdownDoc :: SpanDoc -> MarkupContent
149156
mkMarkdownDoc = spanDocToMarkdown >>> T.unlines >>> MarkupContent MarkupKind_Markdown

0 commit comments

Comments
 (0)