Skip to content
This repository was archived by the owner on Apr 1, 2025. It is now read-only.

Commit c29ed6c

Browse files
committed
FilePath.
1 parent dfb68fa commit c29ed6c

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

semantic-source/src/Source/Language.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ import qualified Data.Languages as Lingo
2020
import qualified Data.Map.Strict as Map
2121
import qualified Data.Text as T
2222
import GHC.Generics (Generic)
23-
import qualified System.Path as Path
24-
import qualified System.Path.PartClass as Path.PartClass
2523

2624
-- | The various languages we support.
2725
data Language
@@ -96,13 +94,13 @@ knownLanguage = (/= Unknown)
9694
extensionsForLanguage :: Language -> [String]
9795
extensionsForLanguage language = fmap T.unpack (maybe mempty Lingo.languageExtensions (Map.lookup (languageToText language) Lingo.languages))
9896

99-
forPath :: Path.PartClass.AbsRel ar => Path.File ar -> Language
97+
forPath :: FilePath -> Language
10098
forPath path =
10199
let spurious lang = lang `elem` [ "Hack" -- .php files
102100
, "GCC Machine Description" -- .md files
103101
, "XML" -- .tsx files
104102
]
105-
allResults = Lingo.languageName <$> Lingo.languagesForPath (Path.toString path)
103+
allResults = Lingo.languageName <$> Lingo.languagesForPath path
106104
in case filter (not . spurious) allResults of
107105
[result] -> textToLanguage result
108106
_ -> Unknown

0 commit comments

Comments
 (0)