override fun visitReferenceExpression()

in src/main/kotlin/org/jetbrains/tinygoplugin/inspections/libraries/TinyGoImportInspection.kt [71:90]


            override fun visitReferenceExpression(reference: GoReferenceExpression) {
                super.visitReferenceExpression(reference)
                if (!reference.project.tinyGoConfiguration().enabled || !customContextPredicate(reference)) {
                    return
                }
                val target = reference.resolve()
                if (target is GoVarOrConstDefinition) {
                    val type = unwrapPointerTypeIfNeeded(target.getGoType(ResolveState.initial())) ?: return
                    checkType(type, reference)
                }
                val file = target?.containingFile
                if (file is GoFile) {
                    checkFileLocation(
                        file,
                        reference,
                        IMPORT_DEPENDENCY_INSPECTION_MESSAGE,
                        generateDisplayName(target)
                    )
                }
            }