Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Technical Support
 VA suggesting adding var instead of method

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
Uniwares Posted - Feb 09 2020 : 08:21:39 AM
While VS correctly suggests adding a new method to the underlying class, VA suggests add a variable. Which is totally off here.






2   L A T E S T    R E P L I E S    (Newest First)
Uniwares Posted - Feb 11 2020 : 4:00:53 PM
Am traveling for the rest of htis week, next week back to the topic.
feline Posted - Feb 11 2020 : 2:21:49 PM
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.


© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000