Skip to content

Commit b0bc553

Browse files
authored
Add workspace symbol requests to lsp-test (#602)
1 parent 7fb0b94 commit b0bc553

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

lsp-test/src/Language/LSP/Test.hs

+17
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ module Language.LSP.Test (
138138
-- ** SemanticTokens
139139
getSemanticTokens,
140140

141+
-- ** Workspace Symbols
142+
getWorkspaceSymbols,
143+
resolveWorkspaceSymbols,
144+
141145
-- ** Capabilities
142146
getRegisteredCapabilities,
143147
) where
@@ -1037,6 +1041,19 @@ getSemanticTokens doc = do
10371041
rsp <- request SMethod_TextDocumentSemanticTokensFull params
10381042
pure $ getResponseResult rsp
10391043

1044+
{- | Query the workspace and filter by the given 'T.Text'.
1045+
If empty, this queries the entire workspace.
1046+
-}
1047+
getWorkspaceSymbols :: T.Text -> Session ([SymbolInformation] |? ([WorkspaceSymbol] |? Null))
1048+
getWorkspaceSymbols query = do
1049+
rsp <- request SMethod_WorkspaceSymbol (WorkspaceSymbolParams Nothing Nothing query)
1050+
pure $ getResponseResult rsp
1051+
1052+
resolveWorkspaceSymbols :: WorkspaceSymbol -> Session WorkspaceSymbol
1053+
resolveWorkspaceSymbols item = do
1054+
rsp <- request SMethod_WorkspaceSymbolResolve item
1055+
pure $ getResponseResult rsp
1056+
10401057
{- | Returns a list of capabilities that the server has requested to /dynamically/
10411058
register during the 'Session'.
10421059

0 commit comments

Comments
 (0)