Skip to content

Commit

Permalink
Change flag name from "cli" to "external"
Browse files Browse the repository at this point in the history
  • Loading branch information
georgefst committed Mar 11, 2022
1 parent 129e584 commit 558a3bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions plugins/hls-fourmolu-plugin/src/Ide/Plugin/Fourmolu.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@ descriptor plId =
{ pluginHandlers = mkFormattingHandlers $ provider plId
}

properties :: Properties '[ 'PropertyKey "cli" 'TBoolean]
properties :: Properties '[ 'PropertyKey "external" 'TBoolean]
properties =
emptyProperties
& defineBooleanProperty
#cli
"Call out to a \"fourmolu\" executable, rather than using the bundled library"
#external
"Call out to an external \"fourmolu\" executable, rather than using the bundled library"
False

provider :: PluginId -> FormattingHandler IdeState
provider plId ideState typ contents fp fo = withIndefiniteProgress title Cancellable $ do
fileOpts <-
maybe [] (convertDynFlags . hsc_dflags . hscEnv)
<$> liftIO (runAction "Fourmolu" ideState $ use GhcSession fp)
useCLI <- usePropertyLsp #cli plId properties
useCLI <- usePropertyLsp #external plId properties
if useCLI
then liftIO
. fmap (join . first (mkError . show))
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-fourmolu-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tests =
goldenWithFourmolu :: Bool -> TestName -> FilePath -> FilePath -> (TextDocumentIdentifier -> Session ()) -> TestTree
goldenWithFourmolu cli title path desc = goldenWithHaskellDocFormatter fourmoluPlugin "fourmolu" conf title testDataDir path desc "hs"
where
conf = def{plcConfig = (\(Object obj) -> obj) $ object ["cli" .= cli]}
conf = def{plcConfig = (\(Object obj) -> obj) $ object ["external" .= cli]}

testDataDir :: FilePath
testDataDir = "test" </> "testdata"

0 comments on commit 558a3bc

Please sign in to comment.