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
 VA suggesting adding var instead of method
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Feb 09 2020 :  08:21:39 AM  Show Profile  Reply with Quote
While VS correctly suggests adding a new method to the underlying class, VA suggests add a variable. Which is totally off here.






feline
Whole Tomato Software

United Kingdom
19063 Posts

Posted - Feb 11 2020 :  2:21:49 PM  Show Profile  Reply with Quote
I have set up an example for this, using the same code I used for one of your other threads, giving me this test code:

class TestFelineParts
{
    public int Parts { get; set; }
    public int TotalPieces { get; set; }
    public int MarkerLength { get; set; }
}

class feline_test_general
{
    private void testingIntVariableBrackets()
    {
        TestFelineParts parts = new TestFelineParts { Parts = 5, TotalPieces = 3, MarkerLength = 23 };
        TestFelineParts bp = new TestFelineParts { Parts = 2, TotalPieces = 1, MarkerLength = 21 };
        int partsAlreadyProduced;
        partsAlreadyProduced = (parts.Parts < 0) ? bp.TotalPieces - parts.Parts : parts.Parts;
        // Test - place keyboard cursor into "UpdateUsage" and press Alt-Shift-Q
        // for VA context menu, should offer both:
        // "Create Method" and "Introduce Variable..."
        // NOTE - "Introduce Variable..." creates a new variable to accept the return of this function call!
        parts.UpdateUsage(bp.MarkerLength);
    }
}

can you please try this on your system and see what results you get? Also, if you still have access to a similar error, try running "Introduce Variable" and see what VA actually does? Adding a variable to hold the return type of the function may be "unexpected", but its not an unreasonable guess. But it should be paired with an option to create the unknown function.


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

Uniwares
Tomato Guru

Portugal
2322 Posts

Posted - Feb 11 2020 :  4:00:53 PM  Show Profile  Reply with Quote
Am traveling for the rest of htis week, next week back to the topic.
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