Skip to content

Commit

Permalink
Fixed type spec
Browse files Browse the repository at this point in the history
The AST type is very complicated, and dialyzer was telling us I got it wrong.
  • Loading branch information
scohen committed Dec 2, 2022
1 parent b705b31 commit 1a3692f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
defmodule ElixirLS.LanguageServer.Experimental.CodeMod.Ast do
alias ElixirLS.LanguageServer.Experimental.SourceFile
@opaque t :: tuple()

@type t :: any()

def from(%SourceFile{} = source_file) do
source_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule ElixirLS.LanguageServer.Experimental.CodeMod.ReplaceWithUnderscore do
alias ElixirLS.LanguageServer.Experimental.CodeMod.Ast
alias ElixirLS.LanguageServer.Experimental.CodeMod.Diff

@spec text_edits(String.t(), Ast.t(), String.t() | atom) :: {:ok, [TextEdit.t()]}
@spec text_edits(String.t(), Ast.t(), String.t() | atom) :: {:ok, [TextEdit.t()]} | :error
def text_edits(original_text, ast, variable_name) do
variable_name = ensure_atom(variable_name)

Expand Down

0 comments on commit 1a3692f

Please sign in to comment.