3 | Initial alpha release.
4 | Supports
5 |
Each comes with different colors for light and dark editor schemes.
12 | -------------------------------------------------------------------------------- /change-notes/0_2_0.html: -------------------------------------------------------------------------------- 1 |
3 | Second alpha release.
4 | New features
5 |
3 | Third alpha release.
4 | New features
5 |
3 | Third alpha release.
4 | Fixes
5 |
3 | Third alpha release.
4 | Fixes
5 |
3 | Fourth alpha release.
4 | New features
5 |
3 | Fourth alpha release.
4 | New usability feature and bug fixes
5 |
3 | Fourth alpha release.
4 | Performance improvements
5 |
3 | Fourth alpha release.
4 | Performance improvements
5 |
3 | Fourth alpha release.
4 | Performance and usability improvements
5 |
3 | Fourth alpha release.
4 | Refactoring
5 |
3 | Fourth alpha release.
4 | Refactoring
5 |
3 | Fourth alpha release.
4 | Refactoring
5 |
3 | Fifth alpha release.
4 | New features
5 |
3 | Sixth alpha release.
4 | New features
5 |
3 | Sixth alpha release.
4 | Refactoring with bug fixes, and new features
5 |
3 | Sixth alpha release.
4 | Refactoring
5 |
3 | Seventh alpha release.
4 | New features
5 |
3 | Seventh alpha release.
4 | New features and refactoring
5 |
3 | Eighth alpha release.
4 | New features and refactoring
5 |
3 | Tenth alpha release.
4 | Build changes
5 |
3 | Eleventh alpha release.
4 | Fixes and build changes
5 |
3 | Twelfth alpha release.
4 |
5 | Fixes and build changes
6 |
2 | Highlight return statements.
3 | Useful for hard-to-read sources.
4 |
The plugin
7 |return
ing lines (clicking on it will take you to the return statement!)return
keyword, so that it stands out moreSupported languages are
13 |22 | Read the full description here at GitHub. 23 |
24 | -------------------------------------------------------------------------------- /settings.gradle.kts: -------------------------------------------------------------------------------- 1 | rootProject.name = "idea-return-highlighter" 2 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/java/JavaReturnHighlighterConfigurableGui.form: -------------------------------------------------------------------------------- 1 | 2 | 54 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/java/JavaReturnHighlighterConfigurableGui.java: -------------------------------------------------------------------------------- 1 | package com.github.lppedd.highlighter.java; 2 | 3 | import javax.swing.*; 4 | 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import com.github.lppedd.highlighter.ReturnHighlighterBundle; 8 | import com.intellij.ui.ContextHelpLabel; 9 | import com.intellij.ui.components.JBCheckBox; 10 | import com.intellij.ui.components.JBLabel; 11 | 12 | /** 13 | * @author Edoardo Luppi 14 | */ 15 | public class JavaReturnHighlighterConfigurableGui { 16 | private JPanel rootPanel; 17 | private JBLabel info; 18 | private JPanel skipSimpleGettersPanel; 19 | private JBCheckBox isOnlyTopLevelReturns; 20 | private JBCheckBox isSkipSimpleGetters; 21 | 22 | public JavaReturnHighlighterConfigurableGui(final ReturnHighlighterBundle bundle) { 23 | this(); 24 | finishUpComponents(bundle); 25 | } 26 | 27 | private JavaReturnHighlighterConfigurableGui() {} 28 | 29 | @NotNull 30 | public JPanel getRootPanel() { 31 | return rootPanel; 32 | } 33 | 34 | @NotNull 35 | public Boolean isOnlyTopLevelReturns() { 36 | return isOnlyTopLevelReturns.isSelected(); 37 | } 38 | 39 | @NotNull 40 | public Boolean isSkipSimpleGetters() { 41 | return isSkipSimpleGetters.isSelected(); 42 | } 43 | 44 | public void setOnlyTopLevelReturns(@NotNull final Boolean value) { 45 | isOnlyTopLevelReturns.setSelected(value); 46 | } 47 | 48 | public void setSkipSimpleGetters(@NotNull final Boolean value) { 49 | isSkipSimpleGetters.setSelected(value); 50 | } 51 | 52 | private void finishUpComponents(final ReturnHighlighterBundle bundle) { 53 | info.setText(bundle.get("rh.settings.custom.java")); 54 | isOnlyTopLevelReturns.setText(bundle.get("rh.settings.custom.java.topLevel")); 55 | isSkipSimpleGetters.setText(bundle.get("rh.settings.custom.java.simpleGetters")); 56 | 57 | final String simpleGettersTooltip = bundle.get("rh.settings.custom.java.simpleGetters.tooltip"); 58 | skipSimpleGettersPanel.add(ContextHelpLabel.create(simpleGettersTooltip)); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/javascript/JavaScriptReturnHighlighterConfigurableGui.form: -------------------------------------------------------------------------------- 1 | 2 | 56 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/javascript/JavaScriptReturnHighlighterConfigurableGui.java: -------------------------------------------------------------------------------- 1 | package com.github.lppedd.highlighter.javascript; 2 | 3 | import javax.swing.*; 4 | 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import com.github.lppedd.highlighter.ReturnHighlighterBundle; 8 | import com.intellij.ui.ContextHelpLabel; 9 | import com.intellij.ui.components.JBCheckBox; 10 | import com.intellij.ui.components.JBLabel; 11 | 12 | /** 13 | * @author Edoardo Luppi 14 | */ 15 | public class JavaScriptReturnHighlighterConfigurableGui { 16 | private JPanel rootPanel; 17 | private JBLabel info; 18 | private JPanel skipSimpleGettersPanel; 19 | private JBCheckBox isOnlyTopLevelReturns; 20 | private JBCheckBox isSkipSimpleGetters; 21 | 22 | public JavaScriptReturnHighlighterConfigurableGui(final ReturnHighlighterBundle bundle) { 23 | this(); 24 | finishUpComponents(bundle); 25 | } 26 | 27 | private JavaScriptReturnHighlighterConfigurableGui() {} 28 | 29 | @NotNull 30 | public JPanel getRootPanel() { 31 | return rootPanel; 32 | } 33 | 34 | @NotNull 35 | public Boolean isOnlyTopLevelReturns() { 36 | return isOnlyTopLevelReturns.isSelected(); 37 | } 38 | 39 | @NotNull 40 | public Boolean isSkipSimpleGetters() { 41 | return isSkipSimpleGetters.isSelected(); 42 | } 43 | 44 | public void setOnlyTopLevelReturns(@NotNull final Boolean value) { 45 | isOnlyTopLevelReturns.setSelected(value); 46 | } 47 | 48 | public void setSkipSimpleGetters(@NotNull final Boolean value) { 49 | isSkipSimpleGetters.setSelected(value); 50 | } 51 | 52 | private void finishUpComponents(final ReturnHighlighterBundle bundle) { 53 | info.setText(bundle.get("rh.settings.custom.javascript")); 54 | isOnlyTopLevelReturns.setText(bundle.get("rh.settings.custom.javascript.topLevel")); 55 | isSkipSimpleGetters.setText(bundle.get("rh.settings.custom.javascript.simpleGetters")); 56 | 57 | final String simpleGettersTooltip = 58 | bundle.get("rh.settings.custom.javascript.simpleGetters.tooltip"); 59 | skipSimpleGettersPanel.add(ContextHelpLabel.create(simpleGettersTooltip)); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/php/PhpReturnHighlighterConfigurableGui.form: -------------------------------------------------------------------------------- 1 | 2 | 41 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/php/PhpReturnHighlighterConfigurableGui.java: -------------------------------------------------------------------------------- 1 | package com.github.lppedd.highlighter.php; 2 | 3 | import javax.swing.*; 4 | 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import com.github.lppedd.highlighter.ReturnHighlighterBundle; 8 | import com.intellij.ui.components.JBCheckBox; 9 | import com.intellij.ui.components.JBLabel; 10 | 11 | /** 12 | * @author Edoardo Luppi 13 | */ 14 | public class PhpReturnHighlighterConfigurableGui { 15 | private JPanel rootPanel; 16 | private JBLabel info; 17 | private JBCheckBox isOnlyTopLevelReturns; 18 | 19 | public PhpReturnHighlighterConfigurableGui(final ReturnHighlighterBundle bundle) { 20 | this(); 21 | finishUpComponents(bundle); 22 | } 23 | 24 | private PhpReturnHighlighterConfigurableGui() {} 25 | 26 | @NotNull 27 | public JPanel getRootPanel() { 28 | return rootPanel; 29 | } 30 | 31 | @NotNull 32 | public Boolean isOnlyTopLevelReturns() { 33 | return isOnlyTopLevelReturns.isSelected(); 34 | } 35 | 36 | public void setOnlyTopLevelReturns(@NotNull final Boolean value) { 37 | isOnlyTopLevelReturns.setSelected(value); 38 | } 39 | 40 | private void finishUpComponents(final ReturnHighlighterBundle bundle) { 41 | info.setText(bundle.get("rh.settings.custom.php")); 42 | isOnlyTopLevelReturns.setText(bundle.get("rh.settings.custom.php.topLevel")); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/python/PythonReturnHighlighterConfigurableGui.form: -------------------------------------------------------------------------------- 1 | 2 | 41 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/python/PythonReturnHighlighterConfigurableGui.java: -------------------------------------------------------------------------------- 1 | package com.github.lppedd.highlighter.python; 2 | 3 | import javax.swing.*; 4 | 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import com.github.lppedd.highlighter.ReturnHighlighterBundle; 8 | import com.intellij.ui.components.JBCheckBox; 9 | import com.intellij.ui.components.JBLabel; 10 | 11 | /** 12 | * @author Edoardo Luppi 13 | */ 14 | public class PythonReturnHighlighterConfigurableGui { 15 | private JPanel rootPanel; 16 | private JBLabel info; 17 | private JBCheckBox isOnlyTopLevelReturns; 18 | 19 | public PythonReturnHighlighterConfigurableGui(@NotNull final ReturnHighlighterBundle bundle) { 20 | this(); 21 | finishUpComponents(bundle); 22 | } 23 | 24 | private PythonReturnHighlighterConfigurableGui() {} 25 | 26 | @NotNull 27 | public JPanel getRootPanel() { 28 | return rootPanel; 29 | } 30 | 31 | @NotNull 32 | public Boolean isOnlyTopLevelReturns() { 33 | return isOnlyTopLevelReturns.isSelected(); 34 | } 35 | 36 | public void setOnlyTopLevelReturns(@NotNull final Boolean value) { 37 | isOnlyTopLevelReturns.setSelected(value); 38 | } 39 | 40 | private void finishUpComponents(@NotNull final ReturnHighlighterBundle bundle) { 41 | info.setText(bundle.get("rh.settings.custom.python")); 42 | isOnlyTopLevelReturns.setText(bundle.get("rh.settings.custom.python.topLevel")); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/settings/ReturnHighlighterConfigurableGui.form: -------------------------------------------------------------------------------- 1 | 2 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/github/lppedd/highlighter/settings/ReturnHighlighterConfigurableGui.java: -------------------------------------------------------------------------------- 1 | package com.github.lppedd.highlighter.settings; 2 | 3 | import java.awt.*; 4 | 5 | import javax.swing.*; 6 | 7 | import org.jetbrains.annotations.NotNull; 8 | 9 | import com.github.lppedd.highlighter.ReturnHighlighterBundle; 10 | import com.intellij.ui.components.JBLabel; 11 | import com.intellij.util.ui.JBUI; 12 | import com.intellij.util.ui.JBUI.Borders; 13 | 14 | /** 15 | * @author Edoardo Luppi 16 | */ 17 | public class ReturnHighlighterConfigurableGui { 18 | private JPanel rootPanel; 19 | private JPanel listPanel; 20 | 21 | @NotNull 22 | public JPanel getRootPanel() { 23 | return rootPanel; 24 | } 25 | 26 | @NotNull 27 | public JPanel getListPanel() { 28 | return listPanel; 29 | } 30 | 31 | private void createUIComponents() { 32 | final JPanel rootPanel = new JPanel(); 33 | rootPanel.setLayout(new BorderLayout()); 34 | rootPanel.add( 35 | new JBLabel(ReturnHighlighterBundle.INSTANCE.get("rh.settings.custom.global")), 36 | BorderLayout.NORTH 37 | ); 38 | 39 | final JPanel listPanel = buildListPanel(); 40 | rootPanel.add(listPanel, BorderLayout.WEST); 41 | 42 | this.rootPanel = rootPanel; 43 | this.listPanel = listPanel; 44 | } 45 | 46 | private JPanel buildListPanel() { 47 | final JPanel listPanel = new JPanel(); 48 | listPanel.setLayout(new BoxLayout(listPanel, BoxLayout.Y_AXIS)); 49 | listPanel.setBorder(Borders.emptyLeft(10)); 50 | listPanel.add(Box.createRigidArea(JBUI.size(0, 10))); 51 | return listPanel; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/kotlin/com/github/lppedd/highlighter/AbstractReturnAnnotator.kt: -------------------------------------------------------------------------------- 1 | package com.github.lppedd.highlighter 2 | 3 | import com.intellij.lang.annotation.AnnotationHolder 4 | import com.intellij.lang.annotation.Annotator 5 | import com.intellij.lang.annotation.HighlightSeverity 6 | import com.intellij.openapi.editor.colors.EditorColorsManager 7 | import com.intellij.openapi.editor.colors.TextAttributesKey 8 | import com.intellij.psi.PsiElement 9 | 10 | /** 11 | * @author Edoardo Luppi 12 | */ 13 | abstract class AbstractReturnAnnotator\ 23 | Examples of simple getters:\ 24 |
\ 25 |\ 27 | \u0020boolean isEnabled() {35 | 36 | rh.settings.custom.javascript=Configure highlighting for JavaScript and TypeScript. 37 | rh.settings.custom.javascript.topLevel=Only top-level return keywords 38 | rh.settings.custom.javascript.simpleGetters=Skip simple getters 39 | rh.settings.custom.javascript.simpleGetters.tooltip=\ 40 |
\ 28 | \u0020\u0020\u0020return true;
\ 29 | \u0020}
\ 30 |
\ 31 | \u0020Long getId() {
\ 32 | \u0020\u0020\u0020return myField.id;
\ 33 | \u0020}\ 34 |
\ 41 | Examples of simple getters:\ 42 |
\ 43 |\ 45 | \u0020isEnabled(): boolean {53 | 54 | rh.settings.custom.php=Configure highlighting for PHP. 55 | rh.settings.custom.php.topLevel=Only top-level return keywords 56 | 57 | rh.settings.custom.python=Configure highlighting for Python. 58 | rh.settings.custom.python.topLevel=Only top-level return keywords 59 | -------------------------------------------------------------------------------- /src/main/resources/messages/ReturnHighlighterBundle_it_IT.properties: -------------------------------------------------------------------------------- 1 | rh.settings.javascript=JavaScript e TypeScript 2 | 3 | rh.settings.custom.noOptionsAvailable=Nessuna opzione disponibile al momento. 4 | 5 | rh.settings.custom.global=Configura l'evidenziazione per linguaggio specifico. 6 | rh.settings.custom.global.noLang=Nessun linguaggio supportato trovato nell'ambiente. 7 | 8 | rh.settings.custom.java=Configura l'evidenziazione per Java. 9 | rh.settings.custom.java.topLevel=Solo keyword return top-level 10 | rh.settings.custom.java.simpleGetters=Salta funzioni semplici 11 | rh.settings.custom.java.simpleGetters.tooltip=\ 12 |
\ 46 | \u0020\u0020\u0020return true;
\ 47 | \u0020}
\ 48 |
\ 49 | \u0020get id(): number {
\ 50 | \u0020\u0020\u0020return myField.id;
\ 51 | \u0020}\ 52 |
\ 13 | Esempi di funzioni semplici:\ 14 |
\ 15 |\ 17 | \u0020boolean isEnabled() {25 | 26 | 27 | rh.settings.custom.javascript=Configura l'evidenziazione per JavaScript e TypeScript. 28 | rh.settings.custom.javascript.topLevel=Solo keyword return top-level 29 | rh.settings.custom.javascript.simpleGetters=Salta funzioni semplici 30 | rh.settings.custom.javascript.simpleGetters.tooltip=\ 31 |
\ 18 | \u0020\u0020\u0020return true;
\ 19 | \u0020}
\ 20 |
\ 21 | \u0020Long getId() {
\ 22 | \u0020\u0020\u0020return myField.id;
\ 23 | \u0020}\ 24 |
\ 32 | Esempi di funzioni semplici:\ 33 |
\ 34 |\ 36 | \u0020isEnabled(): boolean {44 | 45 | rh.settings.custom.php=Configura l'evidenziazione per PHP. 46 | rh.settings.custom.php.topLevel=Solo keyword return top-level 47 | 48 | rh.settings.custom.python=Configura l'evidenziazione per Python. 49 | rh.settings.custom.python.topLevel=Solo keyword return top-level 50 | --------------------------------------------------------------------------------
\ 37 | \u0020\u0020\u0020return true;
\ 38 | \u0020}
\ 39 |
\ 40 | \u0020get id(): number {
\ 41 | \u0020\u0020\u0020return myField.id;
\ 42 | \u0020}\ 43 |