@@ -107,28 +107,28 @@ pluginsToVSCodeExtensionSchema IdePlugins {..} = A.object $ mconcat $ singlePlug
107
107
(PluginId pId) = pluginId
108
108
genericSchema =
109
109
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))
112
112
in case x of
113
113
-- If the plugin has only one capability, we produce globalOn instead of the specific one;
114
114
-- otherwise we don't produce globalOn at all
115
- [_] -> [toKey' " globalOn" A. .= schemaEntry " plugin" ]
115
+ [_] -> [toKey' " globalOn" A. .= schemaEntry " plugin" (plcGlobalOn configInitialGenericConfig) ]
116
116
_ -> x
117
117
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 =
128
128
A. object
129
129
[ " scope" A. .= A. String " resource" ,
130
130
" type" A. .= A. String " boolean" ,
131
- " default" A. .= True ,
131
+ " default" A. .= A. Bool defaultVal ,
132
132
" description" A. .= A. String (" Enables " <> pId <> " " <> desc)
133
133
]
134
134
withIdPrefix x = " haskell.plugin." <> pId <> " ." <> x
0 commit comments