Skip to content

Implement comment handling for haskell-indentation-mode #1034

Open
@gracjan

Description

@gracjan

Comments are a bit special when it goes with indentation. Usually we want to align comments to a similar comment in previous line, failing that we want to align to tokens in previous line. But we cannot treat comments just like token because it would break valid code, so we need to align tokens to tokens only.

For example:

main = do
  code 1
       -- comment 1
       -- comment 2
  code 2

Above we want comment 2 to align to comment 1, but code 2 to align to code 1.

As far as I understand this can be achieved by marking some eligible positions as 'comment only eligigle'.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions