Record file language in completion tracker to track completion in injected code (FUS-1096)

GitOrigin-RevId: ae40e7065c7de34731017167719afa0e7580f4b3
This commit is contained in:
Dmitry Jemerov
2021-07-12 16:28:54 +00:00
committed by intellij-monorepo-bot
parent 2ae955aa2c
commit 7907247aee

View File

@@ -1,4 +1,4 @@
// Copyright 2000-2020 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.
// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
package com.intellij.codeInsight.lookup.impl;
import com.intellij.codeInsight.completion.BaseCompletionService;
@@ -15,7 +15,6 @@ import com.intellij.internal.statistic.utils.PluginInfo;
import com.intellij.internal.statistic.utils.PluginInfoDetectorKt;
import com.intellij.lang.Language;
import com.intellij.openapi.project.DumbService;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiUtilCore;
@@ -119,6 +118,7 @@ final class LookupUsageTracker {
data.addLanguage(myLanguage);
PsiFile file = myLookup.getPsiFile();
if (file != null) {
data.addCurrentFile(file.getLanguage());
VirtualFile vFile = file.getVirtualFile();
if (vFile != null) {
String schema = FileTypeUsageCounterCollector.findSchema(myLookup.getProject(), vFile);