Skip to content

Commit

Permalink
模块和函数独立跳转
Browse files Browse the repository at this point in the history
  • Loading branch information
shuying2244 committed Oct 24, 2024
1 parent c3a35c2 commit 43206ff
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions apps/els_lsp/src/els_parser.erl
Original file line number Diff line number Diff line change
Expand Up @@ -339,19 +339,20 @@ application(Tree) ->
[poi(Pos, application, {M, F, A}, Data)] ++
[poi(ModPos, variable, M) || ModType =:= variable] ++
[poi(FunPos, variable, F) || FunType =:= variable];
MFA ->
{M, _, _} = MFA ->
ModFunTree = erl_syntax:application_operator(Tree),
Pos = erl_syntax:get_pos(ModFunTree),
FunTree = erl_syntax:module_qualifier_body(ModFunTree),
FunPos = erl_syntax:get_pos(FunTree),
ModTree = erl_syntax:module_qualifier_argument(ModFunTree),
ModPos = erl_syntax:get_pos(ModTree),
Args = erl_syntax:application_arguments(Tree),

Data = #{
name_range => els_range:range(erl_syntax:get_pos(FunTree)),
mod_range => els_range:range(erl_syntax:get_pos(ModTree)),
name_range => els_range:range(FunPos),
mod_range => els_range:range(ModPos),
args => args_from_subtrees(Args)
},
[poi(Pos, application, MFA, Data)]
[poi(ModPos, module, M), poi(FunPos, application, MFA, Data)]
end.

-spec application_mfa(tree()) ->
Expand Down

0 comments on commit 43206ff

Please sign in to comment.