Skip to content

Commit

Permalink
Cleanup unused includes/macros (as identified by ELP) (erlang-ls#1499)
Browse files Browse the repository at this point in the history
* elp lint --diagnostic-filter W0020 --apply-fix --in-place

* elp lint --diagnostic-filter unused_macro --apply-fix --in-place

* Define ?SERVER macro and actually use its value
  • Loading branch information
robertoaloi authored Feb 23, 2024
1 parent 7843781 commit 88a1adb
Show file tree
Hide file tree
Showing 15 changed files with 1 addition and 25 deletions.
2 changes: 0 additions & 2 deletions apps/els_core/src/els_config_ct_run_test.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
-module(els_config_ct_run_test).

-include_lib("els_core/include/els_core.hrl").

%% We may introduce a behaviour for config modules in the future
-export([default_config/0]).

Expand Down
2 changes: 0 additions & 2 deletions apps/els_core/src/els_config_runtime.erl
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
-module(els_config_runtime).

-include("els_core.hrl").

%% We may introduce a behaviour for config modules in the future
-export([default_config/0]).

Expand Down
2 changes: 0 additions & 2 deletions apps/els_core/src/els_jsonrpc.erl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
%%==============================================================================
%% Includes
%%==============================================================================
-include("els_core.hrl").

%%==============================================================================
%% Types
%%==============================================================================
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_call_hierarchy_item.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

-include("els_lsp.hrl").

-include_lib("kernel/include/logger.hrl").

-export([
new/5,
poi/1
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_call_hierarchy_provider.erl
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
%% Includes
%%==============================================================================
-include("els_lsp.hrl").
-include_lib("kernel/include/logger.hrl").

%%==============================================================================
%% els_provider functions
%%==============================================================================
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_code_actions.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
]).

-include("els_lsp.hrl").
-include_lib("kernel/include/logger.hrl").

-spec create_function(uri(), range(), binary(), [binary()]) -> [map()].
create_function(Uri, Range0, _Data, [UndefinedFun]) ->
{ok, #{text := Text} = Document} = els_utils:lookup_document(Uri),
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_code_lens_ct_run_test.erl
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
precondition/1
]).

-include("els_lsp.hrl").

-spec command(els_dt_document:item(), els_poi:poi(), els_code_lens:state()) ->
els_command:command().
command(#{uri := Uri} = _Document, POI, _State) ->
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_crossref_diagnostics.erl
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
%% Includes
%%==============================================================================
-include("els_lsp.hrl").
-include_lib("kernel/include/logger.hrl").

%%==============================================================================
%% Callback Functions
%%==============================================================================
Expand Down
1 change: 0 additions & 1 deletion apps/els_lsp/src/els_docs_memo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
%% Includes
%%==============================================================================
-include("els_lsp.hrl").
-include_lib("kernel/include/logger.hrl").
-include_lib("stdlib/include/ms_transform.hrl").

%%==============================================================================
Expand Down
1 change: 0 additions & 1 deletion apps/els_lsp/src/els_dt_references.erl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
%% Includes
%%==============================================================================
-include("els_lsp.hrl").
-include_lib("kernel/include/logger.hrl").
-include_lib("stdlib/include/ms_transform.hrl").

%%==============================================================================
Expand Down
1 change: 0 additions & 1 deletion apps/els_lsp/src/els_dt_signatures.erl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
%% Includes
%%==============================================================================
-include("els_lsp.hrl").
-include_lib("kernel/include/logger.hrl").
-include_lib("stdlib/include/ms_transform.hrl").

%%==============================================================================
Expand Down
1 change: 0 additions & 1 deletion apps/els_lsp/src/els_eep48_docs.erl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
dd
]).
%% inline elements are:
-define(INLINE, [i, b, em, strong, code, a]).
-define(IS_INLINE(ELEM),
(((ELEM) =:= a) orelse ((ELEM) =:= code) orelse
((ELEM) =:= i) orelse ((ELEM) =:= em) orelse
Expand Down
2 changes: 1 addition & 1 deletion apps/els_lsp/src/els_group_leader_server.erl
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ stop(Server) ->
%%==============================================================================
-spec start_link(config()) -> {ok, pid()}.
start_link(Config) ->
gen_server:start_link(?MODULE, Config, []).
gen_server:start_link(?SERVER, Config, []).

%%==============================================================================
%% gen_server callbacks
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_incomplete_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
-export([parse_after/2]).
-export([parse_line/2]).

-include_lib("kernel/include/logger.hrl").

-spec parse_after(binary(), integer()) -> [els_poi:poi()].
parse_after(Text, Line) ->
{_, AfterText} = els_text:split_at_line(Text, Line),
Expand Down
2 changes: 0 additions & 2 deletions apps/els_lsp/src/els_work_done_progress.erl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
%%==============================================================================
%% Includes
%%==============================================================================
-include("els_lsp.hrl").

%%==============================================================================
%% Types
%%==============================================================================
Expand Down

0 comments on commit 88a1adb

Please sign in to comment.