Comments and doc comments

Using comments and doc comments in Slice files.

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 comment
interface 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.

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.

Slice doc comments support the following tags:

Was this page helpful?