Skip to content

Commit f202d4c

Browse files
committed
+ documentation
1 parent d52690d commit f202d4c

File tree

1 file changed

+8
-0
lines changed
  • plugins/hls-cabal-plugin/src/Ide/Plugin

1 file changed

+8
-0
lines changed

plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,14 @@ hover ide _ msgParam = do
368368
dependencyName :: Dependency -> T.Text
369369
dependencyName dep = T.pack $ unPackageName $ depPkgName dep
370370

371+
-- | Removes version requirements like
372+
-- `==1.0.0.0`, `>= 2.1.1` that could be included in
373+
-- hover message. Assumes that the dependency consists
374+
-- of alphanums with dashes in between. Ends with an alphanum.
375+
--
376+
-- Examples:
377+
-- >>> filterVersion "imp-deps>=2.1.1"
378+
-- "imp-deps"
371379
filterVersion :: T.Text -> Maybe T.Text
372380
filterVersion msg = getMatch (msg =~ regex)
373381
where

0 commit comments

Comments
 (0)