Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaszsamson committed May 4, 2024
1 parent e1f7272 commit 1d1bfd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
|> Enum.filter(fn s -> s.type == :variable end)

assert list == [
%{name: "_from", type: :variable},
%{name: "request", type: :variable},
%{name: "state", type: :variable},
%{name: "var1", type: :variable}
Expand All @@ -1533,6 +1534,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.SuggestionTest do
|> Enum.filter(fn s -> s.type == :variable end)

assert list == [
%{name: "_state", type: :variable},
%{name: "arg", type: :variable}
]
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,18 @@ defmodule ElixirLS.LanguageServer.Providers.Definition.LocatorTest do
end

test "find definition of aliased modules in `use`" do
# TODO this test fails if there's no newline between alias and use
buffer = """
defmodule MyModule do
alias ElixirSenseExample.UseExample
alias Enum
use UseExample
# ^
end
"""

%Location{type: :module, file: file, line: line, column: column} =
Locator.definition(buffer, 3, 12)
Locator.definition(buffer, 4, 12)

assert file =~ "language_server/test/support/use_example.ex"
assert read_line(file, {line, column}) =~ "ElixirSenseExample.UseExample"
Expand Down

0 comments on commit 1d1bfd8

Please sign in to comment.