File tree 2 files changed +23
-2
lines changed
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)
32
32
import Ide.Plugin.Config
33
33
import Ide.Types (PluginDescriptor (.. ),
34
34
PluginId , configHasDiagnostics ,
35
+ configInitialGenericConfig ,
35
36
defaultConfigDescriptor ,
36
37
defaultPluginDescriptor ,
37
38
pluginEnabledConfig )
@@ -46,11 +47,17 @@ 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
+ -- 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
+ }
51
57
}
52
58
}
53
59
where
60
+ defConfigDescriptor = defaultConfigDescriptor
54
61
desc = " Provides stan diagnostics. Built with stan-" <> VERSION_stan
55
62
56
63
newtype Log = LogShake Shake. Log deriving (Show )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import Data.Text (Text)
10
10
import qualified Data.Text as T
11
11
import qualified Data.Text.IO as T
12
12
import qualified Ide.Plugin.Stan as Stan
13
+ import Ide.Types
13
14
import qualified Language.LSP.Protocol.Lens as L
14
15
import System.FilePath
15
16
import Test.Hls
@@ -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