@@ -43,6 +43,15 @@ defmodule NextLS do
43
43
mix_home = Keyword . get ( args , :mix_home )
44
44
mix_archives = Keyword . get ( args , :mix_archives )
45
45
46
+ is_1_17 =
47
+ with { version , 0 } <- System . cmd ( "elixir" , [ "--short-version" ] ) ,
48
+ { :ok , version } <- version |> String . trim ( ) |> Version . parse ( ) do
49
+ Version . compare ( version , "1.17.0" ) in [ :gt , :eq ]
50
+ else
51
+ _ ->
52
+ false
53
+ end
54
+
46
55
registry = Keyword . fetch! ( args , :registry )
47
56
48
57
extensions =
@@ -57,6 +66,7 @@ defmodule NextLS do
57
66
bundle_base: bundle_base ,
58
67
mix_home: mix_home ,
59
68
mix_archives: mix_archives ,
69
+ is_1_17: is_1_17 ,
60
70
exit_code: 1 ,
61
71
documents: % { } ,
62
72
refresh_refs: % { } ,
@@ -93,14 +103,17 @@ defmodule NextLS do
93
103
94
104
{ :ok , init_opts } = __MODULE__ . InitOpts . validate ( init_opts )
95
105
96
- mix_home =
97
- if init_opts . experimental . completions . enable do
98
- BundledElixir . mix_home ( lsp . assigns . bundle_base )
99
- end
100
-
101
- mix_archives =
102
- if init_opts . experimental . completions . enable do
103
- BundledElixir . mix_archives ( lsp . assigns . bundle_base )
106
+ # if we are on 1.17, we will not bundle
107
+ { mix_home , mix_archives } =
108
+ if lsp . assigns . is_1_17 do
109
+ { nil , nil }
110
+ else
111
+ # if we are not on 1.17, we bundle if completions are enabled
112
+ if init_opts . experimental . completions . enable do
113
+ { BundledElixir . mix_home ( lsp . assigns . bundle_base ) , BundledElixir . mix_archives ( lsp . assigns . bundle_base ) }
114
+ else
115
+ { nil , nil }
116
+ end
104
117
end
105
118
106
119
{ :reply ,
@@ -865,6 +878,9 @@ defmodule NextLS do
865
878
866
879
elixir_bin_path =
867
880
cond do
881
+ lsp . assigns . is_1_17 ->
882
+ "elixir" |> System . find_executable ( ) |> Path . dirname ( )
883
+
868
884
lsp . assigns . init_opts . elixir_bin_path != nil ->
869
885
lsp . assigns . init_opts . elixir_bin_path
870
886
0 commit comments