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

Convert roxygen comments to documentation #305

Merged
merged 7 commits into from
Jul 10, 2020

Conversation

renkun-ken
Copy link
Member

@renkun-ken renkun-ken commented Jul 7, 2020

Close #304

This PR imports roxygen2 and implements convert_comment_to_documentation where roxygen2::parse_text() is tried to parse comments as roxygen tags to provide structured documentation.

The information presented in hover contains all parsed roxygen tags presented in markdown format while only description is presented in completion resolve of symbol and function arguments and function signature, which is consistent with currently presented information provided by these providers.

Following is a screencast:

Kapture 2020-07-07 at 22 47 05

@renkun-ken renkun-ken requested a review from randy3k July 8, 2020 14:21
@renkun-ken
Copy link
Member Author

renkun-ken commented Jul 9, 2020

There are several known limitations currently:

  • The Rd tags (e.g. \code{}, \emph{}, \url{}) are not handled. roxygen2md could convert the tags but I'd rather leave them unhandled at the moment to keep the implementation clean.
  • R6 roxygen tags could be non-continuous lines of roxygen comments. I don't handle such case at the moment but only take the comment lines above the symbol definition, like other symbols.

I believe this PR is ready to merge. We could always improve the implementation if requested.

@renkun-ken renkun-ken merged commit 894c72c into REditorSupport:master Jul 10, 2020
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.

Roxygen example code messes up documentation
2 participants