File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -635,17 +635,20 @@ def is_project_open(project):
635
635
def is_javascript_project ():
636
636
project_file_name = sublime .active_window ().project_file_name ()
637
637
project_dir_name = ""
638
- if project_file_name :
638
+ if project_file_name :
639
639
project_dir_name = os .path .dirname (project_file_name )
640
640
settings_dir_name = os .path .join (project_dir_name , PROJECT_SETTINGS_FOLDER_NAME )
641
- return os .path .isdir (settings_dir_name )
642
- else :
643
- # try to look at window.folders()
644
- folders = sublime .active_window ().folders ()
645
- if len (folders ) > 0 :
646
- folders = folders [0 ]
647
- settings_dir_name = os .path .join (folders , PROJECT_SETTINGS_FOLDER_NAME )
648
- return os .path .isdir (settings_dir_name )
641
+ if os .path .isdir (settings_dir_name ):
642
+ return True
643
+
644
+ # If not found at the location of the .sublime-project file, try to look in the open folders.
645
+ folders = sublime .active_window ().folders ()
646
+ if len (folders ) > 0 :
647
+ folders = folders [0 ]
648
+ settings_dir_name = os .path .join (folders , PROJECT_SETTINGS_FOLDER_NAME )
649
+ if os .path .isdir (settings_dir_name ):
650
+ return True
651
+
649
652
return False
650
653
651
654
def is_type_javascript_project (type ):
You can’t perform that action at this time.
0 commit comments