@@ -507,8 +507,10 @@ static CONFIG_FILE_NAME: &str = "course_config.toml";
507507
508508/// Checks if current directory or given path
509509/// contains valid exercise (i.e config file)
510- /// Returns Err(msg) if given invalid path (including root )
511- pub fn find_submit_or_paste_config (
510+ /// Returns Err(msg) if given invalid path (including root)
511+ /// Returns Ok(()) if no path given, but if current dir is not
512+ /// an exercise, leaves course_config as None
513+ pub fn find_course_config_for_exercise (
512514 exercise_slug : & mut String ,
513515 course_config : & mut Option < CourseConfig > ,
514516 exercise_dir : & mut PathBuf ,
@@ -581,7 +583,7 @@ pub fn read_new_course_config(course_config_path: &Path) -> Result<Option<Course
581583 }
582584}
583585
584- // retrieves exercise id for exercise from CourseConfig
586+ /// Retrieves exercise id for exercise from CourseConfig
585587pub fn get_exercise_id_from_config (
586588 course_config : & CourseConfig ,
587589 exercise_slug : & str ,
@@ -593,7 +595,7 @@ pub fn get_exercise_id_from_config(
593595 }
594596}
595597
596- // generates return_url for submissions and pastes
598+ /// Generates return_url for submissions and pastes
597599pub fn generate_return_url ( exercise_id : usize ) -> String {
598600 format ! (
599601 "{}/api/v8/core/exercises/{}/submissions" ,
@@ -609,7 +611,8 @@ pub fn get_projects_dir() -> PathBuf {
609611 tmc_langs:: get_projects_dir ( PLUGIN ) . unwrap ( )
610612}
611613
612- /// Gives a list of all courses in projects-folder
614+ /// Choose course and then exercise interactively, return exercise path
615+ /// or Err(String) if either menu is interrupted or no items found
613616pub fn choose_exercise ( ) -> Result < PathBuf , String > {
614617 let mut courses: Vec < String > = Vec :: new ( ) ;
615618
0 commit comments