All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.mokkery.plugin.ir.IrExpression.kt Maven / Gradle / Ivy

Go to download

Mokkery is a mocking library for Kotlin Multiplatform, easy to use, boilerplate-free and compiler plugin driven.

The newest version!
package dev.mokkery.plugin.ir

import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
import org.jetbrains.kotlin.ir.IrElement
import org.jetbrains.kotlin.ir.declarations.IrFile
import org.jetbrains.kotlin.ir.declarations.path
import org.jetbrains.kotlin.ir.util.render

fun IrElement.locationInFile(file: IrFile) = CompilerMessageLocation.create(
    path = file.path,
    line = file.fileEntry.getLineNumber(startOffset) + 1,
    column = file.fileEntry.getColumnNumber(startOffset) + 1,
    lineContent = this.render()
)




© 2015 - 2024 Weber Informatics LLC | Privacy Policy