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