on master help sign in
Signal code actions in initialize response (#150)
commit726af7fb3ff2568dfd9689ad6c83a131cf482a4f authorJacek Generowicz <jacg@my-post-office.net> dateFri 4 Oct 2019, 08:57 (7 years ago) parentfdf5afa
2 files changed+5−4
src/Development/IDE/LSP/LanguageServer.hs+4−3 test/exe/Main.hs+1−1
src/Development/IDE/LSP/LanguageServer.hs+4−3
@@ -180,8 +180,9 @@ data Message
180180
181181
182182modifyOptions :: LSP.Options -> LSP.Options
183−modifyOptions x = x{LSP.textDocumentSync = Just $ tweak orig}
183+modifyOptions x = x{ LSP.textDocumentSync = Just $ tweakTDS origTDS
184+ , LSP.codeActionProvider = Just $ CodeActionOptionsStatic True }
184185 where
185− tweak x = x{_openClose=Just True, _change=Just TdSyncIncremental, _save=Just $ SaveOptions Nothing}
186− orig = fromMaybe tdsDefault $ LSP.textDocumentSync x
186+ tweakTDS tds = tds{_openClose=Just True, _change=Just TdSyncIncremental, _save=Just $ SaveOptions Nothing}
187+ origTDS = fromMaybe tdsDefault $ LSP.textDocumentSync x
187188 tdsDefault = TextDocumentSyncOptions Nothing Nothing Nothing Nothing Nothing
test/exe/Main.hs+1−1
@@ -58,7 +58,7 @@ initializeResponseTests = withResource acquire release tests where
5858 , chk "NO doc highlight" _documentHighlightProvider Nothing
5959 , chk "NO doc symbol" _documentSymbolProvider Nothing
6060 , chk "NO workspace symbol" _workspaceSymbolProvider Nothing
61− , chk "NO code action" _codeActionProvider Nothing -- available but not declared !
61+ , chk " code action" _codeActionProvider $ Just $ CodeActionOptionsStatic True
6262 , chk "NO code lens" _codeLensProvider Nothing
6363 , chk "NO doc formatting" _documentFormattingProvider Nothing
6464 , chk "NO doc range formatting"