3 min read
Comments and doc comments
Using comments and doc comments in Slice files.
Comments
You can and should add comments to your Slice files to make your Slice definitions easier to understand.
A Slice comment starts with two slashes (//
) and continues until the end of the line, just like in C# and Rust:
slice
// This is a commentinterface FooBar { // This is another comment}
Slice also supports block comments (/* ... */
), like C, including nested block comments.
The Slice compiler completely ignores comments that are not doc comments.
Doc comments
Slice comments that start with a triple slash (///
) are doc comments. The Slice compiler uses these special comments as input for the doc comments it generates in the mapped language.
Slice doc comments can be attached to all Slice elements except parameters, modules, and mode statements.
Doc comments tags
Slice doc comments support the following tags: