@@ -23,6 +23,7 @@ import Data.List (intercalate)
2323import Data.Maybe (catMaybes )
2424import Data.Text (Text )
2525import qualified Data.Text as T
26+ import Data.Version (showVersion )
2627import Development.IDE hiding (pluginHandlers )
2728import Development.IDE.GHC.Compat as Compat hiding (Cpp , Warning ,
2829 hang , vcat )
@@ -38,6 +39,7 @@ import Language.LSP.Protocol.Types
3839import Language.LSP.Server hiding (defaultConfig )
3940import Ormolu
4041import Ormolu.Config
42+ import qualified Paths_fourmolu as Fourmolu
4143import System.Exit
4244import System.FilePath
4345import 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
5658properties :: Properties '[ 'PropertyKey " external" 'TBoolean, 'PropertyKey " path" 'TString]
5759properties =
@@ -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