Skip to content

Commit

Permalink
+ documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
VenInf committed Aug 29, 2024
1 parent d52690d commit f202d4c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions plugins/hls-cabal-plugin/src/Ide/Plugin/Cabal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,14 @@ hover ide _ msgParam = do
dependencyName :: Dependency -> T.Text
dependencyName dep = T.pack $ unPackageName $ depPkgName dep

-- | Removes version requirements like
-- `==1.0.0.0`, `>= 2.1.1` that could be included in
-- hover message. Assumes that the dependency consists
-- of alphanums with dashes in between. Ends with an alphanum.
--
-- Examples:
-- >>> filterVersion "imp-deps>=2.1.1"
-- "imp-deps"
filterVersion :: T.Text -> Maybe T.Text
filterVersion msg = getMatch (msg =~ regex)
where
Expand Down

0 comments on commit f202d4c

Please sign in to comment.