I've seen a number of sources cite Darkness/Devil's Sight as a combo for Warlocks in which the Warlock's attacks get advantage and attacks on them have disadvantage, due to the heavily obscured effect that generates the Blinded condition for those who can't see through magical darkness. This makes total sense to me for Pact of the Blade warlocks in melee.
What's not clear to me is whether ranged attacks from inside the Darkness -- such as Eldritch Blast -- still have advantage if their target is outside the sphere of effect. My intuition says that on the one hand, the target can't see the spell being cast, but the target could still see the spell coming after it left the bubble. I can't tell from the wording on heavily obscured areas or from blindness how this would work.
To be clear, the question is: assume a warlock with Devil's Sight is in the area of effect of a Darkness spell, and they cast Eldritch Blast at a target outside the Darkness area of effect. Do they have advantage on the attack roll?