This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.lang.ASTNode | |
import com.intellij.lang.LanguageExtensionPoint | |
import com.intellij.lang.folding.CustomFoldingBuilder | |
import com.intellij.lang.folding.FoldingBuilder | |
import com.intellij.lang.folding.FoldingDescriptor | |
import com.intellij.lang.folding.LanguageFolding | |
import com.intellij.openapi.editor.Document | |
import com.intellij.openapi.extensions.DefaultPluginDescriptor | |
import com.intellij.openapi.extensions.PluginId | |
import com.intellij.openapi.project.DumbAware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.ui.EditorNotificationsImpl | |
import liveplugin.show | |
import org.jetbrains.kotlin.idea.highlighter.KotlinHighlightingSuspendNotificationProvider | |
// depends-on-plugin org.jetbrains.kotlin | |
EditorNotificationsImpl.EP_PROJECT.getPoint(project!!) | |
.unregisterExtension(KotlinHighlightingSuspendNotificationProvider::class.java) | |
if (!isIdeStartup) show("Disabled notification 'Highlighting is temporary suspended for file due to internal error'") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction | |
import com.intellij.openapi.editor.Editor | |
import com.intellij.openapi.project.Project | |
import com.intellij.psi.PsiElement | |
import com.intellij.psi.util.parentOfType | |
import com.intellij.sql.psi.SqlSelectStatement | |
import liveplugin.PluginUtil.openInBrowser | |
import liveplugin.editor | |
import liveplugin.registerAction | |
import liveplugin.registerIntention |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fun interface Action { | |
fun run() | |
} | |
fun schedule(action: Action) = action.run() | |
fun scheduleFun(action: () -> Unit) = action.invoke() | |
fun f(): Unit = println("foo") | |
fun main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.codeInsight.navigation.actions.GotoDeclarationHandler | |
import com.intellij.lang.LanguageAnnotators | |
import com.intellij.lang.LanguageExtensionPoint | |
import com.intellij.lang.annotation.Annotator | |
import com.intellij.lang.annotation.HighlightSeverity.INFORMATION | |
import com.intellij.openapi.application.ApplicationManager | |
import com.intellij.openapi.editor.Editor | |
import com.intellij.openapi.editor.colors.CodeInsightColors.INACTIVE_HYPERLINK_ATTRIBUTES | |
import com.intellij.openapi.extensions.DefaultPluginDescriptor | |
import com.intellij.openapi.util.TextRange |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.codeInspection.LocalQuickFix | |
import com.intellij.codeInspection.ProblemDescriptor | |
import com.intellij.codeInspection.ProblemHighlightType.WEAK_WARNING | |
import com.intellij.codeInspection.ProblemsHolder | |
import com.intellij.lang.ASTFactory | |
import com.intellij.openapi.project.Project | |
import com.intellij.psi.PsiElement | |
import com.intellij.psi.PsiElementVisitor | |
import com.intellij.psi.PsiWhiteSpace | |
import liveplugin.registerInspection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.codeInspection.LocalQuickFix | |
import com.intellij.codeInspection.ProblemDescriptor | |
import com.intellij.codeInspection.ProblemsHolder | |
import com.intellij.openapi.project.Project | |
import com.intellij.psi.PsiClass | |
import com.intellij.psi.PsiElementVisitor | |
import com.intellij.psi.PsiEnumConstant | |
import com.intellij.psi.util.parentOfType | |
import liveplugin.registerInspection | |
import liveplugin.show |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.execution.filters.ConsoleInputFilterProvider | |
import com.intellij.execution.filters.InputFilter | |
import com.intellij.execution.ui.ConsoleViewContentType | |
import com.intellij.openapi.Disposable | |
import com.intellij.openapi.extensions.Extensions | |
import com.intellij.openapi.extensions.LoadingOrder | |
import com.intellij.openapi.project.Project | |
import com.intellij.openapi.util.Pair | |
import org.jetbrains.annotations.NotNull |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.natpryce.hamkrest.assertion.assertThat | |
import com.natpryce.hamkrest.equalTo | |
import org.junit.Test | |
/* | |
* The promotion service calculates discounts for promoted items. | |
* (It's a bit crazy because it's also reducing the tax 🙄) | |
* The Item class is classic DTO and its fields are not encapsulated. | |
* | |
* Make Item a rich object and encapsulate its fields 💪 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.intellij.execution.ExecutionException | |
import com.intellij.execution.configurations.GeneralCommandLine | |
import com.intellij.execution.configurations.PathEnvironmentVariableUtil | |
import com.intellij.execution.process.ProcessOutput | |
import com.intellij.execution.util.ExecUtil | |
import com.intellij.ide.actions.CreateDesktopEntryAction | |
import com.intellij.ide.actions.CreateLauncherScriptAction | |
import com.intellij.openapi.application.ApplicationBundle | |
import com.intellij.openapi.application.ApplicationNamesInfo | |
import com.intellij.openapi.application.PathManager |