erlang-ls / erlang_ls

The Erlang Language Server
https://erlang-ls.github.io/
Apache License 2.0
618 stars 136 forks source link

Including a header file that forwards to another lib results in incorrect 'Unused file' warning #1501

Open rlipscombe opened 3 months ago

rlipscombe commented 3 months ago

Describe the bug

Given -include("errors.hrl")., which contains -include_lib("other/include/errors.hrl")., none of the definitions in the included file are recognised as in scope.

This leads to an incorrect "Unused file: errors.hrl" (sometimes at the -module attribute, rather than at the -include, but I couldn't get a small-enough repro for that).

To Reproduce

See https://github.com/rlipscombe/erlang_ls_1501_parent and https://github.com/rlipscombe/erlang_ls_1501_child, 'erlang_ls_1501' tag.

Expected behavior

No warning.

Actual behavior

You get a spurious warning, as described.

Context

rlipscombe commented 3 months ago

Oh, great. It's started working properly now. No changes to the code, afaict.