@@ -115,7 +115,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
115
115
@ tag :fixture
116
116
test "Formats a file with LF line endings" do
117
117
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
118
- MixProject . store ( )
118
+ store_mix_cache ( )
119
119
path = "lib/file.ex"
120
120
uri = SourceFile.Path . to_uri ( path )
121
121
@@ -166,7 +166,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
166
166
@ tag :fixture
167
167
test "Formats a file with CRLF line endings" do
168
168
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
169
- MixProject . store ( )
169
+ store_mix_cache ( )
170
170
path = "lib/file.ex"
171
171
uri = SourceFile.Path . to_uri ( path )
172
172
@@ -254,7 +254,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
254
254
@ tag :fixture
255
255
test "elixir formatter does not support CR line endings" do
256
256
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
257
- MixProject . store ( )
257
+ store_mix_cache ( )
258
258
path = "lib/file.ex"
259
259
uri = SourceFile.Path . to_uri ( path )
260
260
@@ -286,7 +286,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
286
286
@ tag :fixture
287
287
test "formatting preserves line indings inside a string" do
288
288
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
289
- MixProject . store ( )
289
+ store_mix_cache ( )
290
290
path = "lib/file.ex"
291
291
uri = SourceFile.Path . to_uri ( path )
292
292
@@ -342,7 +342,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
342
342
@ tag :fixture
343
343
test "returns an error when formatting a file with a syntax error" do
344
344
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
345
- MixProject . store ( )
345
+ store_mix_cache ( )
346
346
path = "lib/file.ex"
347
347
uri = SourceFile.Path . to_uri ( path )
348
348
@@ -372,7 +372,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
372
372
@ tag :fixture
373
373
test "Proper utf-16 format: emoji 😀" do
374
374
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
375
- MixProject . store ( )
375
+ store_mix_cache ( )
376
376
path = "lib/file.ex"
377
377
uri = SourceFile.Path . to_uri ( path )
378
378
@@ -412,7 +412,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
412
412
@ tag :fixture
413
413
test "Proper utf-16 format: emoji 🏳️🌈" do
414
414
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
415
- MixProject . store ( )
415
+ store_mix_cache ( )
416
416
path = "lib/file.ex"
417
417
uri = SourceFile.Path . to_uri ( path )
418
418
@@ -452,7 +452,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
452
452
@ tag :fixture
453
453
test "Proper utf-16 format: zalgo" do
454
454
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
455
- MixProject . store ( )
455
+ store_mix_cache ( )
456
456
path = "lib/file.ex"
457
457
uri = SourceFile.Path . to_uri ( path )
458
458
@@ -492,7 +492,7 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
492
492
@ tag :fixture
493
493
test "honors :inputs when deciding to format" do
494
494
in_fixture ( Path . join ( __DIR__ , ".." ) , "formatter" , fn ->
495
- MixProject . store ( )
495
+ store_mix_cache ( )
496
496
project_dir = Path . expand ( "." )
497
497
498
498
assert_formatted ( "file.ex" , project_dir )
@@ -544,4 +544,23 @@ defmodule ElixirLS.LanguageServer.Providers.FormattingTest do
544
544
File . write! ( path , " asd = 1" )
545
545
Formatting . format ( source_file , SourceFile.Path . to_uri ( path ) , project_dir )
546
546
end
547
+
548
+ defp store_mix_cache ( ) do
549
+ state = % {
550
+ get: Mix.Project . get ( ) ,
551
+ # project_file: Mix.Project.project_file(),
552
+ config: Mix.Project . config ( ) ,
553
+ # config_files: Mix.Project.config_files(),
554
+ config_mtime: Mix.Project . config_mtime ( ) ,
555
+ umbrella?: Mix.Project . umbrella? ( ) ,
556
+ apps_paths: Mix.Project . apps_paths ( ) ,
557
+ # deps_path: Mix.Project.deps_path(),
558
+ # deps_apps: Mix.Project.deps_apps(),
559
+ # deps_scms: Mix.Project.deps_scms(),
560
+ deps_paths: Mix.Project . deps_paths ( ) ,
561
+ # build_path: Mix.Project.build_path(),
562
+ manifest_path: Mix.Project . manifest_path ( )
563
+ }
564
+ MixProject . store ( state )
565
+ end
547
566
end
0 commit comments