File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
src/com/magento/idea/magento2plugin Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,12 @@ public void update(final AnActionEvent event) {
9191 .execute ((PsiDirectory ) psiElement , project );
9292 if (moduleName == null ) {
9393 final String sourceDirPath = ((PsiDirectory ) psiElement ).getVirtualFile ().getPath ();
94+ final boolean isCustomCodeSourceDirValid =
95+ MagentoBasePathUtil .isCustomCodeSourceDirValid (sourceDirPath );
96+ final boolean isCustomVendorDirValid =
97+ MagentoBasePathUtil .isCustomVendorDirValid (sourceDirPath );
9498
95- if (!MagentoBasePathUtil .isCustomCodeSourceDirValid (sourceDirPath )
96- && !MagentoBasePathUtil .isCustomVendorDirValid (sourceDirPath )) {
99+ if (!isCustomCodeSourceDirValid && !isCustomVendorDirValid ) {
97100 event .getPresentation ().setVisible (false );
98101 return ;
99102 }
Original file line number Diff line number Diff line change 2424import com .magento .idea .magento2plugin .indexes .ModuleIndex ;
2525import com .magento .idea .magento2plugin .magento .files .ComposerJson ;
2626import com .magento .idea .magento2plugin .magento .packages .Licenses ;
27- import com .magento .idea .magento2plugin .magento .packages .Package ;
2827import com .magento .idea .magento2plugin .project .Settings ;
2928import com .magento .idea .magento2plugin .util .CamelCaseToHyphen ;
3029import com .magento .idea .magento2plugin .util .magento .MagentoBasePathUtil ;
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ public static boolean isMagentoFolderValid(final String path) {
5151 public static boolean isCustomVendorDirValid (final @ NotNull String path ) {
5252 final String [] pathParts = path .split (Package .V_FILE_SEPARATOR );
5353
54- if (pathParts .length < 3 ) {
54+ if (pathParts .length < 3 ) { //NOPMD
5555 return false ;
5656 }
5757
@@ -76,7 +76,7 @@ public static boolean isCustomVendorDirValid(final @NotNull String path) {
7676 public static boolean isCustomCodeSourceDirValid (final @ NotNull String path ) {
7777 final String [] pathParts = path .split (Package .V_FILE_SEPARATOR );
7878
79- if (pathParts .length < 2 ) {
79+ if (pathParts .length < 2 ) { //NOPMD
8080 return false ;
8181 }
8282
You can’t perform that action at this time.
0 commit comments