@@ -104,7 +104,7 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.ManipulatePipesTest d
104
104
) == edited_text
105
105
end
106
106
107
- test "can pipe remote calls with ulti -line args" do
107
+ test "can pipe remote calls with multi -line args" do
108
108
{ :ok , _ } =
109
109
JsonRpcMock . start_link ( success_reply: { :ok , % { "applied" => true } } , test_pid: self ( ) )
110
110
@@ -456,7 +456,6 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.ManipulatePipesTest d
456
456
assert edited_text == expected_text
457
457
end
458
458
459
- # Broken
460
459
test "to_pipe_at_cursor at end of function (with another function after)" do
461
460
text = """
462
461
defmodule Demo do
@@ -562,6 +561,38 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.ManipulatePipesTest d
562
561
) == edited_text
563
562
end
564
563
564
+ test "converts function_call_not_found to 3-tuple" do
565
+ { :ok , _ } =
566
+ JsonRpcMock . start_link ( success_reply: { :ok , % { "applied" => true } } , test_pid: self ( ) )
567
+
568
+ uri = "file:/some_file.ex"
569
+
570
+ text = """
571
+ test = 1
572
+ %{
573
+ q:
574
+ if(is_nil(test),
575
+ do: max(test, is_nil(test)),
576
+ else: []
577
+ )
578
+ }
579
+ """
580
+
581
+ assert_never_raises ( text , uri , "toPipe" )
582
+
583
+ assert { :error , :parse_error , "Function call not found at cursor" } =
584
+ ManipulatePipes . execute (
585
+ [ "toPipe" , uri , 4 , 13 ] ,
586
+ % Server {
587
+ source_files: % {
588
+ uri => % SourceFile {
589
+ text: text
590
+ }
591
+ }
592
+ }
593
+ )
594
+ end
595
+
565
596
for { line_sep , test_name_suffix } <- [ { "\r \n " , "\\ r\\ n" } , { "\n " , "\\ n" } ] do
566
597
test "can pipe correctly when the line separator is #{ test_name_suffix } " do
567
598
{ :ok , _ } =
@@ -1140,7 +1171,7 @@ defmodule ElixirLS.LanguageServer.Providers.ExecuteCommand.ManipulatePipesTest d
1140
1171
1141
1172
assert_never_raises ( text , uri , "fromPipe" )
1142
1173
1143
- assert { :error , :pipe_not_found } =
1174
+ assert { :error , :parse_error , "Pipe operator not found at cursor" } =
1144
1175
ManipulatePipes . execute (
1145
1176
[ "fromPipe" , uri , 4 , 16 ] ,
1146
1177
% Server {
0 commit comments