File tree Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Expand file tree Collapse file tree 2 files changed +23
-2
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ import GHC.Generics (Generic)
3232import Ide.Plugin.Config
3333import Ide.Types (PluginDescriptor (.. ),
3434 PluginId , configHasDiagnostics ,
35+ configInitialGenericConfig ,
3536 defaultConfigDescriptor ,
3637 defaultPluginDescriptor ,
3738 pluginEnabledConfig )
@@ -46,11 +47,17 @@ import Stan.Observation (Observation (..))
4647descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
4748descriptor recorder plId = (defaultPluginDescriptor plId desc)
4849 { pluginRules = rules recorder plId
49- , pluginConfigDescriptor = defaultConfigDescriptor
50+ , pluginConfigDescriptor = defConfigDescriptor
5051 { configHasDiagnostics = True
52+ -- We disable this plugin by default because users have been complaining about
53+ -- the diagnostics, see https://github.com/haskell/haskell-language-server/issues/3916
54+ , configInitialGenericConfig = (configInitialGenericConfig defConfigDescriptor)
55+ { plcGlobalOn = False
56+ }
5157 }
5258 }
5359 where
60+ defConfigDescriptor = defaultConfigDescriptor
5461 desc = " Provides stan diagnostics. Built with stan-" <> VERSION_stan
5562
5663newtype Log = LogShake Shake. Log deriving (Show )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import Data.Text (Text)
1010import qualified Data.Text as T
1111import qualified Data.Text.IO as T
1212import qualified Ide.Plugin.Stan as Stan
13+ import Ide.Types
1314import qualified Language.LSP.Protocol.Lens as L
1415import System.FilePath
1516import Test.Hls
@@ -39,7 +40,20 @@ testDir :: FilePath
3940testDir = " test/testdata"
4041
4142stanPlugin :: PluginTestDescriptor Stan. Log
42- stanPlugin = mkPluginTestDescriptor Stan. descriptor " stan"
43+ stanPlugin = mkPluginTestDescriptor enabledStanDescriptor " stan"
44+ where
45+ -- We have to explicitly enable the plugin as it is disabled by default as
46+ -- per request: https://github.com/haskell/haskell-language-server/issues/3916
47+ --
48+ enabledStanDescriptor recorder plId =
49+ let stanPluginDescriptor = Stan. descriptor recorder plId
50+ in stanPluginDescriptor
51+ { pluginConfigDescriptor = (pluginConfigDescriptor stanPluginDescriptor)
52+ { configInitialGenericConfig = (configInitialGenericConfig (pluginConfigDescriptor stanPluginDescriptor))
53+ { plcGlobalOn = True
54+ }
55+ }
56+ }
4357
4458runStanSession :: FilePath -> Session a -> IO a
4559runStanSession subdir =
You can’t perform that action at this time.
0 commit comments