microsoft / live-share

Real-time collaborative development from the comfort of your favorite tools
http://aka.ms/vsls
Creative Commons Attribution 4.0 International
2.27k stars 247 forks source link

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

Open akira-okumura opened 3 years ago

akira-okumura commented 3 years ago

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
daytonellwanger commented 3 years ago

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.

akira-okumura commented 3 years ago

The extensions installed are

lostintangent commented 3 years ago

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

daytonellwanger commented 3 years ago

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

akira-okumura commented 3 years ago

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?

xnkevinnguyen commented 3 years ago

@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

akira-okumura commented 3 years ago

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.

github-actions[bot] commented 2 years ago

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

jaques-sam commented 1 year ago

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

Mujtaba0150 commented 3 weeks ago

The "Rename Symbol" feature is working perfectly fine on the latest version of VS Code on Windows