Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/glua_doc_cli/src/cmd_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ pub struct CmdArgs {
/// Verbose output
#[arg(long)]
pub verbose: bool,

/// Path to GMod annotations directory
#[arg(long)]
pub gmod_annotations: Option<PathBuf>,
}

#[derive(Debug, Clone, Eq, PartialEq, ValueEnum)]
Expand Down
19 changes: 19 additions & 0 deletions crates/glua_doc_cli/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ pub fn load_workspace(
config_paths: Option<Vec<PathBuf>>,
exclude_pattern: Option<Vec<String>>,
include_pattern: Option<Vec<String>>,
gmod_annotations: Option<PathBuf>,
) -> Result<EmmyLuaAnalysis, Box<dyn Error>> {
let (config_files, config_root): (Vec<PathBuf>, PathBuf) =
if let Some(config_paths) = config_paths {
Expand All @@ -88,6 +89,24 @@ pub fn load_workspace(
config_root.display()
);
emmyrc.pre_process_emmyrc(&config_root);

if let Some(annotations_path) = gmod_annotations {
if annotations_path.is_dir() {
log::info!(
"Adding GMod annotations from: {}",
annotations_path.display()
);
emmyrc.prioritize_gmod_annotations_library(
annotations_path.to_string_lossy().into_owned(),
Comment thread
AmyJeanes marked this conversation as resolved.
);
} else {
log::warn!(
"GMod annotations path is not an existing directory: {}",
annotations_path.display()
);
}
}

let mut workspace_folders = cmd_workspace_folders
.iter()
.map(|p| WorkspaceFolder::new(p.clone(), false))
Expand Down
1 change: 1 addition & 0 deletions crates/glua_doc_cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub fn run_doc_cli(mut cmd_args: CmdArgs) -> Result<(), Box<dyn std::error::Erro
config_paths,
cmd_args.exclude_pattern,
cmd_args.include_pattern,
cmd_args.gmod_annotations,
)?;

match cmd_args.output_format {
Expand Down