On Thursday, 4 March 2021 at 13:42:47 UTC, Imperatorn wrote:
On Thursday, 4 March 2021 at 13:29:11 UTC, Imperatorn wrote:
On Tuesday, 2 March 2021 at 08:58:15 UTC, Rainer Schuetze wrote:
[...]

A few questions.

How hard would the following be:

1. Highlight code as dead or alive in static if

2. Show typeid when hovering over a variable

I have gifs showing what I mean. I'll post them when I get back to my laptop.

https://filebin.net/19gupoeedfdjx5tx

One GIF is the behaviour in C# I would like to have in D as well with static if, and the other is displaying typeid on hover.

It already does this, I would say.

1. The D equivalent of your use of `#if ... #else ... #endif` is `version() {...} else {...}`, which works in VisualD the same way as you show. `static if` is different: the condition often depends on the value of template parameters, so this does not simply translate to "dead" or "alive" in every case.

2. typeid is a runtime concept (takes inheritance into account) so this won't work in an editor outside of a debugging session. However VisualD already shows the (static) type and scope of variables on mouse-over, which is all you can wish for, I think.

-- Bastiaan.

Reply via email to