T O P I C R E V I E W |
jbb |
Posted - Dec 11 2015 : 10:07:16 AM Hello,
I'm using VA version 10.9.2083.0 built 2015.11.18 on VS2015
I noticed that in C#, "Format after paste" option sometimes converts tabulations into spaces.
Consider this code (with only tabulations): protected override void Initialize() { base.Initialize(); }
If I copy the first line, and paste it at the beginning of the method like this: protected override void Initialize() { protected override void Initialize() base.Initialize(); }
Then the tabulations copied are changed into spaces (see attached image)
I can only reproduce this case when the option is enabled.
Thanks. |
5 L A T E S T R E P L I E S (Newest First) |
feline |
Posted - Dec 14 2015 : 9:33:18 PM Sorry I was not more help, it seems an odd bug to have slipped past Microsoft. Personally I also prefer tab indented files, but it is an issue where people have strong feelings. Regardless, if the setting is there, I expect it to work. |
jbb |
Posted - Dec 14 2015 : 7:39:51 PM As usual, using Ctrl-Z cancels the formatting, so here the spaces are replaced by tabulations. I already tried that ;-)
I can also reproduce the case following the steps you provided. Thanks for the suggestion, I will report this bug to Microsoft.
Thank you. |
feline |
Posted - Dec 14 2015 : 6:26:39 PM The good news is that I am seeing the same problem. The bad news is that I am seeing this problem even when VA has never been installed. So what ever is causing this, its not us.
I have made sure the code block is indented with tabs, the entire file has been indented only with tabs, and in the IDE C# options, it is set to keep tabs. Yet when I copy and paste the line, I end up with indented with spaces.
Can you try a quick test for me please, after the paste, use Ctrl-Z, do a single undo. What happens? For me, the spaces are replaced with tabs.
Turning off:
IDE tools menu -> Options -> Text Editor -> C# -> Formatting -> Automatically format on paste
helps a bit, but if I then trigger:
IDE Edit menu -> Advanced -> Format Selection
the tabs are replaced with spaces. Apparently VS2015 believes C# must use spaces, regardless of your settings.
You might want to try reporting this to Microsoft, and see what they say:
https://connect.microsoft.com/VisualStudio/ |
jbb |
Posted - Dec 14 2015 : 08:07:48 AM This setting is already set for all languages.
The format after paste works usually as expected, but not in that case. |
accord |
Posted - Dec 11 2015 : 5:24:12 PM Sorry, the attach image feature doesn't seem to work at the moment.
Can you please try setting the below option to see if it helps? Tools -> Options... -> Text Editor -> C# -> Tabs -> Keep tabs
(Visual Assist uses Visual Studio's format feature to format the block after paste.) |
|
|