"if" in comment can mess up indentaction

オープン
#479 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
52/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
rust, vim
領域
tooling

調査の方向性

Start with the referenced logic in indent/rust.vim at lines 148–149 and check how it handles the example comment before a struct block. Reproduce the indentation issue with the supplied steps, then confirm that the closing brace is no longer indented by the comment. No test file is mentioned in the issue.

索引モデルが issue の本文から書いたものです。

説明

  • rust.vim version: 4aa69b84c8a58fcec6b6dad6fe244b916b1cf830

Steps to reproduce:

  • Edit a file with "If" inside a comment, on an indented line (I believe "fn" will also trigger the issue)
  • Begin and end any block

Expected behavior: The comment shouldn't affect indenting
Actual behavior: The } char will be indented to match the indent of the comment line. Note the leading space in the example below:

/**
 * Something is wrong if rust.vim adds indent to the last line
 */

struct Foo {
 }

I believe this is due to this line, which doesn't take into account if a line is a comment or not: https://github.com/rust-lang/rust.vim/blob/master/indent/rust.vim#L148-L149

主要言語
Vim Script
スター
4.2k
フォーク
323
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rust-lang/rust.vim のほかの issue

rust-lang/rust.vim の issue をすべて見る

似ている issue

DevTools の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。