override fun accept()

in src/main/kotlin/org/jetbrains/tinygoplugin/preview/TinyGoPreviewFileEditorProvider.kt [31:39]


    override fun accept(project: Project, file: VirtualFile): Boolean {
        if (!JBCefApp.isSupported()) return false
        val isGoFile = FileTypeRegistry.getInstance().isFileOfType(file, GoFileType.INSTANCE)
        val tinyGoConfiguration = project.tinyGoConfiguration()
        val tinyGoEnabled = tinyGoConfiguration.enabled
        val targetSupported = tinyGoConfiguration.targetPlatform in service<PreviewTargetsProvider>().supportedTargets
        val isScratch = ScratchUtil.isScratch(file)
        return isGoFile && tinyGoEnabled && targetSupported && isScratch
    }