forked from magento/magento2-phpstorm-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLibJsIndex.java
36 lines (30 loc) · 1.07 KB
/
LibJsIndex.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
package com.magento.idea.magento2plugin.indexes;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.search.GlobalSearchScope;
import com.intellij.util.indexing.FileBasedIndex;
import com.magento.idea.magento2plugin.stubs.indexes.js.MagentoLibJsIndex;
import org.jetbrains.annotations.NotNull;
import java.util.Collection;
public class LibJsIndex {
private static LibJsIndex INSTANCE;
private LibJsIndex() {
}
public static LibJsIndex getInstance() {
if (null == INSTANCE) {
INSTANCE = new LibJsIndex();
}
return INSTANCE;
}
public Collection<VirtualFile> getLibJsFiles(@NotNull String filePath, @NotNull Project project) {
return FileBasedIndex.getInstance()
.getContainingFiles(MagentoLibJsIndex.KEY,
filePath.replace("'", ""),
GlobalSearchScope.allScope(project)
);
}
}