live-share icon indicating copy to clipboard operation
live-share copied to clipboard

"Rename Symbol" doesn't work on C++

Open akira-okumura opened this issue 4 years ago • 10 comments

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:

  1. Open an invitation from the host
  2. Start editing a shared C++ file
  3. Right click a variable and choose "Rename Symbol"
  4. Nothing happens

akira-okumura avatar Sep 30 '20 03:09 akira-okumura

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.

daytonellwanger avatar Oct 02 '20 15:10 daytonellwanger

The extensions installed are

  • Awesome Emacs Keymap 0.22.1
  • C/C++ 1.0.1
  • Clang-Format 1.9.0

akira-okumura avatar Oct 21 '20 05:10 akira-okumura

@daytonellwanger Did we ever have a chance to narrow this down to just C++?

lostintangent avatar Jan 05 '21 07:01 lostintangent

@lostintangent I confirmed that it didn't repro with TS, but that was all.

daytonellwanger avatar Jan 05 '21 17:01 daytonellwanger

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 avatar May 21 '21 04:05 akira-okumura

@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.

renamecpp

xnkevinnguyen avatar Jul 30 '21 16:07 xnkevinnguyen

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. image

I use Live Share 1.0.4650, C/C++ 1.5.1, and VS Code 1.58.2.

akira-okumura avatar Aug 04 '21 07:08 akira-okumura

This issue has been automatically marked as stale because it has not had recent activity. It will be closed automatically in 2 days.

github-actions[bot] avatar Aug 15 '22 10:08 github-actions[bot]

I'm experiencing a more serious bug! If you do a refactoring of a symbol, it replaces all string occurrences in the current file!

jaques-sam avatar Dec 12 '22 13:12 jaques-sam