Skip to content

Commit 2dde12f

Browse files
committed
fix format
1 parent 506f654 commit 2dde12f

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

apps/language_server/test/providers/execute_command/llm_definition_test.exs

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.LlmDefinitionTest do
2424
LlmDefinition.execute(["123Invalid"], %{})
2525
end
2626

27-
test "handles module symbol - String" do
28-
result = LlmDefinition.execute(["String"], %{})
27+
test "handles module symbol - ElixirSenseExample.ModuleWithDocs" do
28+
result = LlmDefinition.execute(["ElixirSenseExample.ModuleWithDocs"], %{})
2929

3030
assert {:ok, response} = result
3131

32-
# String module is built-in, so location might not be found
32+
# Test module should be found
3333
assert response[:definition]
3434
end
3535

@@ -57,35 +57,41 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.LlmDefinitionTest do
5757
end
5858

5959
test "handles function with arity" do
60-
result = LlmDefinition.execute(["String.split/2"], %{})
60+
result = LlmDefinition.execute(["ElixirSenseExample.ModuleWithDocs.some_fun/2"], %{})
6161

6262
assert {:ok, response} = result
6363
assert response[:definition]
6464
end
6565

6666
test "handles function without arity" do
67-
result = LlmDefinition.execute(["String.split"], %{})
67+
result = LlmDefinition.execute(["ElixirSenseExample.ModuleWithDocs.some_fun"], %{})
6868

6969
assert {:ok, response} = result
7070
assert response[:definition]
7171
end
7272

7373
test "handles function with invalid arity" do
74-
result = LlmDefinition.execute(["String.split/99"], %{})
74+
result = LlmDefinition.execute(["ElixirSenseExample.ModuleWithDocs.some_fun/99"], %{})
7575

7676
assert {:ok, response} = result
7777
assert response[:definition]
7878
end
7979

8080
test "handles special function names with ?" do
81-
result = LlmDefinition.execute(["String.valid?/1"], %{})
81+
result = LlmDefinition.execute(["ElixirSenseExample.FunctionsWithTheSameName.all?/2"], %{})
8282

8383
assert {:ok, response} = result
8484
assert response[:definition]
8585
end
8686

8787
test "handles special function names with !" do
88-
result = LlmDefinition.execute(["String.upcase!/1"], %{})
88+
result =
89+
LlmDefinition.execute(
90+
[
91+
"ElixirLS.LanguageServer.Providers.ExecuteCommand.LlmDefinitionTest.TestModule.test_function!/1"
92+
],
93+
%{}
94+
)
8995

9096
assert {:ok, response} = result
9197
assert response[:definition]
@@ -145,6 +151,11 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.LlmDefinitionTest do
145151
def private_function, do: :private
146152

147153
def function_without_docs(a, b), do: a + b
154+
155+
@doc "A function with ! in name"
156+
def test_function!(x) do
157+
x + 1
158+
end
148159
end
149160

150161
test "finds module definition for test module" do
@@ -213,7 +224,7 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.LlmDefinitionTest do
213224
describe "symbol parsing validation" do
214225
test "correctly identifies module patterns" do
215226
valid_modules = [
216-
"String",
227+
"ElixirSenseExample.ModuleWithDocs",
217228
"Enum",
218229
"GenServer",
219230
"Mix.Project",
@@ -229,7 +240,7 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.LlmDefinitionTest do
229240

230241
test "correctly identifies function patterns" do
231242
valid_functions = [
232-
"String.split/2",
243+
"ElixirSenseExample.ModuleWithDocs.some_fun/2",
233244
"Enum.map/2",
234245
"IO.puts/1",
235246
"Kernel.is_nil/1",

0 commit comments

Comments
 (0)