Skip to content

Commit 7d6b710

Browse files
committed
Fix textDocument/formatting returns [] when format Ecto migration script
When try to format Ecto migration script that generate project from Phoenix, it will returns inputs "*.exs". But the glob list just detect it only the root of project and apps directory which for umbrella project. This cause make migration script won't match any glob pattern. This changes fixes by add directory of file that want to format to the end of glob list. Fixes #361
1 parent 3a94455 commit 7d6b710

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

apps/language_server/lib/language_server/providers/formatting.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
5656
|> Stream.flat_map(fn glob ->
5757
[
5858
Path.join([project_dir, glob]),
59-
Path.join([project_dir, "apps", "*", glob])
59+
Path.join([project_dir, "apps", "*", glob]),
60+
Path.join([Path.dirname(file), glob])
6061
]
6162
end)
6263
|> Stream.flat_map(&Path.wildcard(&1, match_dot: true))

0 commit comments

Comments
 (0)