本文整理匯總了Java中com.intellij.psi.PsiFile.acceptChildren方法的典型用法代碼示例。如果您正苦於以下問題:Java PsiFile.acceptChildren方法的具體用法?Java PsiFile.acceptChildren怎麽用?Java PsiFile.acceptChildren使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.intellij.psi.PsiFile
的用法示例。
在下文中一共展示了PsiFile.acceptChildren方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: analyzeFile
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
private ProblemsHolder analyzeFile(@NotNull PsiFile file, @NotNull InspectionManager manager, boolean isOnTheFly) {
DotEnvPsiElementsVisitor visitor = new DotEnvPsiElementsVisitor();
file.acceptChildren(visitor);
ProblemsHolder problemsHolder = new ProblemsHolder(manager, file, isOnTheFly);
Map<String, PsiElement> existingKeys = new HashMap<>();
Set<PsiElement> markedElements = new HashSet<>();
for(KeyValuePsiElement keyValue : visitor.getCollectedItems()) {
if(existingKeys.containsKey(keyValue.getKey())) {
problemsHolder.registerProblem(keyValue.getElement(), "Duplicate key");
PsiElement markedElement = existingKeys.get(keyValue.getKey());
if(!markedElements.contains(markedElement)) {
problemsHolder.registerProblem(markedElement, "Duplicate key");
markedElements.add(markedElement);
}
} else {
existingKeys.put(keyValue.getKey(), keyValue.getElement());
}
}
return problemsHolder;
}
示例2: getElements
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyValuePsiElement> getElements(PsiFile psiFile) {
if(psiFile instanceof YAMLFile) {
DockerComposeYamlPsiElementsVisitor visitor = new DockerComposeYamlPsiElementsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}
示例3: getElements
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyValuePsiElement> getElements(PsiFile psiFile) {
if(psiFile instanceof DockerPsiFile) {
DockerfilePsiElementsVisitor visitor = new DockerfilePsiElementsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}
示例4: getUsages
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyUsagePsiElement> getUsages(PsiFile psiFile) {
if(psiFile instanceof RFile) {
RubyEnvironmentCallsVisitor visitor = new RubyEnvironmentCallsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}
示例5: getUsages
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyUsagePsiElement> getUsages(PsiFile psiFile) {
if(psiFile instanceof PyFile) {
PythonEnvironmentCallsVisitor visitor = new PythonEnvironmentCallsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}
示例6: getElements
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyValuePsiElement> getElements(PsiFile psiFile) {
if(psiFile instanceof DotEnvFile) {
DotEnvPsiElementsVisitor visitor = new DotEnvPsiElementsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}
示例7: getUsages
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyUsagePsiElement> getUsages(PsiFile psiFile) {
if(psiFile instanceof JSFile) {
JsEnvironmentCallsVisitor visitor = new JsEnvironmentCallsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}
示例8: getUsages
import com.intellij.psi.PsiFile; //導入方法依賴的package包/類
@NotNull
@Override
public Collection<KeyUsagePsiElement> getUsages(PsiFile psiFile) {
if(psiFile instanceof PhpFile) {
PhpEnvironmentCallsVisitor visitor = new PhpEnvironmentCallsVisitor();
psiFile.acceptChildren(visitor);
return visitor.getCollectedItems();
}
return Collections.emptyList();
}