Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is Intellij telling me with this green background color on certain variables?

enter image description here

On user and asset I'm getting this green background. What is it? I'm not in "highlight ocurrences" mode, as I pressed ESC.

Hovering gives type (is an interface).

This is typescript code.

What I checked:

  • it is not "Identifier under caret"
  • it is not "Injected language fragment"
like image 487
agoldev Avatar asked Oct 15 '25 04:10

agoldev


1 Answers

Found the solution here.

It was the "Variable type narrowed by a type guard" setting in

Settings 
  -> Editor 
  -> Color Scheme 
  -> TypeScript 
  -> "Variable type narrowed by a type guard"

What it means

the type of asset has been "narrowed" from type Asset | undefined which was returned by getAssetFromUrl() to then Asset as of the undefined check and the return.

like image 100
agoldev Avatar answered Oct 17 '25 17:10

agoldev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!