Skip to content
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

Edoc diagnostics #1213

Merged
merged 4 commits into from
Feb 19, 2022
Merged

Edoc diagnostics #1213

merged 4 commits into from
Feb 19, 2022

Conversation

robertoaloi
Copy link
Member

Description

This PR introduce support for edoc diagnostics.

Screenshot 2022-02-19 at 15 50 56

There are a couple of limitations in the current edoc API:

  • The list of errors and warnings is simply printed out using the stdio and not returned to the caller
  • The process exits at the first error occurrence

An issue has been created for the OTP team to address these.
The current solution (ab)uses the process dictionary, a fork of the edoc_report module and a try/catch to temporarily circumvent these limitations.

This diagnostics backend is disabled by default. To enable it, add the following to your erlang_ls.config:

diagnostics:
  enabled:
    - edoc

Fixes #384.

@robertoaloi robertoaloi force-pushed the edoc-diagnostics branch 2 times, most recently from 0767d5e to d7f73cb Compare February 19, 2022 15:50
The priv directory contains some intentional broken edocs, but early versions of edoc try to generate edoc for those, too
@robertoaloi
Copy link
Member Author

robertoaloi commented Feb 19, 2022

@garazdawi Do you know if it's a known fact that in OTP 24+ edoc does not generate documentation for files contained in a project priv directory?

@robertoaloi robertoaloi merged commit ca11c06 into main Feb 19, 2022
@robertoaloi robertoaloi deleted the edoc-diagnostics branch February 19, 2022 18:05
@garazdawi
Copy link
Contributor

Do you know if it's a known fact that in OTP 24+ edoc does not generate documentation for files contained in a project priv directory?

No, I don't know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run edoc to generate diagnostics
2 participants