⚠️ NOTICE: this extension is still under active development! ⚠️
VS Code Codebuddy Inline Fold Injector Metadata Extension
VS Code Codebuddy Inline Fold Injector Metadata extension mimics VS Code's folding experience for inline code.
This is especially useful when working with frameworks like Tailwind CSS which use lots of utility classes that often disfigure code visual structure. You can expand the folds by clicking on them. You can also configure the extension to target specific attributes in your markup.
The characters used as a mask can be configured in the settings and you can update the regex expression to match any code pattern you want.
The extension also enables folding of attribute values within HTML/JSX tags. It makes your code tidy and easier to navigate.
SVG As For Another USE Case
Embeded SVG also tend to have alot of code, that you just dont wanna focus on.
So with this settings below you can fold the ugly part.
Regex to Match: <svg(\s*.*?\s*)<\/svg>
Regex Flags: gs
Note: Minfing SVG maybe required for better experience.Beside we looking forward that this extension will support multiple Regex soon.
Available Settings
inlineInjectorIdFold.regex regex to match the code line
inlineInjectorIdFold.regexValue regex to match the code line
inlineInjectorIdFold.regexFlags regex flags
inlineInjectorIdFold.regexGroup regex group that match the code that should be folded
inlineInjectorIdFold.unfoldedOpacity opacity of the unfolded code when it's clicked or is selected
inlineInjectorIdFold.maskChar text/character to mask the code when it is folded
inlineInjectorIdFold.maskColor color of the mask character(s)
inlineInjectorIdFold.maskCharValue text/character to mask the code when it is folded
inlineInjectorIdFold.maskColorValue color of the mask character(s)
inlineInjectorIdFold.after an optional text/character that will be appended to the end of folded code
inlineInjectorIdFold.supportedLanguages a list of targeted language Ids
inlineInjectorIdFold.unfoldOnLineSelect unfold the line when any part of the line is selected
Use settings UI to configure the extension (better for regex escaping).
If the extension doesn't work, then check for your language id, you can add it from the settings under inlineInjectorIdFold.supportedLanguages using the specific language Id.
You can set a keyboard shortcut to toggle the folding on and off. Search for "Codebuddy Inline Fold Injector Metadata" in the commands panel, then click the gear icon and set the desired keybinding.