Wash, halve and dice the chillies.
Peel and finely dice the onion and garlic.
Wash the asparagus, peel the lower third and cut off the woody ends. Cut into 3cm lengths.
Heat 2 tbsp oil in a pan and sauté the onions, garlic and chillies for 2-3 minutes. Sprinkle with flour.
Stir in the cream and vegetable stock and season with salt, pepper and sugar. Cook for around 10 minutes over a medium heat, stirring occasionally.
Meanwhile, cook the asparagus in boiling salted water for 3 minutes, remove with a slotted spoon, rinse under cold water and drain again.
Cook the gnocchi in the asparagus water according to pack instructions, then drain. Puree the chilli sauce with a hand blender.
Finely dce the ham. Finely grate the cheese. Wash the thyme, shake dry and roughly chop the leaves.
Grease an ovenproof dish with the remaining oil. Mix together the asparagus, gnocchi, thyme and ham and pour into the dish.
Top with the chili sauce, sprinkle with cheese and place in a preheated oven at 220°C (200°C fan, gas 7).