Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@ jobs:
${{ runner.os }}-

- name: Build
run: cabal build
run: cabal build all
- name: Test
run: cabal test
- name: Func test
run: cabal test func-test
- name: Test lsp-test
run: cabal test lsp-test
run: cabal test all
8 changes: 8 additions & 0 deletions example/Reactor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,14 @@ handle = mconcat
range = J.Range pos pos
responder (Right $ Just rsp)

, requestHandler J.STextDocumentDocumentSymbol $ \req responder -> do
liftIO $ debugM "reactor.handle" "Processing a textDocument/documentSymbol request"
let J.DocumentSymbolParams _ _ doc = req ^. J.params
loc = J.Location (doc ^. J.uri) (J.Range (J.Position 0 0) (J.Position 0 0))
sym = J.SymbolInformation "lsp-hello" J.SkFunction Nothing loc Nothing
rsp = J.InR (J.List [sym])
responder (Right rsp)

, requestHandler J.STextDocumentCodeAction $ \req responder -> do
liftIO $ debugM "reactor.handle" $ "Processing a textDocument/codeAction request"
let params = req ^. J.params
Expand Down
5 changes: 3 additions & 2 deletions lsp-test/example/Test.hs
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{-# LANGUAGE OverloadedStrings #-}
import Control.Applicative.Combinators
import Control.Monad.IO.Class
import Language.LSP.Test
import Language.LSP.Types

main = runSession "haskell-language-server" fullCaps "../test/data/" $ do
main = runSession "lsp-demo-reactor-server" fullCaps "../test/data/" $ do
doc <- openDoc "Rename.hs" "haskell"

-- Use your favourite favourite combinators.
skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
skipManyTill loggingNotification (count 1 publishDiagnosticsNotification)

-- Send requests and notifications and receive responses
rsp <- request STextDocumentDocumentSymbol $
Expand Down
1 change: 1 addition & 0 deletions lsp-test/example/example.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ test-suite tests
build-depends: base
, lsp-test
, parser-combinators
build-tool-depends: lsp:lsp-demo-reactor-server