-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introducing a [DebuggerTypeProxy] to the generated quantities #1390
Conversation
I initially had the |
For the quantities I'm familiar with, I tend to navigate using the Units as well, wasn't sure what's the more natural way for other/ new users. This is also why I've been thinking about changing the name to Here is the renamed version - it's just the
We can have anything, just need a name that would sort correctly in the display: the "Q" in
Yes, I must have missed that (they are both displaying the same way in v6). |
I think it's fine, we can always revisit.
For me, that's entirely fine. I'm not so focused on the order, as much as having a fairly short list of properties that is easy to read and dig through. |
@angularsen I think this should be good (for now): I've added the missing |
Perfect, can you also port this to v6 branch? |
@angularsen I ported the modifications to v6, and was just having a closer look at the screenshots you posted from Rider- that thing about the |
I honestly did not notice, but sure, it may shorten the name a bit if you move the types so they are not nested, but it seems Rider shows a kind of breadcrumb in this scenario for the path I have expanded. As for configurable, I can disable "fully qualified", but it only removes the leading "UnitsNet" part. For me, I would not bother changing this anyway. I'm fine with it as-is. |
Do you want to make any changes before I merge #1395 ? |
Nah, we can do it later (perhaps even making the |
This is added to all quantities such:
There are 4 properties visible, each of which can be further expanded:
Abbreviation
: displays theDefaultAbbreviation
and expands with the list all abbreviations for the current unit, also holds a property with the possible unit conversions (displaying the target abbreviation in theConvertedQuantity[]
)Unit
: displays theUnit
such asMilligram
and expands to the list of other options, where every other options expands to the respectiveConvertedQuantity
(much like a smart enum).Value
: displays theDoubleValue
by default and expands with theIsDecimal
,DecimalValue
andDoubleValue
propertiesValueConversions
: displays the output of theQuantityToString
by default and expands with the list of possible QuantityToString options (currently only has theGeneralFormat
andShortFormat
properties) as well as the list of possible unit conversions (ConvertedQuantity[]
)Note that I've had to carefully pick the property names such that they are sorted (more or less) how I wanted, as visual studio sorts them alphabetically, not by the order of declaration. Perhaps there (is / would one day be) an option to change that behavior but, yeah- that's it for now.
I've only tested this with Visual Studio 2022 - but i don't see why there should by any issues with the other IDEs. I did observe that not all things are always displayed on net48 (sometimes there is the _"..requires thread to complete..").
If we open the visualizer view with the list from the
QuantityToUnit
we get a nice little table: