From a6cc19c8d35dbb9da888b7b2b2bedc7948df3ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vojt=C4=9Bch=20Kr=C3=A1sa?= Date: Fri, 12 May 2023 17:52:37 +0200 Subject: [PATCH] Code Highlighting for preprocessor code #389 --- .../org/plantuml/idea/lang/annotator/LanguageDescriptor.java | 4 +++- .../idea/lang/annotator/PlantUmlExternalAnnotator.java | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/plantuml/idea/lang/annotator/LanguageDescriptor.java b/src/main/java/org/plantuml/idea/lang/annotator/LanguageDescriptor.java index f69e547..ea4472b 100644 --- a/src/main/java/org/plantuml/idea/lang/annotator/LanguageDescriptor.java +++ b/src/main/java/org/plantuml/idea/lang/annotator/LanguageDescriptor.java @@ -225,7 +225,9 @@ public enum LanguageDescriptor { "dotted", "dashed", "bold", - "map" + "map", + "function", + "procedure" )); public final List pluginSettingsPattern = Collections.unmodifiableList(Arrays.asList( diff --git a/src/main/java/org/plantuml/idea/lang/annotator/PlantUmlExternalAnnotator.java b/src/main/java/org/plantuml/idea/lang/annotator/PlantUmlExternalAnnotator.java index 443e6f4..da12a95 100644 --- a/src/main/java/org/plantuml/idea/lang/annotator/PlantUmlExternalAnnotator.java +++ b/src/main/java/org/plantuml/idea/lang/annotator/PlantUmlExternalAnnotator.java @@ -35,7 +35,8 @@ public class PlantUmlExternalAnnotator extends ExternalAnnotator proceduresSet = new HashSet<>(); @@ -124,6 +126,7 @@ public void annotateByLine(SourceAnnotationResult result, String source) { if (plantUmlSettings.isKeywordHighlighting()) { highlightKeywords(result, keywords, types, keywords2, offset, line); highlightCustomProcedureDefinitions(result, offset, line, procedures, proceduresSet); + highlightCustomProcedureDefinitions(result, offset, line, customFunctions, proceduresSet); } annotate(result, line, offset, null, DefaultLanguageHighlighterColors.KEYWORD, pluginSettings); // annotate(result, line, offset, null, DefaultLanguageHighlighterColors.KEYWORD, preproc); //not needed