@@ -435,7 +435,11 @@ defmodule Mix.Tasks.ElixirLSFormat do
435
435
436
436
formatter_opts_and_subs = load_plugins ( formatter_opts_and_subs , opts )
437
437
438
- find_formatter_and_opts_for_file ( Path . expand ( file , cwd ) , cwd , formatter_opts_and_subs )
438
+ find_formatter_and_opts_for_file (
439
+ SourceFile.Path . expand ( file , cwd ) ,
440
+ cwd ,
441
+ formatter_opts_and_subs
442
+ )
439
443
end
440
444
441
445
@ doc false
@@ -558,7 +562,7 @@ defmodule Mix.Tasks.ElixirLSFormat do
558
562
defp eval_subs_opts ( subs , cwd , sources , opts ) do
559
563
{ subs , sources } =
560
564
Enum . flat_map_reduce ( subs , sources , fn sub , sources ->
561
- cwd = Path . expand ( sub , cwd )
565
+ cwd = SourceFile. Path. expand ( sub , cwd )
562
566
{ Path . wildcard ( cwd ) , [ Path . join ( cwd , ".formatter.exs" ) | sources ] }
563
567
end )
564
568
@@ -637,7 +641,8 @@ defmodule Mix.Tasks.ElixirLSFormat do
637
641
638
642
for file <- files do
639
643
if file == :stdin do
640
- stdin_filename = Path . expand ( Keyword . get ( opts , :stdin_filename , "stdin.exs" ) , cwd )
644
+ stdin_filename =
645
+ SourceFile.Path . expand ( Keyword . get ( opts , :stdin_filename , "stdin.exs" ) , cwd )
641
646
642
647
{ formatter , _opts } =
643
648
find_formatter_and_opts_for_file ( stdin_filename , cwd , { formatter_opts , subs } )
@@ -657,7 +662,7 @@ defmodule Mix.Tasks.ElixirLSFormat do
657
662
658
663
map =
659
664
for input <- List . wrap ( formatter_opts [ :inputs ] ) ,
660
- file <- Path . wildcard ( Path . expand ( input , cwd ) , match_dot: true ) ,
665
+ file <- Path . wildcard ( SourceFile. Path. expand ( input , cwd ) , match_dot: true ) ,
661
666
do: { file , { dot_formatter , formatter_opts } } ,
662
667
into: % { }
663
668
@@ -737,7 +742,11 @@ defmodule Mix.Tasks.ElixirLSFormat do
737
742
defp stdin_or_wildcard ( "-" ) , do: [ :stdin ]
738
743
739
744
defp stdin_or_wildcard ( path ) ,
740
- do: path |> Path . expand ( ) |> Path . wildcard ( match_dot: true ) |> Enum . filter ( & File . regular? / 1 )
745
+ do:
746
+ path
747
+ |> SourceFile.Path . expand ( )
748
+ |> Path . wildcard ( match_dot: true )
749
+ |> Enum . filter ( & File . regular? / 1 )
741
750
742
751
defp elixir_format ( content , formatter_opts ) do
743
752
case Code . format_string! ( content , formatter_opts ) do
0 commit comments