live-share
live-share copied to clipboard
"Rename Symbol" doesn't work on C++
Describe what happened:
Right clicking a
and choosing "Rename Symbol" usually allows the user to refactor the variable name in normal off-line sessions.
int a = 0;
a = 1;
But during a live-share session, the client side user cannot use this functionality and nothing happens after entering a new variable name.
What was your system configuration? Product and Version [VSCode]: 1.49.2 OS Version[macOS]: 10.15.7 Live Share Extension Version: v1.0.2902 Target Platform or Language [e.g. Node.js]: Commit: e5e9e69aed6e1984f7499b7af85b3d05f9a6883a Date: 2020-09-24T16:23:52.277Z (5 days ago) Electron: 9.2.1 Chrome: 83.0.4103.122 Node.js: 12.14.1 V8: 8.3.110.13-electron.0 OS: Darwin x64 19.6.0
Steps to Reproduce / Scenario:
- Open an invitation from the host
- Start editing a shared C++ file
- Right click a variable and choose "Rename Symbol"
- Nothing happens
Hey @akira-okumura , this is a supported scenario, so it looks like you uncovered a bug.
@aletsdelarosa , can you take a look? I wasn't able to repro with a TypeScript project, so it might be specific to how the C++ extension handles renames.
The extensions installed are
- Awesome Emacs Keymap 0.22.1
- C/C++ 1.0.1
- Clang-Format 1.9.0
@daytonellwanger Did we ever have a chance to narrow this down to just C++?
@lostintangent I confirmed that it didn't repro with TS, but that was all.
Sorry for my very late reply. I gave up using Live Share for refactoring and I did not retry it after my last post.
Again today, I tried VS Code 1.56.2 (Universal) on mac OS Big Sur 11.3.1, together with ms-vscode.cpptools 1.3.1 and ms-vsliveshare.vsliveshare 1.0.4272. The host (logging in with my GitHub account) and guest (anonymous, on a virtual machine on the host) have almost the same configuration.
Refactoring, i.e., "Rename Symbol" does not work on the guest side, but it works on the host.
int main() {
int a = 0;
a = 2;
return 0;
}
Renaming a
to b
does not work on the guest. Could you test it please?
@akira-okumura I have tried reproducing this issue by joining a session as a guest with the same installed extensions, but I have not encountered any issues to "Rename Symbol". Let me know if this is fixed for you or if I am missing some repro steps.
When trying to rename the variable A
to B
as a guest on Safari (right side), I get "A definition for the selected symbol could not be located" on the host side (left). Please see the screen shot.
I use Live Share 1.0.4650, C/C++ 1.5.1, and VS Code 1.58.2.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically in 2 days.
I'm experiencing a more serious bug! If you do a refactoring of a symbol, it replaces all string occurrences in the current file!