File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
src/main/kotlin/org/tonstudio/tact/ide/documentation Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,6 @@ package org.tonstudio.tact.ide.documentation
33import com.intellij.lang.documentation.DocumentationMarkup
44import com.intellij.openapi.editor.markup.TextAttributes
55import com.intellij.psi.PsiElement
6- import com.intellij.psi.util.PsiTreeUtil
76import org.tonstudio.tact.ide.documentation.DocumentationUtils.asKeyword
87import org.tonstudio.tact.ide.documentation.DocumentationUtils.line
98import org.tonstudio.tact.ide.documentation.DocumentationUtils.part
@@ -213,7 +212,23 @@ private fun generateDocForConstantModifiers(attrs: List<TactConstantModifier>):
213212}
214213
215214private fun TactAttribute.generateDoc (): String {
216- return colorize(" @" , asAttribute) + (attributeExpression?.text ? : " " )
215+ val plainAttribute = attributeExpression?.plainAttribute ? : return " "
216+ val name = plainAttribute.attributeKey.text ? : " "
217+ val arguments = plainAttribute.argumentList?.expressionList ? : emptyList()
218+ return buildString {
219+ colorize(" @" , asAttribute)
220+ colorize(name, asAttribute)
221+ if (arguments.isNotEmpty()) {
222+ colorize(" (" , asParen)
223+ arguments.forEachIndexed { index, argument ->
224+ append(argument.generateDoc())
225+ if (index != arguments.size - 1 ) {
226+ append(" , " )
227+ }
228+ }
229+ colorize(" )" , asParen)
230+ }
231+ }
217232}
218233
219234fun TactStructDeclaration.generateDoc (): String {
You can’t perform that action at this time.
0 commit comments