Heat the oil in a large frying pan, add the onion and garlic and cook for 2–3 minutes until the onion has softened. Stir in the cherry tomatoes, sugar and vinegar and cook for 5 minutes, stirring occasionally, until the tomatoes have softened and start to collapse. Gently squash some of them with the back of a spoon and season to taste. Stir in the basil.
Meanwhile, cook the pasta in a saucepan of lightly salted boiling water according to packet instructions until al dente.
Drain the pasta and toss with the sauce. Serve immediately with the grated Parmesan and rocket.