I'm trying to make a quickfix that fixes spelling ...
# intellij-plugins
r
I'm trying to make a quickfix that fixes spelling to conform to an agreed upon standard for projects, and I've got this
Copy code
inner class SpellingQuickFix(private val wrong: String) : LocalQuickFixBase("Correct spelling") {
        override fun applyFix(project: Project, descriptor: ProblemDescriptor) {
            val correct = spellingMap[wrong]!!
            val element = descriptor.psiElement
            val func = element.parent as KtNamedFunction

            val newName = func.name!!.replace(wrong, correct)

            for(ref in func.references) {
                logger.debug("Function reference $ref")
                ref.handleElementRename(newName)
            }
            func.setName(newName)
        }
    }