Skip to content

Commit 3089a02

Browse files
committed
resolve some TODOs
1 parent e3cb7a8 commit 3089a02

File tree

7 files changed

+27
-37
lines changed

7 files changed

+27
-37
lines changed

apps/language_server/lib/language_server/markdown_utils.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ defmodule ElixirLS.LanguageServer.MarkdownUtils do
151151
of ExDoc autolinker https://hexdocs.pm/ex_doc/readme.html#auto-linking
152152
"""
153153
def transform_ex_doc_links(string, current_module \\ nil) do
154-
# TODO add support for OTP 27
155154
string
156155
|> String.split(~r/(`.*?`)|(\[.*?\]\(.*?\))/u, include_captures: true)
157156
|> Enum.map(fn segment ->

apps/language_server/lib/language_server/mix_tasks/format.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,6 @@ defmodule Mix.Tasks.ElixirLSFormat do
371371
@doc """
372372
Returns formatter options to be used for the given file.
373373
"""
374-
# TODO: Deprecate on Elixir v1.17
375374
@doc deprecated: "Use formatter_for_file/2 instead"
376375
def formatter_opts_for_file(file, opts \\ []) do
377376
{_, formatter_opts} = formatter_for_file(file, opts)

apps/language_server/lib/language_server/providers/completion/suggestion.ex

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,15 +126,7 @@ defmodule ElixirLS.LanguageServer.Providers.Completion.Suggestion do
126126
{line, column}
127127
)
128128

129-
# TODO test surround_context
130-
# surround = case NormalizedCode.Fragment.surround_context(code, {line, column}) do
131-
# :none ->
132-
# nil
133-
134-
# context ->
135-
# {context.begin, context.end}
136-
# end
137-
129+
# This works better than Code.Fragment.surround_context
138130
surround =
139131
case {prefix, suffix} do
140132
{"", ""} ->

apps/language_server/lib/language_server/providers/execute_command/expand_macro.ex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.ExpandMacro do
2020
path = get_path(uri)
2121
cur_text = source_file.text
2222

23-
# TODO change/move this
2423
if String.trim(text) != "" do
2524
formatted =
2625
expand_full(cur_text, text, path, line + 1)

apps/language_server/test/providers/completion_test.exs

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1448,32 +1448,34 @@ defmodule ElixirLS.LanguageServer.Providers.CompletionTest do
14481448
} = first
14491449
end
14501450

1451-
test "will suggest remote quoted calls" do
1452-
text = """
1453-
alias ElixirLS.LanguageServer.Fixtures.ExampleQuotedDefs, as: Quoted
1454-
Quoted.
1455-
# ^
1456-
"""
1451+
if Version.match?(System.version(), ">= 1.15.0") do
1452+
test "will suggest remote quoted calls" do
1453+
text = """
1454+
alias ElixirLS.LanguageServer.Fixtures.ExampleQuotedDefs, as: Quoted
1455+
Quoted.
1456+
# ^
1457+
"""
14571458

1458-
{line, char} = {1, 7}
1459+
{line, char} = {1, 7}
14591460

1460-
TestUtils.assert_has_cursor_char(text, line, char)
1461-
{line, char} = SourceFile.lsp_position_to_elixir(text, {line, char})
1462-
parser_context = ParserContextBuilder.from_string(text, {line, char})
1461+
TestUtils.assert_has_cursor_char(text, line, char)
1462+
{line, char} = SourceFile.lsp_position_to_elixir(text, {line, char})
1463+
parser_context = ParserContextBuilder.from_string(text, {line, char})
14631464

1464-
assert {:ok, %{"items" => items}} =
1465-
Completion.completion(
1466-
parser_context,
1467-
line,
1468-
char,
1469-
@supports
1470-
)
1465+
assert {:ok, %{"items" => items}} =
1466+
Completion.completion(
1467+
parser_context,
1468+
line,
1469+
char,
1470+
@supports
1471+
)
14711472

1472-
assert item = Enum.find(items, fn item -> item["label"] == "\"0abc\\\"asd\"" end)
1473-
assert item["insertText"] == "\"0abc\\\"asd\"($1)$0"
1473+
assert item = Enum.find(items, fn item -> item["label"] == "\"0abc\\\"asd\"" end)
1474+
assert item["insertText"] == "\"0abc\\\"asd\"($1)$0"
14741475

1475-
assert item["labelDetails"]["description"] ==
1476-
"ElixirLS.LanguageServer.Fixtures.ExampleQuotedDefs.\"0abc\\\"asd\"/2"
1476+
assert item["labelDetails"]["description"] ==
1477+
"ElixirLS.LanguageServer.Fixtures.ExampleQuotedDefs.\"0abc\\\"asd\"/2"
1478+
end
14771479
end
14781480
end
14791481

apps/language_server/test/providers/definition/locator_test.exs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ defmodule ElixirLS.LanguageServer.Providers.Definition.LocatorTest do
4141
end
4242

4343
test "find definition of aliased modules in `use`" do
44-
# TODO this test fails if there's no newline between alias and use
4544
buffer = """
4645
defmodule MyModule do
4746
alias ElixirSenseExample.UseExample
@@ -1060,7 +1059,7 @@ defmodule ElixirLS.LanguageServer.Providers.Definition.LocatorTest do
10601059
}
10611060
end
10621061

1063-
# TODO not supported in Code.Fragment.surround_context
1062+
# TODO not supported in Code.Fragment.surround_context as of elixir 1.17
10641063
# test "find definition of &1 capture variable" do
10651064
# buffer = """
10661065
# defmodule MyModule do
@@ -1202,7 +1201,7 @@ defmodule ElixirLS.LanguageServer.Providers.Definition.LocatorTest do
12021201
}
12031202

12041203
# `a` redefined in a case clause
1205-
# TODO cursor lands in the wrong clause
1204+
# TODO cursor lands in the wrong clause on 1.17
12061205
# defmodule MyModule do
12071206
# def my_fun(a, b) do
12081207
# case a do

apps/language_server/test/providers/references/locator_test.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ defmodule ElixirLS.LanguageServer.Providers.References.LocatorTest do
243243
%{start: %{line: 65, column: 79}, end: %{line: 65, column: 83}} |> maybe_shift
244244
end
245245

246-
# TODO crashes metadata builder
246+
# TODO attributes not supported yet
247247
# test "find references with cursor over a function called via @attr.Submodule.call", %{trace: trace} do
248248
# buffer = """
249249
# defmodule Caller do

0 commit comments

Comments
 (0)