Skip to content

[unstable option] format_code_in_doc_comments #3348

Open
1 of 10 issues completed
Open

Description

@scampi

Tracking issue for unstable option: format_code_in_doc_comments

Activity

  1. changed the title [-][unstable option] unstable option: format_doc_comments[/-] [+][unstable option] format_doc_comments[/+] on Feb 13, 2019
  2. carllerche commented on May 10, 2019

    @carllerche

    What is left to stabilize this?

  3. shepmaster commented on May 14, 2019

    @shepmaster
    Member

    Running this seemed to work well for me!

  4. carllerche commented on May 14, 2019

    @carllerche

    I would like to use this as part of tokio and other crates, but I am hesitant to include unstable features at this point.

  5. scampi commented on May 16, 2019

    @scampi
    ContributorAuthor

    In #3535 the option got renamed to format_code_in_doc_comment. With that maybe now is a good time to go through the stabilisation process for this option.

  6. JelteF commented on Nov 2, 2019

    @JelteF

    This option is great. Would it be possible to use this to fix #2036 as well?

    One thing I did notice is that it doesn't format code that is hidden by prefixing it with a #. It's not terrible but it would be nice if that was also formatted. So in this example the foo function is not formatted:

    /// ```rust
    /// # fn foo() {if false{println!("hello")} // this function will be hidden
    /// println!("Hello, World!");
    /// ```
    
  7. topecongiro commented on Nov 5, 2019

    @topecongiro
    Contributor

    One thing I did notice is that it doesn't format code that is hidden by prefixing it with a #. It's not terrible but it would be nice if that was also formatted. So in this example the foo function is not formatted:

    @JelteF It's somewhat tricky to figure out the corresponding lines between the input and the output:

    /// ```rust
    /// # fn foo() {
    /// # if false {
    /// #     println!("hello")
    /// # }
    /// println!("Hello, World!");
    /// ```
    

    In the above example we need to add # prefix to cover the entire fn foo() { ... }.

  8. dianpopa commented on Jan 20, 2020

    @dianpopa

    In #3535 the option got renamed to format_code_in_doc_comment. With that maybe now is a good time to go through the stabilisation process for this option.

    I'd really like to see this feature stabilized. Are there any plans regarding it?

  9. added a commit that references this issue on Apr 20, 2020
  10. Nemo157 commented on Oct 6, 2020

    @Nemo157
    Contributor

    One thing I would really like with this is a separate max_width setting. It appears it is using the standard max_width (not even the comment_width) but I much prefer using a max width of ~60 columns in examples as the space they are shown in in the documentation is commonly limited.

    EDIT: Actually, playing around with changing max_width and comment_width don't seem to affect this at all.

  11. changed the title [-][unstable option] format_doc_comments[/-] [+][unstable option] format_code_in_doc_comment[/+] on Jul 26, 2022
  12. changed the title [-][unstable option] format_code_in_doc_comment[/-] [+][unstable option] format_code_in_doc_comments[/+] on Jul 27, 2022
  13. 11 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions