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 11### Unreleased
22
3+ ### v0.26.1: 30 December 2024
4+
5+ #### Fixes
6+
7+ - Fixed regression in formatter plugin loader
8+
39### v0.26.0: 30 December 2024
410
511#### 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
22 alias ElixirLS.LanguageServer.Protocol.TextEdit
33
44 import ElixirLS.LanguageServer.Protocol
5+ import ElixirLS.LanguageServer.JsonRpc
56 require ElixirSense.Core.Introspection , as: Introspection
67 require Logger
78
@@ -272,10 +273,33 @@ defmodule ElixirLS.LanguageServer.SourceFile do
272273 config_mtime: MixProjectCache . config_mtime ( ) ,
273274 mix_project: MixProjectCache . get ( ) ,
274275 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+
276301 # we don't do any plugin loading as this may trigger compile
277302 # TODO it may be safe to compile on 1.18+
278- :ok
279303 end
280304 ]
281305
You can’t perform that action at this time.
0 commit comments