Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Technical Support
 Shift+Alt+R Rename getting confused
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

foxmuldr
Tomato Guru

USA
402 Posts

Posted - Oct 31 2023 :  11:28:11 AM  Show Profile  Reply with Quote
I have some code in a fairly small project (2,000 lines) with a structure named SCommand, and an instance named cmd, and SCommand has a member named cmd, and VAX is not able to differentiate between the two for rename refactoring within the function that has SCommand cmd; defined.

I tried to create a small example to show the bug but in the small example it works.

Has anyone else found an issue like this? I think I may have even reported it before, but cannot find it. I'm also still in [VA_X64.dll file version 10.9.2476.0 built 2023.01.19]. I checked the change log and I didn't see an issue or a fix for it.

--
Rick C. Hodgin

feline
Whole Tomato Software

United Kingdom
18915 Posts

Posted - Oct 31 2023 :  12:13:06 PM  Show Profile  Reply with Quote
Do you use many macros? Complex types?

The fact that this cannot be easily reproduced is odd, and suggests that there is something inside the main project that is confusing our parser.

Would it be possible to get a copy of the solution that shows the problem, purely for testing purposes? I could then try to turn it into a small sample that shows the bug. I appreciate this is often not possible, but it's worth asking on the off chance.

zen is the art of being at one with the two'ness
Go to Top of Page

foxmuldr
Tomato Guru

USA
402 Posts

Posted - Nov 07 2023 :  10:42:35 AM  Show Profile  Reply with Quote
Here's the weird thing: Once I edited the line in the editor, then it recognized it properly. But until then, it saw both names with the "cmd.cmd" format as being part of the "cmd." portion and renaming that part renamed both.

I haven't been able to reproduce it since, so I'll assume it was a fluke.

I do have another interesting error. Font ligatures don't work with these lines of code:



You have to type them in exactly, but if you do the top font ligature doesn't work. I've submitted this to Microsoft as a bug: https://developercommunity.visualstudio.com/t/Font-ligatures-not-always-working/10406596

Using the Fantasque Sans Mono font from www.programmingfonts.org -- It produces the first line like this, and the second line like this. It only happens with this exact sequence. Change one thing on the line and it works:



I doubt it has anything to do with VAX, but can you reproduce it? Here's the exact text which reproduces it. Three leading tabs, two tabs after the "!= 0)" part, and two tabs after the "% 4));" part, and and tabs everywhere else using tabs = 4 spaces:

			if ((bi->biWidth * 3) % 4 != 0)		lnRowWidth = bi->biWidth * 3 + (4 - ((bi->biWidth * 3) % 4));		// It has to be rounded up to be
			else								lnRowWidth = bi->biWidth * 3;										// It is evening divisible by 4


Tabs are shown above with more than 4 spaces so it's misaligned, but if you copy it into Visual Studio's editor when tabs are set to 4 it should align. And if you have a font with ligatures on the "//" character combination, it should show the "//" parts differently at the start of the comment.

--
Rick C. Hodgin
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18915 Posts

Posted - Nov 08 2023 :  07:37:57 AM  Show Profile  Reply with Quote
Do you have a simple copy of the font to test with? The font website takes me to a github page, with instructions for compiling the font, using several different tools, on macOS. I can see me disappearing down a hole just installing packages and tools to try to compile this.

zen is the art of being at one with the two'ness
Go to Top of Page

foxmuldr
Tomato Guru

USA
402 Posts

Posted - Nov 09 2023 :  10:36:27 AM  Show Profile  Reply with Quote
From here:
https://github.com/belluzj/fantasque-sans

If you click on the "Releases" link on the main landing page (middle/lower right) it will take you to this page:
https://github.com/belluzj/fantasque-sans/releases



And there you'll see the various versions. You can download this one:
https://github.com/belluzj/fantasque-sans/releases/download/v1.8.0/FantasqueSansMono-Normal.zip

It should give you what you need.

--
Rick C. Hodgin

Edited by - foxmuldr on Nov 09 2023 10:38:28 AM
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18915 Posts

Posted - Nov 09 2023 :  11:46:44 AM  Show Profile  Reply with Quote
Missing the download zips page was embarrassing, so thank you for the link.

I have set this as the editor font now in VS2022, version 17.7.5, with VA 2476.0, which is the version you posted you were using. So far no sign of the visual problems here. Both comment lines show the same close together // at the start of the comment. The not equals ligature is also shown correctly. This is before and after editing the cpp file I have placed the two lines of code into.

It could be a setting, IDE or VA matters, or something further up the file is a factor.

zen is the art of being at one with the two'ness
Go to Top of Page

foxmuldr
Tomato Guru

USA
402 Posts

Posted - Nov 09 2023 :  12:23:38 PM  Show Profile  Reply with Quote
It has to be exact. Three leading tabs, two tabs after the ), two tabs after the ;, and all of the spacing otherwise correct. Change one character anywhere and it doesn't do it. I have no idea why.

I was able to paste the two lines above into my source file from the left-most column 0 on a line. It auto-indented after pasting, so I pressed Ctrl+Z once to bring it back to it's neutral pasted form, and it shows up in my version:

Microsoft Visual Studio Professional 2022 (64-bit) - Current
Version 17.7.6

--
Rick C. Hodgin

Edited by - foxmuldr on Nov 09 2023 12:24:29 PM
Go to Top of Page

foxmuldr
Tomato Guru

USA
402 Posts

Posted - Nov 09 2023 :  12:26:56 PM  Show Profile  Reply with Quote
quote:
Originally posted by feline
It could be a setting, IDE or VA matters, or something further up the file is a factor.



It's done it since 17.6.4. And it does it if it's the first line in an otherwise empty source file.

Might be a setting. Microsoft hasn't moved on it since I reported it and they put it as "Under Consideration."

--
Rick C. Hodgin
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18915 Posts

Posted - Nov 10 2023 :  08:21:36 AM  Show Profile  Reply with Quote
Not enough indenting, comes from copy and pasting the two lines, but no surrounding code to force the correct level of indenting.

I have wrapped the code in a bit more code to make it compile, and I can reproduce this on a clean install of VS2022 version 17.7.5 where VA has never been installed.



screen shot with visible white space, makes it a lot easier to make sure it is correct.

So what ever is happening happens even without VA.

zen is the art of being at one with the two'ness
Go to Top of Page

foxmuldr
Tomato Guru

USA
402 Posts

Posted - Nov 14 2023 :  08:51:31 AM  Show Profile  Reply with Quote
quote:
Originally posted by feline
screen shot with visible white space, makes it a lot easier to make sure it is correct.


Genius. :-) I don't use that feature so I didn't think about it. Makes perfect sense. I'll actually update the reported issue on Microsoft's website.
quote:

So what ever is happening happens even without VA.


Good to know. It's really a fluke thing.

--
Rick C. Hodgin
Go to Top of Page

feline
Whole Tomato Software

United Kingdom
18915 Posts

Posted - Nov 14 2023 :  10:49:35 AM  Show Profile  Reply with Quote
Very strange result, I agree. We do see odd problems like this with VA as well, where a single piece of code trips something up, even though you cannot actually see anything really odd or wrong in the code.

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000