Combine Files VS2022 ExtensionAllows you to combine the contents of files together and output the result. To do this, select the desired files and right click, press "Combine Files". The output will be in the "Output" pane under "Combine Files Output". Works for solutions and folder views. TemplatesLets you customise a template with macros to determine how files should be added together, for example:
This block would be output for each file selected, with the macros replaced. Available macros are {{absolute_filepath}}, {{filename}}, {{relative_filepath}}, {{type}} and {{text}}. Priority filesBy default, the files are (usually, possibly not) output in the order they are selected. Certain files can be prioritised. For example:
You can fill it up with all sorts of files, even if you don't think all of them would ever be used at once. The above list might be set for a developer that switches between C#, C++ and Rust. The readme file will always be output first, then whatever build system files are found, then the main. The other files will follow in order of selection. If you have an entry with no path seperator, then the entry will match no matter what directory it is in. If it has any path specifier at all, it will assume it to be relative to the working directory.
For example: If you add Excluded filesYou can set files to be always excluded. For example:
This has the similar path matching to priority files. See above for more information. Header and FooterYou can define a header and footer which will be added once each to the output, no matter how many files are selected. Type matchingThis extension will detect file type based on file name. and associate it with the macro {{type}}. For example:
The main purpose of this is creating markdown with syntax highlighting. So with this user defined macro you can set your template to be:
Which upon template resolution becomes:
A markdown decoder will make that look very pretty. |