haskell / haskell/vscode-haskell

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

未关闭
#279 8 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
status: blocked upstream type: enhancement
主要语言
TypeScript
星标
597
派生
98
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。