avh4 / avh4/elm-format

End-of-line comments [tracking issue]

Open
#772 0 comments 0 reactions 0 assignees View on GitHub
discussion
Dominant language
Haskell
Stars
1.3k
Forks
147
PR merge metrics
No merged PRs in 30d

Description

This is a high-level tracking issue for end-of-line comments and having them attach to the back of the previous token instead of being attached the front of the next token.

To be considered:
- if/else branch bodies
- case branch bodies
- (maybe?) tag arguments in types (`Tag --z\n a --x\n b --y\n`)
- (maybe?) let definition bodies
- (maybe?) top-level definition bodies

Already implemented:
- https://github.com/avh4/elm-format/issues/162
- [x] after record fields in types
- [x] after record fields in expressions
- [x] after values in list expressions
- [x] after values in tuple expressions
- [x] after entries in tuple types
- [x] union type definitions
- [x] after record fields in record updates
- [x] after record fields in record extension types
- [x] in function types
- [x] in binary operator expressions
- [x] in cons patterns

Contributor guide

No contributing guide indexed for this repository

Research direction

No files, tests, or entry points are named. Read the tracking issue and linked issue 162, then investigate the formatter's existing end-of-line comment handling for the listed if/else, case, tag-argument, let-definition, and top-level-definition cases; done means the relevant comments attach to the preceding token without regressing the already implemented cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
elm, haskell
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.