Skip to content

Commit 7191aeb

Browse files
committed
Revert "wip"
This partially reverts accidental commit 8987355.
1 parent 4a7603d commit 7191aeb

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ defmodule ElixirLS.LanguageServer.Providers.Formatting do
1111
# file_path and project_dir are absolute paths with universal separators
1212
if SourceFile.Path.path_in_dir?(file_path, project_dir) do
1313
# file in project_dir we find formatter and options for file
14-
case SourceFile.formatter_for(uri, project_dir, mix_project?) |> dbg do
14+
case SourceFile.formatter_for(uri, project_dir, mix_project?) do
1515
{:ok, {formatter, opts, formatter_exs_dir}} ->
1616
if should_format?(uri, formatter_exs_dir, opts[:inputs], project_dir) do
1717
do_format(source_file, formatter, opts)

apps/language_server/lib/language_server/source_file.ex

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,19 +267,14 @@ defmodule ElixirLS.LanguageServer.SourceFile do
267267
if mix_project? do
268268
if MixProjectCache.loaded?() do
269269
opts = [
270-
# deps_paths: MixProjectCache.deps_paths(),
271-
# manifest_path: MixProjectCache.manifest_path(),
272-
# config_mtime: MixProjectCache.config_mtime(),
273-
# mix_project: MixProjectCache.get(),
270+
deps_paths: MixProjectCache.deps_paths(),
271+
manifest_path: MixProjectCache.manifest_path(),
272+
config_mtime: MixProjectCache.config_mtime(),
273+
mix_project: MixProjectCache.get(),
274274
root: project_dir
275275
]
276276

277-
case Mix.Tasks.Format.formatter_for_file(path, opts) do
278-
{formatter, opts} ->
279-
{:ok, {formatter, opts, opts[:root]}}
280-
end
281-
282-
# {:ok, Mix.Tasks.ElixirLSFormat.formatter_for_file(path, opts)}
277+
{:ok, Mix.Tasks.ElixirLSFormat.formatter_for_file(path, opts)}
283278
else
284279
{:error, :project_not_loaded}
285280
end

0 commit comments

Comments
 (0)