File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
sonar-kotlin-plugin/src/main/java/org/sonarsource/kotlin/plugin Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ import org.sonar.api.issue.NoSonarFilter
3131import org.sonar.api.measures.FileLinesContextFactory
3232import org.sonarsource.analyzer.commons.ProgressReport
3333import org.sonarsource.kotlin.api.checks.hasCacheEnabled
34+ import org.sonarsource.kotlin.api.common.KOTLIN_LANGUAGE_VERSION
3435import org.sonarsource.kotlin.api.common.KotlinLanguage
3536import org.sonarsource.kotlin.api.common.measureDuration
3637import 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 >,
You can’t perform that action at this time.
0 commit comments