diff --git a/test/next_ls/runtime_test.exs b/test/next_ls/runtime_test.exs index 962744ba..4834d7de 100644 --- a/test/next_ls/runtime_test.exs +++ b/test/next_ls/runtime_test.exs @@ -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: 2, + position: position, compiler_name: "Elixir", details: nil } ] = Runtime.compile(pid) + if Version.match?(System.version(), ">= 1.15.0") do + assert position == {2, 11} + else + assert position == 2 + end + File.write!(file, """ defmodule Bar do def foo(arg1) do diff --git a/test/next_ls_test.exs b/test/next_ls_test.exs index e32f5df5..f9697668 100644 --- a/test/next_ls_test.exs +++ b/test/next_ls_test.exs @@ -156,6 +156,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" => [ @@ -165,7 +167,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" => 1, "character" => 0}, + "start" => %{"line" => 1, "character" => ^char}, "end" => %{"line" => 1, "character" => 999} } } diff --git a/test/test_helper.exs b/test/test_helper.exs index fc000cd3..18118be6 100644 --- a/test/test_helper.exs +++ b/test/test_helper.exs @@ -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