Preheat the oven to 375°F. Grease a 9x13-inch baking dish.
Place a large skillet on the stove over medium-high heat. Add the Italian sausage and cook, breaking it up, for 6-8 minutes.
Add the diced onion and cook for 3-4 minutes, until softened. Drain excess grease if needed.
Add the garlic and cook for 30 seconds. Stir in marinara sauce, drained diced tomatoes (optional), Italian seasoning, crushed red pepper flakes (optional), black pepper, and a pinch of salt if needed. Simmer 6-10 minutes to thicken. Remove from the heat.
In a bowl, mix ricotta, egg, and ¼ cup parmesan. Season lightly with salt and pepper.
Press one tube of crescent dough into the bottom of the baking dish, pinching seams together.
Spread the ricotta mixture over the dough. Spoon the meat sauce over the ricotta.
Sprinkle mozzarella over the top, then sprinkle the remaining ¼ cup parmesan.
Add the second tube of crescent dough over the top (as a full crust or torn into pieces).
Bake for 25-30 minutes, until the crust is golden brown and cooked through. If the top browns too fast, loosely cover with foil near the end.
Rest for 10-15 minutes, garnish with basil or parsley, then slice and serve.