Skip to content

I cannot stress enough how much I do not want this to happen #12843

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

Open
mythemeria opened this issue Oct 16, 2024 · 7 comments
Open

I cannot stress enough how much I do not want this to happen #12843

mythemeria opened this issue Oct 16, 2024 · 7 comments
Labels

Comments

@mythemeria
Copy link

Image
This is awful. I was previously able to press F2 and rename a symbol. Today I try to do that and you have done something with your extension that makes it take 20x as long. What's more, I can't find the setting to disable this AWFUL behaviour anywhere. I mostly use this feature to deobsfucate code for. You've completely broken my workflow. Thanks.

@bobbrow
Copy link
Member

bobbrow commented Oct 16, 2024

Hi there, @mythemeria. We didn't notice any major performance issues in our testing, so it sounds like there is a test case we need to add to avoid this happening again. Do you have an example you can share with us? We'd be happy to investigate if you can give us a little more information to work with.

And which behavior are you asking to disable? The refactor preview? The refactor preview is a VS Code feature and has existed for a long time and only appears when we don't have 100% confidence in all the rename candidates. The 20x slow down you're reporting hopefully shouldn't have anything to do with that.

@Colengms
Copy link
Contributor

Hi @mythemeria . Given the 116 detected problems, and that some of the identifiers found by Rename were not checked by default (not confirmed to be semantically related), it's possible the issue you are seeing is related to configuring IntelliSense, not with the Rename operation itself. Can you share more about how you've configured IntelliSense for your workspace? Ideally, IntelliSense should be configured with exactly the same compiler arguments used to compile files.

@mythemeria
Copy link
Author

mythemeria commented Oct 17, 2024

Hi, in the above screenshot, I am not writing code, I am using VS code to make it easier to understand decompiled output from IDA. This involves a lot of renaming variables but the code typically does not actually run. The slow down I mention is the fact I need to go through extra steps with this refactor window to rename variables and make it not mess with other files when I am just using a throwaway workspace for parsing decompiler output. I still have not figured out how to make this go away, and ended up just renaming the file to .py so it would work.

Sorry, my initial post was hastily written as I was extremely frustrated trying to fix this last night.

@Colengms
Copy link
Contributor

Hi @mythemeria . Have you tried setting editor.rename.enablePreview to false?

The C/C++ extension provides symbol locations (both semantic and syntactic/lexical) to VS Code, which it uses to populate the rename preview UI. Semantic matches are considered a proper match while other matches to likely not be the same variable/class/etc. you're trying to rename.

The C/C++ extension uses a compiler front-end internally to provide language service features (IntelliSense) based on a semantic interpretation of the code. Those features assume configuration has been provided that matches how the source code would be successfully built. It's possible you might be able to configure IntelliSense sufficiently for it to better interpret your decompiled code and provide better semantic matches.

You might consider opening an issue in the VS Code repo asking for improvements to the rename/refactor preview UI.

@ericchase
Copy link

Have you tried setting editor.rename.enablePreview to false?

Image

Image

Thought I'd answer the question. This setting does not affect the Preview panel as of latest VSCode and C/C++ Extension.

@ericchase
Copy link

As I am familiar with instant doubts, here is my preemptive Windows Sandbox demonstration with a fresh installation of VSCode:

Image

I'm sure there are reasons™ as to why the Refactor Preview panel opens even for such a simple case like this. Regardless, I too would like a working setting that tells the C/C++ extension to just do the renaming without asking me for confirmation.

@ericchase
Copy link

Sorry, forgot to show the setting in screenshot.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

4 participants