in src/main/java/lt/martynassateika/idea/codeigniter/language/LanguageFileIndex.java [103:127]
public Map<String, Void> map(@NotNull FileContent fileContent) {
VirtualFile file = fileContent.getFile();
PsiManager psiManager = PsiManager.getInstance(fileContent.getProject());
PsiFile psiFile = psiManager.findFile(file);
if (psiFile instanceof PhpFile) {
if (CiLanguageUtil.isLanguageFile((PhpFile) psiFile)) {
Map<String, Void> map = new HashMap<>();
psiFile.accept(new PhpRecursiveElementVisitor() {
@Override
public void visitPhpArrayAccessExpression(ArrayAccessExpression expression) {
ArrayIndex index = expression.getIndex();
if (index != null) {
PhpPsiElement value = index.getValue();
if (value instanceof StringLiteralExpression) {
String text = ((StringLiteralExpression) value).getContents();
map.put(text, null);
}
}
}
});
return map;
}
}
return Collections.emptyMap();
}