File tree Expand file tree Collapse file tree 3 files changed +33
-3
lines changed
apps/language_server/lib/language_server Expand file tree Collapse file tree 3 files changed +33
-3
lines changed Original file line number Diff line number Diff line change 1
1
### Unreleased
2
2
3
+ ### v0.26.1: 30 December 2024
4
+
5
+ #### Fixes
6
+
7
+ - Fixed regression in formatter plugin loader
8
+
3
9
### v0.26.0: 30 December 2024
4
10
5
11
#### Highlights
Original file line number Diff line number Diff line change 1
- 0.26.0
1
+ 0.26.1
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ defmodule ElixirLS.LanguageServer.SourceFile do
2
2
alias ElixirLS.LanguageServer.Protocol.TextEdit
3
3
4
4
import ElixirLS.LanguageServer.Protocol
5
+ import ElixirLS.LanguageServer.JsonRpc
5
6
require ElixirSense.Core.Introspection , as: Introspection
6
7
require Logger
7
8
@@ -272,10 +273,33 @@ defmodule ElixirLS.LanguageServer.SourceFile do
272
273
config_mtime: MixProjectCache . config_mtime ( ) ,
273
274
mix_project: MixProjectCache . get ( ) ,
274
275
root: project_dir ,
275
- plugin_loader: fn _plugins ->
276
+ plugin_loader: fn plugins ->
277
+ for plugin <- plugins do
278
+ cond do
279
+ not Code . ensure_loaded? ( plugin ) ->
280
+ JsonRpc . show_message (
281
+ :warning ,
282
+ "Formatter plugin #{ inspect ( plugin ) } is not loaded and will be skipped. Please compile the project."
283
+ )
284
+
285
+ nil
286
+
287
+ not function_exported? ( plugin , :features , 1 ) ->
288
+ JsonRpc . show_message (
289
+ :error ,
290
+ "Formatter plugin #{ inspect ( plugin ) } does not define features/1 and will be skipped."
291
+ )
292
+
293
+ nil
294
+
295
+ true ->
296
+ plugin
297
+ end
298
+ end
299
+ |> Enum . reject ( & is_nil / 1 )
300
+
276
301
# we don't do any plugin loading as this may trigger compile
277
302
# TODO it may be safe to compile on 1.18+
278
- :ok
279
303
end
280
304
]
281
305
You can’t perform that action at this time.
0 commit comments