forParameter

fun forParameter(parameter: DocsParameter, alwaysNamed: Boolean, insertionIndex: Int = 1, insertionPlaceholder: String = ""): String

Generates a snippet for a function parameter in the accepted format by the LSP. The snippet handles three cases:

  • Inline, likely unnamed

  • Inline, likely named

  • Body

Return

the function parameter snippet

Parameters

parameter

the parameter to generate the snippet from

alwaysNamed

whether the parameter should always be treated as named if inline

insertionIndex

the index of the insertion point in the snippet

insertionPlaceholder

the placeholder text to insert at the insertion point