We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2ba0f8a commit 372ef9bCopy full SHA for 372ef9b
apps/language_server/lib/language_server/mix_tasks/format.ex
@@ -608,8 +608,15 @@ defmodule Mix.Tasks.ElixirLSFormat do
608
609
defp recur_formatter_opts_for_file(file, {formatter_opts, subs}) do
610
Enum.find_value(subs, formatter_opts, fn {sub, formatter_opts_and_subs} ->
611
- if String.starts_with?(file, sub) do
612
- recur_formatter_opts_for_file(file, formatter_opts_and_subs)
+ size = byte_size(sub)
+
613
+ case file do
614
+ <<prefix::binary-size(size), dir_separator, _::binary>>
615
+ when prefix == sub and dir_separator in [?\\, ?/] ->
616
+ recur_formatter_opts_for_file(file, formatter_opts_and_subs)
617
618
+ _ ->
619
+ nil
620
end
621
end)
622
0 commit comments