Cook pasta according to package instructions. Cook 1-2 minutes less than stated so that it can continue cooking in the sauce without overcooking.
Heat a large saute pan over medium heat. Add the oil followed by the garlic. Cook until the garlic begins to sizzle.
Add the rosemary to the garlic and oil. Cook for a few seconds until you begin to smell the rosemary.
Increase the heat to medium. Add the mushrooms and salt and continue cooking until the mushrooms are lightly browned.
Add the green onions and cook for 2-3 minutes.
Add one cup of the pasta water to the mushrooms. Reduce the heat and simmer for approximately 10 minutes until the mushrooms are tender.
Using a slotted spoon or kitchen spider strainer, add the pasta to the mushroom mixture.
Stir in the ricotta cheese and parsley. Add additional pasta water, if needed. Simmer until thoroughly heated and the pasta is cooked al dente.
Season to taste with salt and pepper.
Remove from heat and sprinkle with freshly grated Parmesan cheese.