From cf6f24e8da9d5cf4b5bd431ff8c8d2742ac147d6 Mon Sep 17 00:00:00 2001 From: Sergey Svistunov Date: Fri, 26 Mar 2021 16:36:02 +0300 Subject: [PATCH] Allow find usages of controller xml file Resolve database table references in joins (in object xml files) Add comments to reference classes in Java code --- resources/META-INF/plugin.xml | 5 +++-- .../XmlReferenceProvider.java | 2 +- .../reference/DataViewReference.java | 7 ++++++- .../reference/DatasourceMethodReference.java | 6 ++++++ .../reference/DbFieldReference.java | 11 +++++++++++ .../reference/DbSchemaReference.java | 7 +++++++ .../reference/DbTableReference.java | 7 +++++++ .../reference/InterfaceMethodReference.java | 7 +++++++ .../reference/InterfaceReference.java | 8 ++++++++ .../reference/PhpGuideReference.java | 6 ++++++ .../reference/PhpObjectReference.java | 7 +++++++ .../reference/StaticDataSourceReference.java | 7 +++++++ .../reference/UserRightsAliasReference.java | 6 ++++++ .../reference/XmlControllerReference.java | 18 ++++++++++++++++++ .../reference/XmlFormReference.java | 7 +++++++ .../reference/XmlGuideReference.java | 7 +++++++ .../reference/XmlObjectReference.java | 7 +++++++ 17 files changed, 121 insertions(+), 4 deletions(-) diff --git a/resources/META-INF/plugin.xml b/resources/META-INF/plugin.xml index b3463f7..edf8300 100644 --- a/resources/META-INF/plugin.xml +++ b/resources/META-INF/plugin.xml @@ -1,7 +1,7 @@ com.zenden2k.VfFrameworkIdeaPlugin Vf Framework IDEA Integration - 1.6.0 + 1.6.1 Sergey Svistunov + - Resolve database table references in joins (in object xml files) ]]> diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/XmlReferenceProvider.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/XmlReferenceProvider.java index 085adb3..8fe0f41 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/XmlReferenceProvider.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/XmlReferenceProvider.java @@ -178,7 +178,7 @@ else if (name.equals("interface") && parentName.equals("button")) { range.getStartOffset() + match.getStartPos() + match.getLength()), project, null)); } return referenceList.toArray(new PsiReference[0]); - } else if (enableDataBaseReferences && name.equals("table") && parentName.equals("object")) { + } else if (enableDataBaseReferences && ( name.equals("table") && (parentName.equals("object") || parentName.equals("join")))) { // Reference to database table // TODO: use DbTableNameInfo class String[] tokens = attrValue.split("\\s+"); diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DataViewReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DataViewReference.java index 4a4f160..ac995eb 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DataViewReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DataViewReference.java @@ -11,7 +11,12 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; - +/* + * Reference to smarty file from dataview table field + * + * Example: + * + */ public class DataViewReference extends PsiReferenceBase { protected final Project project; protected final String viewName; diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DatasourceMethodReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DatasourceMethodReference.java index 9ca8359..5518200 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DatasourceMethodReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DatasourceMethodReference.java @@ -12,6 +12,12 @@ import java.util.Collection; +/* + Reference to an object's method. + + Example: + + */ public class DatasourceMethodReference extends PsiReferenceBase { protected final PsiElement element; protected final Project project; diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbFieldReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbFieldReference.java index 9b974b7..3cbc8e0 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbFieldReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbFieldReference.java @@ -13,6 +13,17 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/* + * Reference to database table field + * + * Example: + * + * + * + * + * + * + */ public class DbFieldReference extends PsiReferenceBase { protected final PsiElement element; protected final TextRange textRange; diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbSchemaReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbSchemaReference.java index 424dfb2..9d83a08 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbSchemaReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbSchemaReference.java @@ -8,6 +8,13 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/* + * Reference to database schema + * + * Example: + * + * + */ public class DbSchemaReference extends PsiReferenceBase { protected final PsiElement element; protected final TextRange textRange; diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbTableReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbTableReference.java index b1fff22..ceb7e16 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbTableReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/DbTableReference.java @@ -12,6 +12,13 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +/* + * Reference to database table + * + * Example: + * + * + */ public class DbTableReference extends PsiReferenceBase { protected final PsiElement element; protected final TextRange textRange; diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceMethodReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceMethodReference.java index 94c0805..32ca0c5 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceMethodReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceMethodReference.java @@ -10,6 +10,13 @@ import java.util.Collection; +/* + Reference to object's method from an interface + + Example: + + + */ public class InterfaceMethodReference extends PsiReferenceBase { protected final PsiElement element; protected final Project project; diff --git a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceReference.java b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceReference.java index 9afb726..3eff119 100644 --- a/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceReference.java +++ b/src/main/java/com/zenden2k/VfFrameworkIdeaPlugin/reference/InterfaceReference.java @@ -13,6 +13,14 @@ import java.util.ArrayList; +/* + Reference to an interface + + Example: + +