Preheat the slow cooker if necessary; see the manufacturer's instructions. Heat the oil in a large frying pan, add the onion and fry, stirring until softened. Add the peppers and garlic and fry for 1–2 minutes.
Stir in the flour, mix in the tomatoes, then add the sugar, the basil, torn into pieces, stock and a little salt and pepper. Bring to the boil, then pour into the slow cooker pot. Cover with the lid and cook on high for 3–4 hours or until the peppers are tender.
When almost ready to serve, bring a large saucepan of water to the boil, add the gnocchi and cook for 2–3 minutes or until they float to the surface and are piping hot. Drain and gently stir into the pepperonata in the slow cooker pot. Spoon into shallow bowls and sprinkle with torn basil leaves and grated Parmesan.