From a044a3ab1819df2c817dbfc39535a1b5427f2b1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20Zi=C4=99tkiewicz?= Date: Wed, 31 May 2023 11:27:26 +0200 Subject: [PATCH] Resolve comments --- lib/contexted/delegator.ex | 4 ++-- lib/contexted/module_analyzer.ex | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/contexted/delegator.ex b/lib/contexted/delegator.ex index 8f48f5f..54a3a2c 100644 --- a/lib/contexted/delegator.ex +++ b/lib/contexted/delegator.ex @@ -55,8 +55,8 @@ defmodule Contexted.Delegator do module end - functions_docs = ModuleAnalyzer.get_function_docs(module) - functions_specs = ModuleAnalyzer.get_module_specs(module) + functions_docs = ModuleAnalyzer.get_functions_docs(module) + functions_specs = ModuleAnalyzer.get_functions_specs(module) # Get the module's public functions functions = diff --git a/lib/contexted/module_analyzer.ex b/lib/contexted/module_analyzer.ex index 5a79e31..c17a0ca 100644 --- a/lib/contexted/module_analyzer.ex +++ b/lib/contexted/module_analyzer.ex @@ -6,8 +6,8 @@ defmodule Contexted.ModuleAnalyzer do @doc """ Fetches the `@doc` definitions for all functions within the given module. """ - @spec get_function_docs(module()) :: [tuple()] - def get_function_docs(module) do + @spec get_functions_docs(module()) :: [tuple()] + def get_functions_docs(module) do case Code.fetch_docs(module) do {:docs_v1, _, _, _, _, _, functions_docs} -> Enum.filter(functions_docs, fn @@ -23,8 +23,8 @@ defmodule Contexted.ModuleAnalyzer do @doc """ Fetches the `@spec` definitions for all functions within the given module. """ - @spec get_module_specs(module()) :: [tuple()] - def get_module_specs(module) do + @spec get_functions_specs(module()) :: [tuple()] + def get_functions_specs(module) do case Code.Typespec.fetch_specs(module) do {:ok, specs} -> specs _ -> []