@@ -107,28 +107,28 @@ pluginsToVSCodeExtensionSchema IdePlugins {..} = A.object $ mconcat $ singlePlug
107107 (PluginId pId) = pluginId
108108 genericSchema =
109109 let x =
110- [toKey' " diagnosticsOn" A. .= schemaEntry " diagnostics" | configHasDiagnostics]
111- <> nubOrd (mconcat (handlersToGenericSchema <$> handlers))
110+ [toKey' " diagnosticsOn" A. .= schemaEntry " diagnostics" True | configHasDiagnostics]
111+ <> nubOrd (mconcat (handlersToGenericSchema configInitialGenericConfig <$> handlers))
112112 in case x of
113113 -- If the plugin has only one capability, we produce globalOn instead of the specific one;
114114 -- otherwise we don't produce globalOn at all
115- [_] -> [toKey' " globalOn" A. .= schemaEntry " plugin" ]
115+ [_] -> [toKey' " globalOn" A. .= schemaEntry " plugin" (plcGlobalOn configInitialGenericConfig) ]
116116 _ -> x
117117 dedicatedSchema = customConfigToDedicatedSchema configCustomConfig
118- handlersToGenericSchema (IdeMethod m DSum. :=> _) = case m of
119- SMethod_TextDocumentCodeAction -> [toKey' " codeActionsOn" A. .= schemaEntry " code actions" ]
120- SMethod_TextDocumentCodeLens -> [toKey' " codeLensOn" A. .= schemaEntry " code lenses" ]
121- SMethod_TextDocumentRename -> [toKey' " renameOn" A. .= schemaEntry " rename" ]
122- SMethod_TextDocumentHover -> [toKey' " hoverOn" A. .= schemaEntry " hover" ]
123- SMethod_TextDocumentDocumentSymbol -> [toKey' " symbolsOn" A. .= schemaEntry " symbols" ]
124- SMethod_TextDocumentCompletion -> [toKey' " completionOn" A. .= schemaEntry " completions" ]
125- SMethod_TextDocumentPrepareCallHierarchy -> [toKey' " callHierarchyOn" A. .= schemaEntry " call hierarchy" ]
126- _ -> []
127- schemaEntry desc =
118+ handlersToGenericSchema PluginConfig { .. } (IdeMethod m DSum. :=> _) = case m of
119+ SMethod_TextDocumentCodeAction -> [toKey' " codeActionsOn" A. .= schemaEntry " code actions" plcCodeActionsOn ]
120+ SMethod_TextDocumentCodeLens -> [toKey' " codeLensOn" A. .= schemaEntry " code lenses" plcCodeLensOn ]
121+ SMethod_TextDocumentRename -> [toKey' " renameOn" A. .= schemaEntry " rename" plcRenameOn ]
122+ SMethod_TextDocumentHover -> [toKey' " hoverOn" A. .= schemaEntry " hover" plcHoverOn ]
123+ SMethod_TextDocumentDocumentSymbol -> [toKey' " symbolsOn" A. .= schemaEntry " symbols" plcSymbolsOn ]
124+ SMethod_TextDocumentCompletion -> [toKey' " completionOn" A. .= schemaEntry " completions" plcCompletionOn ]
125+ SMethod_TextDocumentPrepareCallHierarchy -> [toKey' " callHierarchyOn" A. .= schemaEntry " call hierarchy" plcCallHierarchyOn ]
126+ _ -> []
127+ schemaEntry desc defaultVal =
128128 A. object
129129 [ " scope" A. .= A. String " resource" ,
130130 " type" A. .= A. String " boolean" ,
131- " default" A. .= True ,
131+ " default" A. .= A. Bool defaultVal ,
132132 " description" A. .= A. String (" Enables " <> pId <> " " <> desc)
133133 ]
134134 withIdPrefix x = " haskell.plugin." <> pId <> " ." <> x
0 commit comments