Skip to content

Commit

Permalink
Add lsp cursorInfo function
Browse files Browse the repository at this point in the history
  • Loading branch information
PEZ committed Dec 20, 2022
1 parent 6964a6a commit 4daf7d3
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lsp/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -788,6 +788,17 @@ export async function getClojuredocs(symName: string, symNs: string): Promise<an
}
}

export async function getCursorInfo(
textDocument: vscode.TextDocument,
position: vscode.Position
): Promise<any> {
const client: LanguageClient = getStateValue(LSP_CLIENT_KEY);
return client.sendRequest('clojure/cursorInfo/raw', {
textDocument: { uri: textDocument.uri.toString() },
position: { line: position.line, character: position.character },
});
}

// TODO: This feels a bit brute, what are other ways to wait for the client to initialize?
export function getClient(timeout: number): Promise<LanguageClient> {
const start = Date.now();
Expand Down

0 comments on commit 4daf7d3

Please sign in to comment.