@@ -2,12 +2,13 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
2
2
use ExUnit.Case , async: true
3
3
4
4
alias ElixirLS.LanguageServer.Providers.References
5
+ alias ElixirLS.LanguageServer.SourceFile
5
6
require ElixirLS.Test.TextLoc
6
7
7
8
test "finds references to a function" do
8
- file_path = Path . join ( __DIR__ , "../../ support/references_b.ex" ) |> Path . expand ( )
9
+ file_path = Path . join ( __DIR__ , "../support/references_b.ex" ) |> Path . expand ( )
9
10
text = File . read! ( file_path )
10
- uri = "file:// #{ file_path } "
11
+ uri = SourceFile . path_to_uri ( file_path )
11
12
12
13
{ line , char } = { 2 , 8 }
13
14
@@ -38,9 +39,9 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
38
39
end
39
40
40
41
test "cannot find a references to a macro generated function call" do
41
- file_path = Path . join ( __DIR__ , "../../ support/uses_macro_a.ex" ) |> Path . expand ( )
42
+ file_path = Path . join ( __DIR__ , "../support/uses_macro_a.ex" ) |> Path . expand ( )
42
43
text = File . read! ( file_path )
43
- uri = "file:// #{ file_path } "
44
+ uri = SourceFile . path_to_uri ( file_path )
44
45
{ line , char } = { 6 , 13 }
45
46
46
47
ElixirLS.Test.TextLoc . annotate_assert ( file_path , line , char , """
@@ -52,9 +53,9 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
52
53
end
53
54
54
55
test "finds a references to a macro imported function call" do
55
- file_path = Path . join ( __DIR__ , "../../ support/uses_macro_a.ex" ) |> Path . expand ( )
56
+ file_path = Path . join ( __DIR__ , "../support/uses_macro_a.ex" ) |> Path . expand ( )
56
57
text = File . read! ( file_path )
57
- uri = "file:// #{ file_path } "
58
+ uri = SourceFile . path_to_uri ( file_path )
58
59
{ line , char } = { 10 , 4 }
59
60
60
61
ElixirLS.Test.TextLoc . annotate_assert ( file_path , line , char , """
@@ -74,9 +75,9 @@ defmodule ElixirLS.LanguageServer.Providers.ReferencesTest do
74
75
end
75
76
76
77
test "finds references to a variable" do
77
- file_path = Path . join ( __DIR__ , "../../ support/references_b.ex" ) |> Path . expand ( )
78
+ file_path = Path . join ( __DIR__ , "../support/references_b.ex" ) |> Path . expand ( )
78
79
text = File . read! ( file_path )
79
- uri = "file:// #{ file_path } "
80
+ uri = SourceFile . path_to_uri ( file_path )
80
81
{ line , char } = { 4 , 14 }
81
82
82
83
ElixirLS.Test.TextLoc . annotate_assert ( file_path , line , char , """
0 commit comments