File tree 2 files changed +22
-3
lines changed 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 (..),
34
34
PluginId , configHasDiagnostics ,
35
35
defaultConfigDescriptor ,
36
36
defaultPluginDescriptor ,
37
- pluginEnabledConfig )
37
+ pluginEnabledConfig ,
38
+ configInitialGenericConfig )
38
39
import qualified Language.LSP.Protocol.Types as LSP
39
40
import Stan.Analysis (Analysis (.. ), runAnalysis )
40
41
import Stan.Category (Category (.. ))
@@ -46,11 +47,15 @@ import Stan.Observation (Observation (..))
46
47
descriptor :: Recorder (WithPriority Log ) -> PluginId -> PluginDescriptor IdeState
47
48
descriptor recorder plId = (defaultPluginDescriptor plId desc)
48
49
{ pluginRules = rules recorder plId
49
- , pluginConfigDescriptor = defaultConfigDescriptor
50
+ , pluginConfigDescriptor = defConfigDescriptor
50
51
{ configHasDiagnostics = True
52
+ , configInitialGenericConfig = (configInitialGenericConfig defConfigDescriptor)
53
+ { plcGlobalOn = False
54
+ }
51
55
}
52
56
}
53
57
where
58
+ defConfigDescriptor = defaultConfigDescriptor
54
59
desc = " Provides stan diagnostics. Built with stan-" <> VERSION_stan
55
60
56
61
newtype 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
13
13
import qualified Language.LSP.Protocol.Lens as L
14
14
import System.FilePath
15
15
import Test.Hls
16
+ import Ide.Types
16
17
17
18
main :: IO ()
18
19
main = defaultTestRunner tests
@@ -39,7 +40,20 @@ testDir :: FilePath
39
40
testDir = " test/testdata"
40
41
41
42
stanPlugin :: 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
+ }
43
57
44
58
runStanSession :: FilePath -> Session a -> IO a
45
59
runStanSession subdir =
You can’t perform that action at this time.
0 commit comments