@@ -57,7 +57,8 @@ define(function (require, exports, module) {
5757 PanelTemplate = require ( "text!htmlContent/problems-panel.html" ) ,
5858 ResultsTemplate = require ( "text!htmlContent/problems-panel-table.html" ) ,
5959 Mustache = require ( "thirdparty/mustache/mustache" ) ,
60- QuickViewManager = require ( "features/QuickViewManager" ) ;
60+ QuickViewManager = require ( "features/QuickViewManager" ) ,
61+ Metrics = require ( "utils/Metrics" ) ;
6162
6263 const CODE_INSPECTION_GUTTER_PRIORITY = 500 ,
6364 CODE_INSPECTION_GUTTER = "code-inspection-gutter" ;
@@ -549,6 +550,7 @@ define(function (require, exports, module) {
549550 <br/>
550551 </div>` ) ;
551552 $problemView . find ( ".fix-problem-btn" ) . click ( ( ) => {
553+ Metrics . countEvent ( Metrics . EVENT_TYPE . LINT , "fixClick" , "quickView" ) ;
552554 scrollToProblem ( pos . line ) ;
553555 _fixProblem ( fixID ) ;
554556 } ) ;
@@ -580,6 +582,7 @@ define(function (require, exports, module) {
580582 }
581583 }
582584 if ( quickViewPresent ) {
585+ Metrics . countEvent ( Metrics . EVENT_TYPE . LINT , "quickView" , "shown" ) ;
583586 resolve ( {
584587 start : startPos ,
585588 end : endPos ,
@@ -1090,8 +1093,10 @@ define(function (require, exports, module) {
10901093 const editor = EditorManager . getCurrentFullEditor ( ) ;
10911094 const maxOffset = editor . document . getText ( ) . length ;
10921095 if ( ! editor || ! fixDetails || editor . document . lastChangeTimestamp !== lastDocumentScanTimeStamp ) {
1096+ Metrics . countEvent ( Metrics . EVENT_TYPE . LINT , "fixFail" , "dialogShown" ) ;
10931097 Dialogs . showErrorDialog ( Strings . CANNOT_FIX_TITLE , Strings . CANNOT_FIX_MESSAGE ) ;
10941098 } else if ( _isInvalidFix ( fixDetails , maxOffset ) ) {
1099+ Metrics . countEvent ( Metrics . EVENT_TYPE . LINT , "fixFail" , "invalid" ) ;
10951100 console . error ( "Invalid fix:" , fixDetails ) ; // this should never happen as we filter the fix while inserting
10961101 } else {
10971102 const from = editor . posFromIndex ( fixDetails . rangeOffset . start ) ,
@@ -1139,7 +1144,10 @@ define(function (require, exports, module) {
11391144 problemsPanel = WorkspaceManager . createBottomPanel ( "errors" , $ ( panelHtml ) , 100 ) ;
11401145 $problemsPanel = $ ( "#problems-panel" ) ;
11411146 $fixAllBtn = $problemsPanel . find ( ".problems-fix-all-btn" ) ;
1142- $fixAllBtn . click ( _fixAllProblems ) ;
1147+ $fixAllBtn . click ( ( ) => {
1148+ Metrics . countEvent ( Metrics . EVENT_TYPE . LINT , "fixAllClick" , "panel" ) ;
1149+ _fixAllProblems ( ) ;
1150+ } ) ;
11431151
11441152 function checkSelectionInsideElement ( range , element ) {
11451153 if ( ! range || range . endOffset === range . startOffset ) {
@@ -1169,6 +1177,7 @@ define(function (require, exports, module) {
11691177 }
11701178 if ( $ ( e . target ) . hasClass ( 'ph-fix-problem' ) ) {
11711179 // Retrieve the message from the data attribute of the clicked element
1180+ Metrics . countEvent ( Metrics . EVENT_TYPE . LINT , "fixClick" , "panel" ) ;
11721181 _fixProblem ( "" + $ ( e . target ) . data ( "fixid" ) ) ;
11731182 e . preventDefault ( ) ;
11741183 e . stopPropagation ( ) ;
0 commit comments