File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
ghcide/src/Development/IDE/Core Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ module Development.IDE.Core.PluginUtils
1515, useWithStaleFastE
1616, useWithStaleFastMT
1717, uriToFilePathE
18+ , uriToNormalizedFilePathE
1819-- * Wrapped PositionMapping functions
1920, toCurrentPositionE
2021, toCurrentPositionMT
@@ -136,6 +137,11 @@ useWithStaleFastMT k = MaybeT . Shake.useWithStaleFast k
136137uriToFilePathE :: Monad m => LSP. Uri -> ExceptT PluginError m FilePath
137138uriToFilePathE uri = maybeToExceptT (PluginInvalidParams (T. pack $ " uriToFilePath' failed. Uri:" <> show uri)) $ uriToFilePathMT uri
138139
140+ -- | ExceptT version of `toNormalizedFilePath . uriToFilePath` that throws a PluginInvalidParams upon
141+ -- failure
142+ uriToNormalizedFilePathE :: Monad m => LSP. Uri -> ExceptT PluginError m NormalizedFilePath
143+ uriToNormalizedFilePathE uri = LSP. toNormalizedFilePath <$> uriToFilePathE uri
144+
139145-- | MaybeT version of `uriToFilePath`
140146uriToFilePathMT :: Monad m => LSP. Uri -> MaybeT m FilePath
141147uriToFilePathMT = MaybeT . pure . Location. uriToFilePath'
You can’t perform that action at this time.
0 commit comments