You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ERROR] 2021-05-08 23:21:19 Internal error has occurred in kdoc-formatting. Please make an issue on this bug at https://github.com/cqfn/diKTat/.
java.lang.NullPointerException: Cannot invoke "org.jetbrains.kotlin.com.intellij.psi.impl.source.codeStyle.IndentHelper.getIndent(org.jetbrains.kotlin.com.intellij.psi.PsiFile, org.jet
brains.kotlin.com.intellij.lang.ASTNode)" because the return value of "org.jetbrains.kotlin.com.intellij.psi.impl.source.codeStyle.IndentHelper.getInstance()" is null
at org.jetbrains.kotlin.com.intellij.psi.impl.source.codeStyle.CodeEditUtil.saveWhitespacesInfo(CodeEditUtil.java:108)
at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.ChangeUtil.saveIndentationToCopy(ChangeUtil.java:104)
at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.ChangeUtil.copyLeafWithText(ChangeUtil.java:80)
at org.jetbrains.kotlin.com.intellij.psi.impl.source.tree.LeafElement.replaceWithText(LeafElement.java:153)
at org.cqfn.diktat.ruleset.utils.AstNodeUtilsKt.leaveExactlyNumNewLines(AstNodeUtils.kt:522)
at org.cqfn.diktat.ruleset.utils.AstNodeUtilsKt.leaveOnlyOneNewLine(AstNodeUtils.kt:515)
at org.cqfn.diktat.ruleset.rules.chapter2.kdoc.KdocFormatting$checkEmptyLinesBetweenBasicTags$1$1.invoke(KdocFormatting.kt:272)
at org.cqfn.diktat.ruleset.rules.chapter2.kdoc.KdocFormatting$checkEmptyLinesBetweenBasicTags$1$1.invoke(KdocFormatting.kt:62)
at org.cqfn.diktat.ruleset.constants.Warnings.warnAndFix(Warnings.kt:258)
at org.cqfn.diktat.ruleset.constants.Warnings.warnAndFix$default(Warnings.kt:206)
at org.cqfn.diktat.ruleset.rules.chapter2.kdoc.KdocFormatting.checkEmptyLinesBetweenBasicTags(KdocFormatting.kt:270)
at org.cqfn.diktat.ruleset.rules.chapter2.kdoc.KdocFormatting.logic(KdocFormatting.kt:88)
at org.cqfn.diktat.ruleset.rules.DiktatRule.visit(DiktatRule.kt:46)
at com.pinterest.ktlint.core.KtLint$format$1.invoke(KtLint.kt:271)
at com.pinterest.ktlint.core.KtLint$format$1.invoke(KtLint.kt:23)
at com.pinterest.ktlint.core.KtLint$visitor$2$2.invoke(KtLint.kt:212)
at com.pinterest.ktlint.core.KtLint$visitor$2$2.invoke(KtLint.kt:23)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:224)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:225)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:225)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:225)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:225)
at com.pinterest.ktlint.core.KtLint$visitor$2.invoke(KtLint.kt:211)
at com.pinterest.ktlint.core.KtLint$visitor$2.invoke(KtLint.kt:23)
at com.pinterest.ktlint.core.KtLint.format(KtLint.kt:264)
at com.pinterest.ktlint.internal.FileUtilsKt.formatFile(FileUtils.kt:79)
at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:331)
at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
[ERROR] 2021-05-08 23:21:19 As a workaround you can disable these inspections in yml config: [KDOC_CONTAINS_DATE_OR_AUTHOR, KDOC_EMPTY_KDOC, KDOC_NEWLINES_BEFORE_BASIC_TAGS, KDOC_NO_DE
PRECATED_TAG, KDOC_NO_EMPTY_TAGS, KDOC_NO_NEWLINES_BETWEEN_BASIC_TAGS, KDOC_NO_NEWLINE_AFTER_SPECIAL_TAGS, KDOC_WRONG_SPACES_AFTER_TAG, KDOC_WRONG_TAGS_ORDER]
Reproducer:
package com.akuleshov7.ktoml.parsers.node
import com.akuleshov7.ktoml.error
import com.akuleshov7.ktoml.exceptions.InternalAstException
import com.akuleshov7.ktoml.exceptions.InternalParsingException
import com.akuleshov7.ktoml.exceptions.TomlParsingException
import com.akuleshov7.ktoml.parsingError
class TomlFile : TomlNode("rootNode", 0) {
override val name = "rootNode"
override fun getNeighbourNodes() =
throw InternalAstException("Invalid call to getNeighbourNodes() for TomlFile node")
/**
* This method recursively finds child toml table with the proper name in AST.
* Stops processing if AST is broken and it has more than one table with the searched name on the same level.
* @param searchedTableName - the table name that is expected to be found in the list of children of this node
* @param searchedLevel - the level of nested child node that is searched level (indexed from 1)
*
* For example: findTableInAstByName("a.d", 2) will find [a.d] table in the following tree:
* a
* / \
* a.c a.d
* \
* a.d.e
*/
fun findTableInAstByName(searchedTableName: String, searchedLevel: Int): TomlTable? {
}
}
The text was updated successfully, but these errors were encountered:
Diktat version: 0.5.2
Reproducer:
The text was updated successfully, but these errors were encountered: