[llvm-bugs] [Bug 41940] New: textDocument/rename does not work for a more complex file
via llvm-bugs
llvm-bugs at lists.llvm.org
Mon May 20 02:30:30 PDT 2019
https://bugs.llvm.org/show_bug.cgi?id=41940
Bug ID: 41940
Summary: textDocument/rename does not work for a more complex
file
Product: clang-tools-extra
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: enhancement
Priority: P
Component: clangd
Assignee: unassignedclangbugs at nondot.org
Reporter: mliska at suse.cz
CC: llvm-bugs at lists.llvm.org
Using trunk at 361113, I can't rename 'index' variable in following code snippet:
void
sem_item::add_reference (sem_item *target)
{
refs.safe_push (target);
unsigned index = refs.length ();
target->usages.safe_push (new sem_usage_pair(this, index));
bitmap_set_bit (target->usage_index_bitmap, index);
refs_set.add (target->node);
}
I'm using vim-lsp and for textDocument/references I get:
Mon 20 May 2019 11:23:11 AM CEST:["--->", 3, "clangd", {"method":
"textDocument/references", "on_notification": "---funcref---", "params":
{"context": {"includeDeclaration": false}, "textDocument": {"uri":
"file:///home/marxin/Programming/gcc/gcc/ipa-icf.c"}, "position": {"character":
13, "line": 159}}}]
Mon 20 May 2019 11:23:11 AM CEST:["<---(stderr)", 3, "clangd",
["I[11:23:11.382] <-- textDocument/references(3)", ""]]
Mon 20 May 2019 11:23:11 AM CEST:["<---(stderr)", 3, "clangd",
["I[11:23:11.391] --> reply:textDocument/references(3) 8 ms", ""]]
Mon 20 May 2019 11:23:11 AM CEST:["<---", 3, "clangd", {"response": {"id": 3,
"jsonrpc": "2.0", "result": [{"uri":
"file:///home/marxin/Programming/gcc/gcc/ipa-icf.c", "range": {"end":
{"character": 16, "line": 159}, "start": {"character": 11, "line": 159}}},
{"uri": "file:///home/marxin/Programming/gcc/gcc/ipa-icf.c", "range": {"end":
{"character": 58, "line": 160}, "start": {"character": 53, "line": 160}}},
{"uri": "file:///home/marxin/Programming/gcc/gcc/ipa-icf.c", "range": {"end":
{"character": 51, "line": 161}, "start": {"character": 46, "line": 161}}}]},
"request": {"id": 3, "jsonrpc": "2.0", "method": "textDocument/references",
"params": {"context": {"includeDeclaration": false}, "textDocument": {"uri":
"file:///home/marxin/Programming/gcc/gcc/ipa-icf.c"}, "position": {"character":
13, "line": 159}}}}]
That's fine. However rename does not work:
Mon 20 May 2019 11:23:16 AM CEST:["--->", 3, "clangd", {"method":
"textDocument/rename", "on_notification": "---funcref---", "params":
{"newName": "index222", "textDocument": {"uri":
"file:///home/marxin/Programming/gcc/gcc/ipa-icf.c"}, "position": {"character":
13, "line": 159}}}]
Mon 20 May 2019 11:23:16 AM CEST:["<---(stderr)", 3, "clangd",
["I[11:23:16.956] <-- textDocument/rename(4)", ""]]
Mon 20 May 2019 11:23:17 AM CEST:["<---(stderr)", 3, "clangd",
["I[11:23:17.186] --> reply:textDocument/rename(4) 230 ms", ""]]
Mon 20 May 2019 11:23:17 AM CEST:["<---", 3, "clangd", {"response": {"id": 4,
"jsonrpc": "2.0", "result": {"changes":
{"file:///home/marxin/Programming/gcc/gcc/ipa-icf.c": []}}}, "request": {"id":
4, "jsonrpc": "2.0", "method": "textDocument/rename", "params": {"newName":
"index222", "textDocument": {"uri":
"file:///home/marxin/Programming/gcc/gcc/ipa-icf.c"}, "position": {"character":
13, "line": 159}}}}]
Changes response is empty.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190520/20b2c03e/attachment.html>
More information about the llvm-bugs
mailing list