QuasiQuotes that are not part of the Haskell standard or haskell-font-lock-quasi-quote-modes will cause haskell-indentation to be incorrect afterwards
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
調査の方向性
示されている src/DoNothing.hs と src/Lib.hs のファイルで問題を再現し、その後、カスタム doNothing quasiquote の周辺で haskell-indentation-newline-and-indent と indent-for-tab-command の処理を追跡します。それらの処理を [|foo|]、[d|foo|]、および haskell-font-lock-quasi-quote-modes の hsx エントリと比較します。インデントが周囲のレベルに戻り、font-lock がカスタム quasiquote を一貫して処理すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
The indent function is buggy when using anything other than hardcoded QuasiQuote.
I was editing ncaq/dic-nico-intersection-pixiv and thought haskell-indentation-newline-and-indent was wrong.
When I use QuasiQuote, the haskell-indentation-newline-and-indent inside that function and the indent-for-tab-command on TAB are strange.
Haskell standard ones such as [|foo|] and [d|foo|] and hsx in haskell-font-lock-quasi-quote-modes do not go wrong.
Reproduction procedure.
stack new foo
Add template-haskell to dependencies.
Put the following in src/DoNothing.hs.
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module DoNothing where
import Language.Haskell.TH
import Language.Haskell.TH.Quote
doNothing :: QuasiQuoter
doNothing = QuasiQuoter
{ quoteExp = litE . . stringL
, quotePat = undefined
, quoteType = undefined
, quoteDec = undefined
}
Put the following in src/Lib.hs.
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE TemplateHaskell #-}
module Lib
( someFunc
) where
import DoNothing
someFunc :: IO ()
someFunc = do
print [doNothing|aaa|]]
print "foo"
If I move the cursor over print "foo" here and invoke indent-for-tab-command with TAB, it should return to the original indentation level after a few presses, but it is fixed at a strange indentation, like this.
someFunc :: IO ()
someFunc = do
print [doNothing|aaa|]]
print "foo"
As I mentioned at the beginning, I confirmed that this does not happen with already registered Quote names such as hsx.
Also, the font-lock looks different.
I took a quick peek at the code and couldn't figure it out, so I'm reporting it anyway.
- 主要言語
- Emacs Lisp
- スター
- 1.4k
- フォーク
- 357
- 平均マージ
- 7時間 50分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haskell/haskell-mode のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
haskell/haskell-mode#1889 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
haskell/haskell-mode#1522 ·
-
haskell-indentation: identifier named `signature` breaks indentation for the rest of the declaration対応中かも @PerryLink が 48 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
haskell/haskell-mode#1895 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
haskell/haskell-mode#1892 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
haskell/haskell-mode#1890 ·
haskell/haskell-mode の issue をすべて見る
似ている issue
-
area: middleware enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
rohitgollarahalli/mcpx#45 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
facebookresearch/atlas-lean#20218 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100