From e1e0a265e931637f452ac05bb7d912e07bcee574 Mon Sep 17 00:00:00 2001 From: zinc Date: Thu, 15 Oct 2026 10:11:56 +0330 Subject: lsp: borrow errors ranged on the use, with related information for where the owner ended and was declared; vscode client passes relatedInformation through --- src/compiler/analyzer.zc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/compiler/analyzer.zc') diff --git a/src/compiler/analyzer.zc b/src/compiler/analyzer.zc index 103f732..ff6a6c1 100644 --- a/src/compiler/analyzer.zc +++ b/src/compiler/analyzer.zc @@ -1002,9 +1002,10 @@ int lend_drop(int dep, int from) { // or untracked memory, 7 freed by reassigning it, 8 pushed into end_whom. int end_why; char* end_whom; int end_owner(int i) { - int j = lbase; word info = talloc(5); + int j = lbase; word info = talloc(6); lend_check(i); info[0] = lname[i]; info[1] = lpos[i]; info[2] = tpack(); info[3] = end_why; info[4] = end_whom; + info[5] = lreadpos[i]; if (!info[5]) info[5] = info[2]; // the owner's own token where it ended, for the editor end_why = 0; end_whom = 0; local_ended[i] = info[2]; local_end_info[i] = info; lstate[i] = S_DEAD; while (j < nloc) { -- cgit v1.2.3