File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/kotlin/com/github/xepozz/php_opcodes_language/documentation Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -21,15 +21,18 @@ class PHPOpDocumentationProvider : AbstractDocumentationProvider() {
2121 override fun generateDoc (element : PsiElement ? , originalElement : PsiElement ? ): String? = when (element) {
2222 is PHPOpParenParameter -> generateDoc(element.parameter, originalElement)
2323 is PHPOpParameter -> {
24- val directiveName =
25- if (element.isVariable) element.text.trimEnd { it.isDigit() } else element.text.toString()
24+ val elementName = element.text ? : return null
25+ val directiveName = when {
26+ element.isVariable -> elementName.trimEnd { it.isDigit() }
27+ else -> elementName
28+ }
2629 val doc = OpcodesDictionary .getDocumentation(directiveName) ? : return null
2730
2831 val highlighter = CodeBlockHtmlSyntaxHighlighter (element.project)
2932
3033 buildString {
3134 append(" <div class='definition'>" )
32- append(" <pre><b>Name</b>: ${doc.name } </pre>" )
35+ append(" <pre><b>Name</b>: ${elementName } </pre>" )
3336 if (doc.number >= 0 ) {
3437 append(" <pre><b>Number</b>: ${doc.number} </pre>" )
3538 }
You can’t perform that action at this time.
0 commit comments