Skip to content

[pigeon] Comments starting with //// break compilation of generated code using C++-style blocks #115657

Closed
flutter/packages
#2825

Description

@marynovskyi

After updating pigeon from 3.2.3 to 4.2.5 I'm getting error because pigeon parses comments from initial file (which is used to generate the code for Dart, Java, ObjC from).

If I have a comment in code like this:

`///////////////////////////////////////////////////////////////////////////////
// Comment
///////////////////////////////////////////////////////////////////////////////

class SomeStuff {
}`

it results in this for Java:

`/**
*////////////////////////////////////////////////////////////////////////////
*////////////////////////////////////////////////////////////////////////////
*

  • Generated class from Pigeon that represents data sent in messages.
    */
    public static class SomeStuff {
    }`

As you can see, two longs lines are being parsed for some reason and breaks the code formatting which doesn't allow to compile the project

Activity

  1. added
    c: regressionIt was better in the past than it is now
    packageflutter/packages repository. See also p: labels.
    p: pigeonrelated to pigeon messaging codegen tool
    P2Important issues not at the top of the work list
    on Nov 18, 2022
  2. stuartmorgan-g commented on Nov 18, 2022

    @stuartmorgan-g
    Contributor

    As you can see, two longs lines are being parsed for some reason

    /// is the Dart standard for doc comments, and Pigeon now carries doc comments over into generated files to make the APIs easier to consume in native code.

    We'll need to add special handling when the first character of a doc comment is / when generating C++-style comment blocks.

  3. changed the title [-][pigeon] comments are parsed with code resulting in code errors[/-] [+][pigeon] Comments starting with `////` break compilation of generated code using C++-style blocks[/+] on Nov 18, 2022
  4. added
    P1High-priority issues at the top of the work list
    and removed
    P2Important issues not at the top of the work list
    on Nov 18, 2022
  5. self-assigned this
    on Nov 18, 2022
  6. github-actions commented on Dec 3, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  7. locked as resolved and limited conversation to collaborators on Dec 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowp: pigeonrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions