Skip to content

Commit 4daf7d3

Browse files
committed
Add lsp cursorInfo function
1 parent 6964a6a commit 4daf7d3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lsp/main.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -788,6 +788,17 @@ export async function getClojuredocs(symName: string, symNs: string): Promise<an
788788
}
789789
}
790790

791+
export async function getCursorInfo(
792+
textDocument: vscode.TextDocument,
793+
position: vscode.Position
794+
): Promise<any> {
795+
const client: LanguageClient = getStateValue(LSP_CLIENT_KEY);
796+
return client.sendRequest('clojure/cursorInfo/raw', {
797+
textDocument: { uri: textDocument.uri.toString() },
798+
position: { line: position.line, character: position.character },
799+
});
800+
}
801+
791802
// TODO: This feels a bit brute, what are other ways to wait for the client to initialize?
792803
export function getClient(timeout: number): Promise<LanguageClient> {
793804
const start = Date.now();

0 commit comments

Comments
 (0)