foundry icon indicating copy to clipboard operation
foundry copied to clipboard

`forge fmt` fail to parse code when struct have comment

Open thasarito opened this issue 2 years ago • 3 comments

Component

Forge

Have you ensured that all of these are up to date?

  • [X] Foundry
  • [X] Foundryup

What version of Foundry are you on?

forge 0.2.0 (cce3a44 2022-07-20T00:15:31.034352Z)

What command(s) is the bug in?

forge fmt

Operating System

macOS (Apple Silicon)

Describe the bug

Running forge fmt with file that have comment inside struct like this

struct Foo {
  /// @notice bar
  uint256 bar;
  /// @notice baz;
  uint256 baz;
}

will throw Failed to parse Solidity code error.

thasarito avatar Jul 20 '22 09:07 thasarito

Can I pick it up if it's relevant?

7sne avatar Jul 20 '22 21:07 7sne

I'd assume this error is in solang-parser since that's the parser we use for the formatter

onbjerg avatar Jul 21 '22 19:07 onbjerg

It seems that that as of forge 0.2.0 (63ed109 2022-08-09T00:03:50.892098571Z) this issue is solved.

CodeSandwich avatar Aug 09 '22 15:08 CodeSandwich