Add log messages

This commit is contained in:
Laurențiu Nicola 2022-02-09 19:13:17 +02:00
parent 0f396d670b
commit 2ae8248cee
2 changed files with 5 additions and 3 deletions

View file

@ -22,8 +22,10 @@ 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)
const hints = await sendRequestWithRetry(ctx.client, ra.inlayHints, request, token).catch(_ => null);
console.log(hints);
if (hints == null) {
return [];
} else {
@ -43,7 +45,7 @@ export function activateInlayHints(ctx: Ctx) {
this.hintsProvider = null;
this.updateHintsEventEmitter.dispose();
},
}
};
ctx.pushCleanup(maybeUpdater);

View file

@ -102,7 +102,7 @@ export const relatedTests = new lc.RequestType<lc.TextDocumentPositionParams, Te
export interface InlayHintsParams {
textDocument: lc.TextDocumentIdentifier;
range: lc.Range,
range: lc.Range;
}
export const inlayHints = new lc.RequestType<InlayHintsParams, InlayHint[], void>("rust-analyzer/inlayHints");