How to show new line in the hint generated from comment in VS Code

Viewed 806

When using VS Code, I want my block comments shown with the new line when I move the cursor onto it. Currently it is presented in just one line as below. I did google online but didn't find anything related. Any advice would be appreciated!

VSCode Version 1.59.0

Commit 379476f0e13988d90fab105c5c19e7abc8b1dea8

Related Issue C/C++ doc comments preview doesn't react to newlines (Should be fixed yet)

enter image description here

Update 8.28:

(1) In my case, @brief, @param, etc have an effect of removing newline of the following statement, and Markdown grammar cannot be interpreted in my VS Code, e.g.

enter image description here

(2) The only way it works is using pure block comments like this:

enter image description here

1 Answers

You cannot influence how normal text is rendered. It's interpreted as Markdown text with collapsed whitespaces. The only way to do at least partially what you want is to format (a part of) the text as code, just like you can do here at Stackoverflow (triple back tick block):

    /**
     * Converts the given position to one which is relative to this context.
     *
     * ```ts
     * let i: number = 1;
     * const a = true;
     * ```
     *
     * @param value The position to convert.
     *
     * @returns The position in local space.
     */
    public toLocal(value: IPosition): IPosition {
        return {
            lineNumber: value.lineNumber - this.presentation.startLine + 1,
            column: value.column,
        };
    }

enter image description here

Related