Skip to content

Commit

Permalink
fix: fix config no wkring issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Feb 25, 2021
1 parent a13ac78 commit c747833
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions plugins/coco_struct_analysis/src/struct_analysis_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use core_model::url_format::uri_to_path;
use core_model::{url_format, CocoConfig, Settings};
use ignore::Walk;

use std::path::PathBuf;
use std::{fs, str};
use structopt::StructOpt;

Expand All @@ -11,18 +12,26 @@ use crate::ctags_opt::Opt;
use crate::ctags_parser::CtagsParser;

pub fn execute_struct_analysis(config: CocoConfig) {
for repo in config.repos {
for repo in &config.repos {
let url_str = repo.url.as_str();

let origin_files = files_from_path(url_str);
let thread = count_thread(&origin_files);

let mut opt = build_opt(thread);

if let Some(langs) = repo.languages {
if let Some(langs) = &repo.languages {
opt.languages = Some(langs.join(","));
}

if let Some(configs) = config.get_plugin_config("struct_analysis") {
for config in &configs {
if config.key == "ctags" {
opt.bin_ctags = PathBuf::from(config.value.clone());
}
}
}

let files = files_by_thread(origin_files, &opt);
let classes = run_ctags(&opt, &files);

Expand Down

0 comments on commit c747833

Please sign in to comment.