-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid unused include warning when including eunit.hrl #1047
Comments
thanks Adam, this is indeed a bug. Just cross-linking with the related #964 |
What we could have (unless we manage to fix all corner cases) is a ignore-list for header files. Candidates could be:
The user could customize the list if required. Similar to the Exclude OTP Apps list |
Shouldn't any header file that includes |
That should work. I was thinking to cases "other" than parse transforms, but maybe there isn't any. |
to be very precise it is not a -parse_transform attribute, but a compiler option in a -compile attribute, but probably the presence of any compiler option should make the header be excluded. |
…er-attribute-as-used [#1047] Mark headers with compiler attributes as used
@eproxus This should now be solved in the lastest |
Describe the bug
Consider the following module:
A warning will be generated on line 2:
warning Unused file: eunit.hrl UnusedIncludes
To Reproduce
Create the module.
Expected behavior
No warning is issued since the include file is used, because it exports the
the_test/0
function. If the file is not included, the test doesn't work.Actual behavior
A false warning is issued:
warning Unused file: eunit.hrl UnusedIncludes
Context
erlang_ls
version (tag/sha): 0.17.0The text was updated successfully, but these errors were encountered: