summaryrefslogtreecommitdiff
path: root/cli/doc/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/doc/function.rs')
-rw-r--r--cli/doc/function.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/cli/doc/function.rs b/cli/doc/function.rs
index e8abf56f9..ede8bdbbd 100644
--- a/cli/doc/function.rs
+++ b/cli/doc/function.rs
@@ -1,5 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
use super::params::pat_to_param_def;
+use super::parser::DocParser;
use super::ts_type::ts_type_ann_to_def;
use super::ts_type::TsTypeDef;
use super::ts_type_param::maybe_type_param_decl_to_type_param_defs;
@@ -20,12 +21,14 @@ pub struct FunctionDef {
}
pub fn function_to_function_def(
+ doc_parser: &DocParser,
function: &swc_ecma_ast::Function,
) -> FunctionDef {
let mut params = vec![];
for param in &function.params {
- let param_def = pat_to_param_def(&param.pat);
+ let param_def =
+ pat_to_param_def(&param.pat, Some(&doc_parser.ast_parser.source_map));
params.push(param_def);
}
@@ -47,9 +50,10 @@ pub fn function_to_function_def(
}
pub fn get_doc_for_fn_decl(
+ doc_parser: &DocParser,
fn_decl: &swc_ecma_ast::FnDecl,
) -> (String, FunctionDef) {
let name = fn_decl.ident.sym.to_string();
- let fn_def = function_to_function_def(&fn_decl.function);
+ let fn_def = function_to_function_def(&doc_parser, &fn_decl.function);
(name, fn_def)
}