Skip to content

Commit

Permalink
fixup! feat: workspace symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
mhanberg committed Jun 25, 2023
1 parent 998429d commit 9f8a2b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
8 changes: 7 additions & 1 deletion test/next_ls/runtime_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,18 @@ defmodule NextLs.RuntimeTest do
severity: :warning,
message:
"variable \"arg1\" is unused (if the variable is not meant to be used, prefix it with an underscore)",
position: 4,
position: position,
compiler_name: "Elixir",
details: nil
}
] = Runtime.compile(pid)

if Version.match?(System.version(), ">= 1.15.0") do
assert position == {4, 11}
else
assert position == 4
end

File.write!(file, """
defmodule Bar do
def foo(arg1) do
Expand Down
4 changes: 3 additions & 1 deletion test/next_ls_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ defmodule NextLSTest do
path: Path.join([cwd, "lib", file])
})

char = if Version.match?(System.version(), ">= 1.15.0"), do: 11, else: 0

assert_notification "textDocument/publishDiagnostics", %{
"uri" => ^uri,
"diagnostics" => [
Expand All @@ -167,7 +169,7 @@ defmodule NextLSTest do
"message" =>
"variable \"arg1\" is unused (if the variable is not meant to be used, prefix it with an underscore)",
"range" => %{
"start" => %{"line" => 3, "character" => 0},
"start" => %{"line" => 3, "character" => ^char},
"end" => %{"line" => 3, "character" => 999}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{:ok, _pid} = Node.start(:"nextls#{System.system_time()}", :shortnames)

Logger.configure(level: :warn)
Logger.configure(level: :warning)

timeout =
if System.get_env("CI", "false") == "true" do
Expand Down

0 comments on commit 9f8a2b1

Please sign in to comment.