1+ /*
2+ * Copyright (c) 2017. tangzx([email protected] ) 3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * http://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ package com.tang.intellij.lua.project
18+
19+ import com.intellij.openapi.project.Project
20+ import com.intellij.openapi.vfs.VfsUtil
21+ import com.intellij.openapi.vfs.VirtualFile
22+ import com.intellij.util.indexing.IndexableSetContributor
23+ import com.tang.intellij.lua.psi.LuaFileUtil
24+ import java.io.File
25+
26+ /* *
27+ *
28+ * Created by Administrator on 2017/7/5.
29+ */
30+ class LuaPredefinedLibraryProvider : IndexableSetContributor () {
31+
32+ /* override fun getAdditionalProjectRootsToIndex(project: Project): MutableSet<VirtualFile> {
33+ val dir = LuaFileUtil.getPluginVirtualFile("std")
34+ val file = VfsUtil.findFileByIoFile(File(dir), false)
35+ val list = mutableSetOf<VirtualFile>()
36+ list.add(file!!)
37+ return list
38+ }*/
39+
40+ override fun getAdditionalRootsToIndex (): Set <VirtualFile > {
41+ val dir = LuaFileUtil .getPluginVirtualFile(" std" )
42+ val file = VfsUtil .findFileByIoFile(File (dir), false )
43+ val set = mutableSetOf<VirtualFile >()
44+ set.add(file!! )
45+ return set
46+ }
47+ }
0 commit comments