Skip to content

Commit 927d248

Browse files
authored
Merge pull request #321 from elixir-lsp/codex/define-@spec-for-docs/4-function
Add spec for docs/4 return
2 parents c63e0b3 + 985190c commit 927d248

File tree

1 file changed

+5
-0
lines changed
  • lib/elixir_sense/providers/hover

1 file changed

+5
-0
lines changed

lib/elixir_sense/providers/hover/docs.ex

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,15 @@ defmodule ElixirSense.Providers.Hover.Docs do
5959

6060
@type doc :: module_doc | function_doc | type_doc | variable_doc | attribute_doc | keyword_doc
6161

62+
@type position :: {pos_integer, pos_integer}
63+
@type range :: %{begin: position, end: position}
64+
@type docs_info :: %{docs: [doc], range: range}
65+
6266
@builtin_functions BuiltinFunctions.all()
6367
|> Enum.map(&elem(&1, 0))
6468
|> Kernel.--([:exception, :message])
6569

70+
@spec docs(String.t(), pos_integer, pos_integer, keyword()) :: docs_info | nil
6671
def docs(code, line, column, options \\ []) do
6772
case NormalizedCode.Fragment.surround_context(code, {line, column}) do
6873
:none ->

0 commit comments

Comments
 (0)