lspitzner / brittany

haskell source code formatter
GNU Affero General Public License v3.0
691 stars 67 forks source link

Parsing error on comments on type definition within instance declaration #282

Open cbeav opened 4 years ago

cbeav commented 4 years ago

I noticed an issue with brittany's comment parsing in the following:

instance HasDependencies SomeDataModel where
  -- N.B. Here is a bunch of explanatory context about the relationship
  -- between these data models or whatever.
  type Dependencies SomeDataModel
    = ( SomeOtherDataModelId
      , SomeOtherOtherDataModelId
      )

@eborden mentioned I should drop an issue here and that this should be an easy case to add a test for and address. Let me know if you need any help reproducing!

FWIW, I just skirted the issue by promoting the comment to be outside of the instance declaration. Not a high priority fix for me or else I'd probably dive in :) Just wanted to make sure it was tracked somewhere.