Skip to content

Commit 895c17c

Browse files
Get version from Paths_fourmolu
1 parent 2309224 commit 895c17c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

plugins/hls-fourmolu-plugin/src/Ide/Plugin/Fourmolu.hs

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import Data.List (intercalate)
2323
import Data.Maybe (catMaybes)
2424
import Data.Text (Text)
2525
import qualified Data.Text as T
26+
import Data.Version (showVersion)
2627
import Development.IDE hiding (pluginHandlers)
2728
import Development.IDE.GHC.Compat as Compat hiding (Cpp, Warning,
2829
hang, vcat)
@@ -38,6 +39,7 @@ import Language.LSP.Protocol.Types
3839
import Language.LSP.Server hiding (defaultConfig)
3940
import Ormolu
4041
import Ormolu.Config
42+
import qualified Paths_fourmolu as Fourmolu
4143
import System.Exit
4244
import System.FilePath
4345
import System.Process.Run (cwd, proc)
@@ -51,7 +53,7 @@ descriptor recorder plId =
5153
, pluginConfigDescriptor = defaultConfigDescriptor{configCustomConfig = mkCustomConfig properties}
5254
}
5355
where
54-
desc = "Provides formatting of Haskell files via fourmolu. Built with fourmolu-" <> VERSION_fourmolu
56+
desc = T.pack $ "Provides formatting of Haskell files via fourmolu. Built with fourmolu-" <> showVersion Fourmolu.version
5557

5658
properties :: Properties '[ 'PropertyKey "external" 'TBoolean, 'PropertyKey "path" 'TString]
5759
properties =
@@ -77,7 +79,7 @@ provider recorder plId ideState token typ contents fp fo = ExceptT $ pluginWithI
7779
handle @IOException (pure . Left . PluginInternalError . T.pack . show) $
7880
runExceptT (cliHandler fourmoluExePath fileOpts)
7981
else do
80-
logWith recorder Debug $ LogCompiledInVersion VERSION_fourmolu
82+
logWith recorder Debug $ LogCompiledInVersion (showVersion Fourmolu.version)
8183
FourmoluConfig{..} <-
8284
liftIO (loadConfigFile fp') >>= \case
8385
ConfigLoaded file opts -> do

0 commit comments

Comments
 (0)