Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
akira-okumura opened this issue Sep 30, 2020 · 10 comments
Open

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

akira-okumura opened this issue Sep 30, 2020 · 10 comments

Comments

@akira-okumura
Copy link

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
Copy link
Collaborator

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
Copy link
Author

The extensions installed are

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

@lostintangent
Copy link
Member

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

@daytonellwanger
Copy link
Collaborator

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

@akira-okumura
Copy link
Author

akira-okumura commented May 21, 2021

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?

@Davsterl Davsterl changed the title "Rename Symbol" doesn't work "Rename Symbol" doesn't work on C++ Jul 18, 2021
@xnkevinnguyen
Copy link

@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
Copy link
Author

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
Copy link

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 github-actions bot added the Stale label Aug 15, 2022
@derekbekoe derekbekoe added this to the Oct-Dec 2022 milestone Nov 8, 2022
@jaques-sam
Copy link

jaques-sam commented Dec 12, 2022

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

@derekbekoe derekbekoe modified the milestones: Oct-Dec 2022, Jan-Mar 2023 (uncommitted) Dec 13, 2022
@derekbekoe derekbekoe removed this from the Jan-Mar 2023 (uncommitted) milestone Mar 29, 2023
@Mujtaba0150
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests