Search in sources :

Example 11 with StatisticsInfo

use of com.intellij.psi.statistics.StatisticsInfo in project intellij-community by JetBrains.

the class LastSelectedPropertiesFileStore method saveLastSelectedPropertiesFile.

public void saveLastSelectedPropertiesFile(PsiFile context, PropertiesFile file) {
    VirtualFile virtualFile = context.getVirtualFile();
    if (virtualFile instanceof VirtualFileWindow) {
        virtualFile = ((VirtualFileWindow) virtualFile).getDelegate();
    }
    assert virtualFile != null;
    String contextUrl = virtualFile.getUrl();
    final VirtualFile vFile = file.getVirtualFile();
    if (vFile != null) {
        String url = vFile.getUrl();
        lastSelectedUrls.put(contextUrl, url);
        VirtualFile containingDir = virtualFile.getParent();
        lastSelectedUrls.put(containingDir.getUrl(), url);
        lastSelectedFileUrl = url;
        StatisticsManager.getInstance().incUseCount(new StatisticsInfo(PROPERTIES_FILE_STATISTICS_KEY, FileUtil.toSystemDependentName(VfsUtilCore.urlToPath(url))));
    }
}
Also used : VirtualFile(com.intellij.openapi.vfs.VirtualFile) StatisticsInfo(com.intellij.psi.statistics.StatisticsInfo) VirtualFileWindow(com.intellij.injected.editor.VirtualFileWindow)

Aggregations

StatisticsInfo (com.intellij.psi.statistics.StatisticsInfo)11 VirtualFileWindow (com.intellij.injected.editor.VirtualFileWindow)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 PsiElement (com.intellij.psi.PsiElement)1 StatisticsManager (com.intellij.psi.statistics.StatisticsManager)1 ProximityLocation (com.intellij.psi.util.ProximityLocation)1 DocCommentPolicy (com.intellij.refactoring.util.DocCommentPolicy)1 MemberInfo (com.intellij.refactoring.util.classMembers.MemberInfo)1 RelativePoint (com.intellij.ui.awt.RelativePoint)1 GrMemberInfo (org.jetbrains.plugins.groovy.refactoring.classMembers.GrMemberInfo)1