Skip to content

Commit fef8cd0

Browse files
committed
(WIP)
1 parent 300f29b commit fef8cd0

File tree

1 file changed

+8
-0
lines changed
  • sonar-kotlin-plugin/src/main/java/org/sonarsource/kotlin/plugin

1 file changed

+8
-0
lines changed

sonar-kotlin-plugin/src/main/java/org/sonarsource/kotlin/plugin/KotlinSensor.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import org.sonar.api.issue.NoSonarFilter
3131
import org.sonar.api.measures.FileLinesContextFactory
3232
import org.sonarsource.analyzer.commons.ProgressReport
3333
import org.sonarsource.kotlin.api.checks.hasCacheEnabled
34+
import org.sonarsource.kotlin.api.common.KOTLIN_LANGUAGE_VERSION
3435
import org.sonarsource.kotlin.api.common.KotlinLanguage
3536
import org.sonarsource.kotlin.api.common.measureDuration
3637
import org.sonarsource.kotlin.api.frontend.bindingContext
@@ -67,6 +68,13 @@ class KotlinSensor(
6768
.name(language.name + " Sensor")
6869
}
6970

71+
override fun execute(sensorContext: SensorContext) {
72+
sensorContext.config()[KOTLIN_LANGUAGE_VERSION].ifPresent { value ->
73+
sensorContext.addTelemetryProperty("kotlin.languageVersion", value)
74+
}
75+
super.execute(sensorContext)
76+
}
77+
7078
override fun getExecuteContext(
7179
sensorContext: SensorContext,
7280
filesToAnalyze: Iterable<InputFile>,

0 commit comments

Comments
 (0)