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

[Feature Request] Update include directives when header files are renamed

Open William8915 opened this issue 5 years ago • 8 comments

I find it helpful if the plugin can check for header file renames in the project and provide an option to update all #include directives in source files to include the renamed file.

Such a feature is for example available in Visual Assist as described in https://www.wholetomato.com/features/feature-refactoring#rename-file. The other feature described in the link is renaming header/source files in pairs. It would be great to include that feature as well but it is OK not to have it since manually renaming is not that troublesome. However finding all the #include directives and replacing them is more troublesome and should be automated.

William8915 avatar Jan 08 '20 12:01 William8915

This feature request is being closed due to insufficient upvotes. When at least 2 upvotes are received, this issue will be eligible for our backlog.

github-actions[bot] avatar Oct 08 '20 21:10 github-actions[bot]

big +1 for this, this seems like a very normal thing to have.

wisepotato avatar Oct 09 '20 12:10 wisepotato

@Colengms an upvote being the thumbs up emoji? its a bit unclear

wisepotato avatar Oct 21 '20 09:10 wisepotato

Hi @wisepotato Yes, use the thumbs-up (+1) reaction to upvote.

Colengms avatar Oct 21 '20 21:10 Colengms

This should be a standard feature... Should developers change all the included headers themselves after they've renamed a header?

jaques-sam avatar Jan 15 '21 08:01 jaques-sam

yes , please +1 it :)

wisepotato avatar Jan 15 '21 10:01 wisepotato

There is an extension which is doing this (not sure about the success rate), so maybe it can be integrated. There is no license information, so contact to the author is required for a simple "consume": C++ header refactor

Wastus avatar Jan 18 '21 13:01 Wastus

+1

Real-Gecko avatar Jul 21 '22 07:07 Real-Gecko

ပလပ်အင်သည် ပရောဂျက်ရှိ ခေါင်းစီးဖိုင်အမည်ပြောင်းမှုများကို စစ်ဆေးနိုင်ပြီး ဖိုင် #includeအမည်ပြောင်းရန်အတွက် အရင်းအမြစ်ဖိုင်များတွင် လမ်းညွှန်ချက်အားလုံးကို အပ်ဒိတ်လုပ်ရန် ရွေးချယ်ခွင့်တစ်ခု ပေးနိုင်ပါက ပလပ်အင်သည် အထောက်အကူဖြစ်နိုင်သည်ဟု ကျွန်ုပ်မြင်သည်။

ထိုသို့သောအင်္ဂါရပ်သည် ဥပမာအားဖြင့် https://www.wholetomato.com/features/feature-refactoring#rename-file တွင်ဖော်ပြထားသည့်အတိုင်း Visual Assist တွင် ရနိုင်ပါသည် ။ လင့်ခ်တွင်ဖော်ပြထားသည့် အခြားအင်္ဂါရပ်မှာ ခေါင်းစီး/ရင်းမြစ်ဖိုင်များကို အတွဲများဖြင့် အမည်ပြောင်းခြင်းဖြစ်သည်။ ၎င်းအင်္ဂါရပ်ကိုလည်း ထည့်သွင်းခြင်းသည် ကောင်းမွန်သော်လည်း ၎င်းကို ကိုယ်တိုင်အမည်ပြောင်းခြင်းသည် ပြဿနာမဟုတ်သောကြောင့် ၎င်းကို မရရှိနိုင်ပါက OK ပါသည်။ သို့သော် #includeလမ်းညွှန်ချက်အားလုံးကို ရှာဖွေပြီး ၎င်းတို့ကို အစားထိုးခြင်းသည် ပို၍ခက်ခဲပြီး အလိုအလျောက်လုပ်ဆောင်သင့်သည်။

darker16 avatar Sep 30 '23 17:09 darker16