Skip to content

Commit 5579d52

Browse files
committed
Add workspace symbol requests to lsp-test
1 parent b5f6f8e commit 5579d52

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ module Language.LSP.Test (
137137
-- ** SemanticTokens
138138
getSemanticTokens,
139139

140+
-- ** Workspace Symbols
141+
getWorkspaceSymbols,
142+
resolveWorkspaceSymbols,
143+
140144
-- ** Capabilities
141145
getRegisteredCapabilities,
142146
) where
@@ -1036,6 +1040,19 @@ getSemanticTokens doc = do
10361040
rsp <- request SMethod_TextDocumentSemanticTokensFull params
10371041
pure $ getResponseResult rsp
10381042

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

0 commit comments

Comments
 (0)