I've been making UI in games for 30 years and using Razor components for UI is the best way I have found. Our Razor syntax highlighting has always been quite fickle, and the update to VS2026 made it a million times worse.
As part of my hackweek I decided to do a deep dive on it all to see if I could figure out why. And I did it!
I am so happy that everyone now gets to experience it like how it's meant to work, with auto completion, syntax highlighting and full intellisense. It really is a total game changer and makes things so much easier.
Namespacing
To make it work properly, we had to cooperate with how namespacing works. In Razor/Blazor, if you don't specify a @namespace in your file, it'll default to <RootNamespace>.<FolderName>. Whether this is good or bad, I'll let you decide.. but I have made s&box have the same behaviour now.
This means that if your code won't compile now, add a @namespace to all your .razor files, or live with the folder based namespaces.
Inherits
Razor doesn't know that we're using Panels instead of whatever they use. So we need to tell them. You do this by adding @inherits Panel at the top of every .razor file. If your intellisense isn't working, make sure you have this line.
Parameters
For parameters to show properly in intellisense you need to add a [Parameter] attribute to the property. That way when you use one of your components, you'll have autocompletion.
You can add these to your regular .cs based Panels to get autocompletion too!
>jiggle bones for cosmetics
>razor auto completion, syntax highlighting, a intellisense
this week update was peak
Great work from Conna on the Network culling as well.