void (char c, @NotNull DataContext dataContext) { if (!StatisticsUploadAssistant.isCollectAllowedOrForced()) return; EventRateThrottleResult result = ourThrottle.tryPass(System.currentTimeMillis()); Project project = CommonDataKeys.PROJECT.getData(dataContext); if (result == EventRateThrottleResult.ACCEPT) { ArrayList<EventPair<?>> pairs = new ArrayList<>(3); Editor editor = CommonDataKeys.EDITOR.getData(dataContext); if (editor != null) { try { pairs.add(EDITOR_KIND.with(editor.getEditorKind())); } catch (UnsupportedOperationException e) { // See com.intellij.openapi.editor.impl.ImaginaryEditor } } ToolWindow toolWindow = PlatformDataKeys.TOOL_WINDOW.getData(dataContext); if (toolWindow != null) { pairs.add(TOOL_WINDOW.with(toolWindow.getId())); } FileEditor fileEditor = PlatformCoreDataKeys.FILE_EDITOR.getData(dataContext); if (fileEditor != null) { VirtualFile virtualFile = fileEditor.getFile(); if (virtualFile != null) { FileType fileType = FileTypeRegistry.getInstance().getFileTypeByFileName(virtualFile.getNameSequence()); if (fileType instanceof LanguageFileType) { pairs.add(EventFields.Language.with(((LanguageFileType)fileType).getLanguage())); } } } TYPED.log(project, pairs); } else if (result == EventRateThrottleResult.DENY_AND_REPORT) { TOO_MANY_EVENTS.log(project); } }