mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 12:24:29 +00:00
Fixes
This commit is contained in:
parent
5a49dbd2e0
commit
0b69717ab6
3 changed files with 5 additions and 5 deletions
|
|
@ -22,13 +22,14 @@ export function activateInlayHints(ctx: Ctx) {
|
|||
this.hintsProvider = vscode.languages.registerInlayHintsProvider({ scheme: 'file', language: 'rust' }, new class implements vscode.InlayHintsProvider {
|
||||
onDidChangeInlayHints = event;
|
||||
async provideInlayHints(document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken): Promise<vscode.InlayHint[]> {
|
||||
console.log(document.uri.toString());
|
||||
const request = { textDocument: { uri: document.uri.toString() }, range: { start: range.start, end: range.end } };
|
||||
const hints = await sendRequestWithRetry(ctx.client, ra.inlayHints, request, token).catch(_ => null);
|
||||
console.log(hints);
|
||||
if (hints == null) {
|
||||
return [];
|
||||
} else {
|
||||
for (let hint of hints) {
|
||||
hint.position = new vscode.Position(hint.position.line, hint.position.character);
|
||||
}
|
||||
return hints;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue