From 72bddd335179d245f338017446922d39294dbd05 Mon Sep 17 00:00:00 2001 From: Aaron Tinio Date: Wed, 2 Nov 2022 07:25:37 +0800 Subject: [PATCH] Add components to Phoenix dirs https://github.com/phoenixframework/phoenix/blob/36639c3132a8063f604dade442238875d787d6af/installer/lib/phx_new/web.ex#L45-L56 --- .../lib/language_server/providers/completion.ex | 3 ++- apps/language_server/test/providers/completion_test.exs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/language_server/lib/language_server/providers/completion.ex b/apps/language_server/lib/language_server/providers/completion.ex index d968270c0..c4cd2fefd 100644 --- a/apps/language_server/lib/language_server/providers/completion.ex +++ b/apps/language_server/lib/language_server/providers/completion.ex @@ -713,7 +713,8 @@ defmodule ElixirLS.LanguageServer.Providers.Completion do "plugs", "endpoints", "sockets", - "live" + "live", + "components" ] do if String.ends_with?(project_web_dir, "_web") do # by convention Phoenix doesn't use these folders as part of the module names diff --git a/apps/language_server/test/providers/completion_test.exs b/apps/language_server/test/providers/completion_test.exs index 41d2a7c6b..2ccad5bb6 100644 --- a/apps/language_server/test/providers/completion_test.exs +++ b/apps/language_server/test/providers/completion_test.exs @@ -1289,7 +1289,8 @@ defmodule ElixirLS.LanguageServer.Providers.CompletionTest do {"MyProjectWeb.MyChannel", "channels/my_channel.ex"}, {"MyProjectWeb.MyEndpoint", "endpoints/my_endpoint.ex"}, {"MyProjectWeb.MySocket", "sockets/my_socket.ex"}, - {"MyProjectWeb.MyviewLive.MyComponent", "live/myview_live/my_component.ex"} + {"MyProjectWeb.MyviewLive.MyComponent", "live/myview_live/my_component.ex"}, + {"MyProjectWeb.MyComponent", "components/my_component.ex"} ] |> Enum.each(fn {expected_module_name, partial_path} -> path = "some/path/my_project/lib/my_project_web/#{partial_path}"