haskell / haskell/vscode-haskell

Automatically add `-- ` when pressing enter in a comment

Open
#279 8 comments 2 reactions 0 assignees View on GitHub
status: blocked upstream type: enhancement
Dominant language
TypeScript
Stars
597
Forks
98
PR merge metrics
No merged PRs in 30d

Description

A minor but nice feature I would like to propose is to automatically add `-- ` on the new line when pressing "enter" in a comment/documentation.

Example (cursor position represented by `[]`) below.

# Current behavior
```haskell
-- | Somme doc[]
foo = "hello world"
```
Press enter
```haskell
-- | Somme doc
[]
foo = "hello world"
```

# Proposed behavior
```haskell
-- | Somme doc[]
foo = "hello world"
```
Press enter
```haskell
-- | Somme doc
-- []
foo = "hello world"
```

I think this default behavior makes much more sense for developers.

To be discussed: should we do the same when in a regular comment? I'd say "no" but I am not strongly opinionated on this one.

Cheers

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.