Directly inspired by the question, When does a hidden opponent that is attacking become visible?.
From the Player's Handbook, page 194:
If you are hidden -- both unseen and unheard -- when you make an attack, you give away your location when the attack hits or misses.
I realize that there is not much information on how movement is supposed to play a part, if attacking while hidden is regularly possible.
Take a scenario with a Rogue hiding behind a building. He has all line of sight blocked from all enemies at the moment, who know that he's behind the building but not sure exactly where. He has the Skulker and Crossbow Expert feats. He pops out from the corner of the building, attacks, and he misses.
In order to make that attack, he popped out from the corner, and must have been within the enemies' line of sight. Is he no longer hidden, despite having the Skulker feat?
If he is still hidden after his first attack, can he move 15 feet into the open and make a second attack as if he was hidden?
Lastly, if he misses with the second attack, and attempts to move back into cover, is he no longer hidden?
When in this sequence is the Rogue no longer hidden?