Skip to content

Conversation

avh4
Copy link
Contributor

@avh4 avh4 commented May 1, 2022

No description provided.

@avh4 avh4 self-assigned this May 1, 2022
@avh4
Copy link
Contributor Author

avh4 commented Jul 26, 2022

Notes on the WIP:

I'm trying to rely on unused-do-bind, unused-matches, and unused variables warnings to indicate remaining comments that need to be captured.

imo it's probably best to just add the comments in to the AST however makes it easiest for the parser code. imo it's not worth making the parser more complex for the purpose of making the AST make more "sense" for how an end-user would think of the code being structured. It'll be relatively simple to either have a normalization layer, or to make the formatting code a bit more complex to grab the comments from wherever they are.

Also my sense of this so far it that it's probably going to be pretty tedious to add all this. My personal plan was to try to do small pieces one-by-one, picking one of the unused warnings, adding to the AST to capture that one unused comment, and then getting everything to compile and commit. And then repeat.

@avh4
Copy link
Contributor Author

avh4 commented Jul 26, 2022

Also I can't quite remember, but there's some stuff about parsing comments in main...avh4/finalize-format (as of 2022-07-26) as well... I can't remember if the Parse/Parse.Space stuff there is important w/r to this branch or not.

@robinheghan
Copy link
Member

@avh4 Just made a commit. Does my approach match what you had in mind?

@avh4
Copy link
Contributor Author

avh4 commented Jul 29, 2022

Does my approach match what you had in mind?

@robinheghan Yep, exactly!

I hadn't really thought about if we'd need the Comments to be Located or not. Did you have a thought as to why that'd be specifically useful, or did you do that by default?

@robinheghan
Copy link
Member

I thought it made sense in this case, this way we can just store a list of comments somewhere and use the location data to figure out where they fit in a later normalization step.

@avh4
Copy link
Contributor Author

avh4 commented Sep 15, 2022

Replaced by #132

@avh4 avh4 closed this Sep 15, 2022
@robinheghan robinheghan deleted the avh4/retain-comments branch June 3, 2024 18:29
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.

2 participants