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
15
15
, useWithStaleFastE
16
16
, useWithStaleFastMT
17
17
, uriToFilePathE
18
+ , uriToNormalizedFilePathE
18
19
-- * Wrapped PositionMapping functions
19
20
, toCurrentPositionE
20
21
, toCurrentPositionMT
@@ -136,6 +137,11 @@ useWithStaleFastMT k = MaybeT . Shake.useWithStaleFast k
136
137
uriToFilePathE :: Monad m => LSP. Uri -> ExceptT PluginError m FilePath
137
138
uriToFilePathE uri = maybeToExceptT (PluginInvalidParams (T. pack $ " uriToFilePath' failed. Uri:" <> show uri)) $ uriToFilePathMT uri
138
139
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
+
139
145
-- | MaybeT version of `uriToFilePath`
140
146
uriToFilePathMT :: Monad m => LSP. Uri -> MaybeT m FilePath
141
147
uriToFilePathMT = MaybeT . pure . Location. uriToFilePath'
You can’t perform that action at this time.
0 commit comments