def activate_project(window):
		if ProjectManager.active:
			# fetch project
			ProjectManager.current_project = ProjectManager.get_project(window)
			CurrentFile.evaluate_current(window.active_view(), ProjectManager.get_current_project())

			if ProjectManager.has_current_project():
				# update project settings
				project_settings = Settings.project(window)
				ProjectManager.get_current_project().update_settings(ProjectManager.ffp_settings, project_settings)
				verbose(ID, "activate project", ProjectManager.get_current_project().get_directory())
		else:
			verbose(ID, "this is not a project")
Example #2
0
    def on_query_completions(self, view, prefix, locations):
        if config["DISABLE_AUTOCOMPLETION"] and not Query.by_command():
            return False

        if self.track_insert["active"] is False:
            self.start_tracking(view)

        if CurrentFile.is_valid():
            verbose(ID, "-> query completions")
            completions = FuzzyFilePath.on_query_completions(view, CurrentFile.get_project_directory(), CurrentFile.get_directory())
            if completions is not False:
                return completions

        self.finish_tracking(view)
        return False
 def on_activated(self, view):
     # view has gained focus
     CurrentFile.evaluate_current(view,
                                  ProjectManager.get_current_project())
 def on_post_save_async(self, view):
     if CurrentFile.is_temp():
         verbose(ID, "temp file saved, reevaluate")
         CurrentFile.cache[view.id()] = None
         ProjectManager.rebuild_filecache()
         self.on_activated(view)
 def on_activated(self, view):
     # view has gained focus
     CurrentFile.evaluate_current(view, ProjectManager.get_current_project())
 def on_post_save_async(self, view):
     if CurrentFile.is_temp():
         verbose(ID, "temp file saved, reevaluate")
         CurrentFile.cache[view.id()] = None
         ProjectManager.rebuild_filecache()
         self.on_activated(view)