override fun getVendorDirectoriesInResolveScope()

in src/main/kotlin/org/jetbrains/tinygoplugin/services/TinyGoRootsProvider.kt [22:37]


    override fun getVendorDirectoriesInResolveScope(
        project: Project,
        module: Module?,
        file: VirtualFile?,
    ): MutableCollection<VirtualFile>? {
        val projectSettings = project.tinyGoConfiguration()
        if (file == null || module == null || !projectSettings.enabled) {
            return null
        }
        val cachedGoRoot = projectSettings.cachedGoRoot
        val cachedGoRootDir = cachedGoRoot.sdkRoot ?: return null
        if (VfsUtil.isAncestor(cachedGoRootDir, file, false)) {
            return mutableListOf(file.parent)
        }
        return null
    }