I can't believe I'm getting involved in this mess, but here goes:
The big hang-up is RAW for when hiding ends. As per the rules (Hiding Sidebar, p177): "When you try to hide, make a Dexterity (Stealth) check. Until you are discovered or you stop hiding, that check’s total is contested by the Wisdom (Perception) check of any creature that actively searches for signs of your presence."
Does "popping out" (defined as quickly leaving cover you're hiding behind to make a missile attack) constitute a stop in hiding? The rules don't say, but they do prohibit approaching and making a melee attack while hidden, though the DM may rule otherwise based on circumstances. Obviously, you can apply this to ranged attacks as well, but that's not a huge help.
A stealth roll is contested by a Perception check (if active searching is underway) or Passive Perception (if not). Should the hidden attacker make a roll against the Passive Perception of the target, provided the target is engaged in combat and not actively searching? Possibly. I would say it would be a requirement to maintain being hidden (as per the Hiding sidebar), but it still doesn't address when "you stop hiding".
From a technical standpoint, you gain advantage on an attack if your opponent can't see you (no matter if you're hidden or not). If you "pop out" from hiding to make a missile attack, you're theoretically seen (or at least seeable) when you're making your attack--which would spoil the advantage.
Unfortunately, the rules also don't say why unseen attackers gain advantage on attack rolls. An obvious answer is that its because the target doesn't know the attack is coming or from what direction, and is therefore not properly prepared to defend against it. Can we justify giving a "pop-out attack" this advantage based on the circumstances? If it meets that criteria (the target doesn't anticipate the attack or, at least, its direction and speed), I'd say yes (by strict DM judgment call).
[Side note--I take Unseen to be Undetected. It's more intuitive and covers more cases--such as creatures with blindsight.]
As for the topic at hand, I would consider what the Hidden status means. Obviously it means more than Unseen, since you can be in the next room and not be "Hidden". The Hiding Sidebar speaks of "signs of your presence" and "give away your position" so, even though it's not stated, we might infer that hiding refers to obscuring your presence (the fact that you're there at all) and/or your location (someone might know you're hiding somewhere, just not exactly where). Obviously, hiding your presence is more of an out-of-combat goal (sneaking past the sleeping dragon) while hiding your location (hiding from the angry ogre) is an in-combat goal.
Combat stealth means hiding your location from your foes. I would say that, after revealing your location with an attack you would have to move to a position where you location is obscured from your foes in order to hide again. If you were behind a pillar, can you duck back behind the same pillar and hide again? By my estimation no, because your location is known to your enemy, even if there is no line of sight. You have to move to a place of cover or concealment large enough to hide your precise location--the opponent has to lose track of your position. Whether or not they do is dependent on your stealth check. What locations are suitable for hiding in combat? Once again we are entirely in the realm of DM fiat.
So what we have with 5E is a rather poorly written section that outlines some basic tools (stealth vs. perception checks, advantage on attacks, cover and concealment) for the DM (and the DM only) to resolve specific situations. The rules explicitly give the DM full control of when someone can hide, where they can hide, and how far they can push their hidden status. In combat, the language of the hiding rules favor the observer, making them hard to sneak up on and attack, which require the DM to overrule for specific circumstances. The onus is on the stealthy-character to justify their stealth, which is harder to do in combat than out of combat.
So, to sum up, I would allow a "pop-up attack" at advantage, even though I don't believe this is strictly endorsed RAW, since I think in most circumstances such an attack from a previously hidden character would be unanticipated and, thus, worthy of advantage. At the same time, hiding and re-hiding in the midst of combat should be difficult and requires ample areas of cover and/or concealment.
The "pop-up attack" works solely because the target was no expecting the attacker to jump out from behind a pillar and shoot them with a crossbow bolt. Assuming the target survives they are now aware of the attacker and can track their position. To re-hide and attempt the "pop-up attack" again, the attacker needs to move to an area where their precise location can be concealed and then take the hide action.
The result is a system where stealth is effective out-of-combat and in ambush situations, but is harder to continuously exploit in most combats.