-
Notifications
You must be signed in to change notification settings - Fork 216
Add support for .formatter.exs in subdirectories #362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@@ -56,7 +56,8 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do | |||
|> Stream.flat_map(fn glob -> | |||
[ | |||
Path.join([project_dir, glob]), | |||
Path.join([project_dir, "apps", "*", glob]) | |||
Path.join([project_dir, "apps", "*", glob]), | |||
Path.join([Path.dirname(file), glob]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be added only when Path.dirname(file)
differs from project_dir
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. It should check file are in the project dir before add to the globs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, see comments below
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 elixir-lsp#361
Unfortunately it's still broken.
I meant that we should add something to globs only if it's not already there.
|
@lukaszsamson thanks for your guide. I think it would be great to do this. Let me try. 🙏 |
@wingyplus ping |
@lukaszsamson Hi, Sorry for disappear for a long time. I already see the WIP PR (but it's read in details yet), it's seems that it solve this issue? |
@wingyplus is it still an issue? |
Closing as this was superseded by #609 |
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