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