Skip to content

Commit

Permalink
Add workspace symbol requests to lsp-test
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Jan 22, 2025
1 parent b5f6f8e commit 93ccaec
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lsp-test/src/Language/LSP/Test.hs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ module Language.LSP.Test (
-- ** Completions
getCompletions,
getAndResolveCompletions,
resolveCompletion,

-- ** References
getReferences,
Expand Down Expand Up @@ -137,6 +138,10 @@ module Language.LSP.Test (
-- ** SemanticTokens
getSemanticTokens,

-- ** Workspace Symbols
getWorkspaceSymbols,
resolveWorkspaceSymbols,

-- ** Capabilities
getRegisteredCapabilities,
) where
Expand Down Expand Up @@ -1036,6 +1041,18 @@ getSemanticTokens doc = do
rsp <- request SMethod_TextDocumentSemanticTokensFull params
pure $ getResponseResult rsp

-- | Query the workspace and filter by the given 'T.Text'.
-- If empty, this queries the entire workspace.
getWorkspaceSymbols :: T.Text -> Session ([SymbolInformation] |? ([WorkspaceSymbol] |? Null))
getWorkspaceSymbols query = do
rsp <- request SMethod_WorkspaceSymbol (WorkspaceSymbolParams Nothing Nothing query)
pure $ getResponseResult rsp

resolveWorkspaceSymbols :: WorkspaceSymbol -> Session WorkspaceSymbol
resolveWorkspaceSymbols item = do
rsp <- request SMethod_WorkspaceSymbolResolve item
pure $ getResponseResult rsp

{- | Returns a list of capabilities that the server has requested to /dynamically/
register during the 'Session'.
Expand Down

0 comments on commit 93ccaec

Please sign in to comment.