// ĠCopyright Ġ 2 0 0 0 - 2 0 1 9 ĠJetBrains Ġs . r . o . ĠUse Ġof Ġthis Ġsource Ġcode Ġis Ġgoverned Ġby Ġthe ĠApache Ġ 2 . 0 Ġlicense Ġthat Ġcan Ġbe Ġfound Ġin Ġthe ĠLICENSE Ġfile . Ċ package Ġcom . intellij . code Insight . hints Ċ Ċ import Ġcom . intellij . code Insight . hints . settings . In lay Provider Settings Model Ċ import Ġcom . intellij . code Insight . hints . settings . In lay Settings Provider Ċ import Ġcom . intellij . internal . statistic . beans . Metric Event Ċ import Ġcom . intellij . internal . statistic . event Log . Feature Usage Data Ċ import Ġcom . intellij . internal . statistic . event Log . Statistics Event Esc aper Ċ import Ġcom . intellij . internal . statistic . service . f us . collect ors . Project Usage s Collector Ċ import Ġcom . intellij . internal . statistic . utils . get Plugin Info Ċ import Ġcom . intellij . lang . Language Ċ import Ġcom . intellij . openapi . project . Project Ċ Ċ class ĠIn lay Provider Usage Collector Ġ: ĠProject Usage s Collector () Ġ{ ĊĠ Ġoverride Ġfun Ġget GroupId (): ĠString Ġ{ ĊĠĠĠ Ġreturn Ġ" in lay . configuration " ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Metrics ( project : ĠProject ): ĠMutable Set < Metric Event > Ġ{ ĊĠĠĠ Ġval Ġsettings Providers Ġ= ĠIn lay Settings Provider . EP . get Extensions () ĊĠĠĠ Ġval Ġmetric Events Ġ= Ġmutable Set Of < Metric Event >() ĊĠĠĠ Ġfor Ġ( settings Provider Ġin Ġsettings Providers ) Ġ{ ĊĠĠĠĠĠ Ġval Ġlanguages Ġ= Ġsettings Provider . get Supported Languages ( project ) ĊĠĠĠĠĠ Ġfor Ġ( language Ġin Ġlanguages ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġmodels Ġ= Ġsettings Provider . create Models ( project , Ġlanguage ) ĊĠĠĠĠĠĠĠ Ġfor Ġ( model Ġin Ġmodels ) Ġ{ ĊĠĠĠĠĠĠĠĠĠ Ġmetric Events . add ( getModel Event ( model , Ġlanguage )) ĊĠĠĠĠĠĠĠ Ġ} ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn Ġmetric Events ĊĠ Ġ} ĊĊĠ Ġprivate Ġfun ĠgetModel Event ( model : ĠIn lay Provider Settings Model , Ġlanguage : ĠLanguage ): ĠMetric Event Ġ{ ĊĠĠĠ Ġval Ġusage Data Ġ= ĠFeature Usage Data () ĊĠĠĠĠĠ Ġ. add Language ( language ) ĊĠĠĠĠĠ Ġ. addData (" enabled ", Ġmodel . isEnabled ) ĊĠĠĠĠĠ Ġ. add Plugin Info ( get Plugin Info ( model . java Class )) ĊĠĠĠ Ġfor Ġ( case Ġin Ġmodel . cases ) Ġ{ ĊĠĠĠĠĠ Ġusage Data . addData ( Statistics Event Esc aper . escape FieldName ( case . id ), Ġcase . value ) ĊĠĠĠ Ġ} ĊĠĠĠ Ġreturn ĠMetric Event ( model . id , Ġusage Data ) ĊĠ Ġ} ĊĊĠ Ġoverride Ġfun Ġget Version (): ĠInt Ġ{ ĊĠĠĠ Ġreturn Ġ 2 ĊĠ Ġ} Ċ }