<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - textDocument/rename does not work for a more complex file"
href="https://bugs.llvm.org/show_bug.cgi?id=41940">41940</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>textDocument/rename does not work for a more complex file
</td>
</tr>
<tr>
<th>Product</th>
<td>clang-tools-extra
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>clangd
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>mliska@suse.cz
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Using trunk@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.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>