File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ import Ide.Types (PluginDescriptor (..),
3434 PluginId , configHasDiagnostics ,
3535 defaultConfigDescriptor ,
3636 defaultPluginDescriptor ,
37- pluginEnabledConfig )
37+ pluginEnabledConfig ,
38+ configInitialGenericConfig )
3839import qualified Language.LSP.Protocol.Types as LSP
3940import Stan.Analysis (Analysis (.. ), runAnalysis )
4041import Stan.Category (Category (.. ))
@@ -46,11 +47,15 @@ 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+ , configInitialGenericConfig = (configInitialGenericConfig defConfigDescriptor)
53+ { plcGlobalOn = False
54+ }
5155 }
5256 }
5357 where
58+ defConfigDescriptor = defaultConfigDescriptor
5459 desc = " Provides stan diagnostics. Built with stan-" <> VERSION_stan
5560
5661newtype Log = LogShake Shake. Log deriving (Show )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import qualified Ide.Plugin.Stan as Stan
1313import qualified Language.LSP.Protocol.Lens as L
1414import System.FilePath
1515import Test.Hls
16+ import Ide.Types
1617
1718main :: IO ()
1819main = defaultTestRunner tests
@@ -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