vscode-cpptools icon indicating copy to clipboard operation
vscode-cpptools copied to clipboard

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

Open mythemeria opened this issue 1 year ago • 4 comments
trafficstars

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.

mythemeria avatar Oct 16 '24 13:10 mythemeria

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.

bobbrow avatar Oct 16 '24 16:10 bobbrow

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.

Colengms avatar Oct 16 '24 18:10 Colengms

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.

mythemeria avatar Oct 17 '24 01:10 mythemeria

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.

Colengms avatar Oct 17 '24 02:10 Colengms

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 avatar Feb 10 '25 13:02 ericchase

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 avatar Feb 10 '25 13:02 ericchase

Sorry, forgot to show the setting in screenshot.

Image

ericchase avatar Feb 10 '25 13:02 ericchase