Open ghost opened 5 years ago
The right hand side could also be an expression, such as:
a() === x
or:
a() === new Namespace.MyClass().enabled()
We do have the concept of recommend suggestions, so we could recommend true
and false
so that they are preselected in the suggestion list. I'm not sure how helpful this would be in practice.
Moving upstream for more feedback
It's better for "hunt 'n' peckers" (people that are terrible at using the keyboard) but it looks like a good feature, and sometimes I'm in a bit of a rush when it's the night, so this would be a helpful feature in my opinion.
Apart from loose equality, why would you write either
x === true
x !== true
instead of the following?
x
!x
@DanielRosenwasser It's more explicit, and it avoids the quirks of JavaScript.
function a (b, c) {
if (b === true) return b;
if (c === true) return c;
}
a(1, true) // => c
a(true, 1) // => b
Probably the best UX upside is that if you write if (foo() ===
thinking foo
returned some other type, you'd see true
/false
in the completion list and immediately know what was up
Intellisense is great for things like
typeof
, so why not make it great for boolean types too!I think adding intellisense for booleans saves a bit of typing, and it still hasn't been implemented.
Look at this:
I think this would be a great addition to Intellisense. Any feedback is appreciated.