Improvements in 2sxc and VS Code now let you use intellisense when writing Razor templates. This game changer will quadruple your productivity!
2sxc Intellisense Multiplies Productivity
You know those scenarios where...
- ...you can't figure out what the code does - even though you wrote it two weeks ago
- ...you're trying to figure out if it was called Kit.Image or Kit.Picture
- ...you're in the middle of tweaking a toolbar button and have no clue what the parameters are
Previously you had to have a lot of experience, or the tutorial and docs were your constant companion. Well now you have an even better companion: Intellisense itself.
This can easily double or triple what you can achieve. Here are some examples:
Discover APIs you didn't know
Type a keyword like "Kit." and you'll everything it offers incl. a brief description:
Discover Parameters you didn't know
So you know that you want to create an automatically resizing picture - but what can you configure? Intellisense will just tell you:
Discover Brand-New Features just by typing
For example, 2sxc 17 just introduced a tweak parameter to the .Html(..., tweak: ) method. It allows you to output the HTML in all it's glory (with automatically resizing images), but now you can still modify the contents (eg. to replace placeholders). You would never have figured this out by yourself!
But How? And Why not Sooner?
VS Code has just recently matured enough for us to do this. Because for this to work, it needs:
- VS Code C# Dev Kit which only stabilized recently
- We had to figure out how to build special .sln / .csproj files for this
- We had to bundle some XML file(s) with 2sxc for this to work, which we now do in v17
What Must You do To Use Intellisense?
➡️ Follow the instructions on https://go.2sxc.org/vscode
Limitations / Shortcomings
This is new and amazing. And not 100% perfect. It helps to understand the limits of a system to better work with it. Here are the things you should know about:
- As of now, you must manually create the app.sln and the app.csproj file as explained. This kind of sucks, but it's related to the next challenge.
- The entire system is still WIP. For example, the DevKit had some issues with certain doc formats, and we're still working on the best recommendations for the app.csproj file. So do revisit the docs from time to time, as we'll improve the suggestions as we go.
- In scenarios where you develop outside of Dnn (and then copy-deploy or something) you may want to use another setup and will want to create other app.csproj files. Do send us your samples so we can include them in the docs.
- We would love to auto-link to our docs online, but this is not yet possible.
Last but the most important: 2sxc has a LOT of internal APIs. You may stumble over APIs which you should not use, simply because the discovery is so easy. Internal APIs can change without warning, so if you feel like you're about to use an API that seems exotic, best cross-check with the docs.
Get Started now
Merry X-Mas, and have fun!
iJungleboy