Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 suggestions/completions for Tuple stype assignment

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 - Apr 20 2020 : 06:21:28 AM
This is for sure the weirdest form of assignments and I am not sure if this should be a feature request or a bug request.

Given:
public void test()
{
	bool b; int i; string s;
	(b, i, s) = (true, 10, "test");
}


There is absolutly no suggestion or completion available inside the brackets.

Or another example:
public (bool, int, string) test(int n, bool v, string t)
{
	return (v, n, t);
}
7   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Apr 22 2020 : 05:33:44 AM
This makes sense, I just wanted to make sure that we were thinking about the same thing. When I started looking at tuple's I was thinking of them as a single complete item, rather than a collection of items, which is a better way of thinking about them. I have put the examples and comments for this onto the case.
Uniwares Posted - Apr 21 2020 : 12:56:51 PM
Actually this is exactly what I would expect to happen. The coma should always initiate a new suggestion/completion list, just as it does for parameters in a function. At least when the type can be determined. Otherwise nothing more than letter by letter elimination from the global value pool is possible.
feline Posted - Apr 21 2020 : 12:41:53 PM
That makes sense. Would one suggestion list per value, so a new suggestion listbox after each comma, work well in these situations? This way it is easy to handle 3 or 4 suggestions for each part of the tuple, without considering the total number of possible combinations of variables.
Uniwares Posted - Apr 21 2020 : 08:28:51 AM
In my logic I would expect a suggestion of default values when existing or any/all of the closest same-type variables. But anyway, case=99749 should solve this I hope.
feline Posted - Apr 21 2020 : 08:13:06 AM
We don't yet support tuples, but are working on getting support for them done soon:

case=99749

Here, are you thinking in terms of a suggestion inside the brackets, so a suggestion for each member of the tuple, or for VA to suggest a new tuple that is made up of existing members that match the types required? In your examples there is only one correct order for the local variables, but in general there will be several different valid combinations / orders for the tuple.
Uniwares Posted - Apr 21 2020 : 04:08:32 AM
In the case of my sample provided, types are known because they are defined outside the tuple. Yet no suggestions are made, so it seems that VA does not analyse the left side of the assignment. And in the case of the function returning a tuple, the type is also defined, so i would assume that VA would suggest the closest match of the same type.
feline Posted - Apr 20 2020 : 2:32:19 PM
In both examples, can VA really take the Tuple to be "defined"? I am not sure myself, still reading up on and learning about some C# features.

From this page Tuple's can have just types for their components, or the components can also be named:

https://docs.microsoft.com/en-us/dotnet/csharp/tuples

but in either case, Tuples are described as light weight, almost "temporary" things. Once the code is finished, it is reasonable to compare the tuple created to the one being assigned, or to the return type, but in general we don't know much about a tuple going into it, do we?

Or am I approaching this backwards, and you are wanting VA suggestion listboxes to suggest variable names when VA thinks you are typing a Tuple? If this is the case, I have tried the following simple example in C#, using VS2019 and VA 2366.0:

private (int, int) playingWithTuple()
{
    var namedTuple = (dimention: 23, length: false);
    int rectangleHeight = 3;
    int rectangleWidth = 4;
    var rectangleDimentions = (rectangleHeight, rectangleWidth);
}

when I am typing the Tuple, on the "rectangleDimentions" line, I am getting VA suggestions for the components, based on what I have started typing.

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