QuasiQuotes that are not part of the Haskell standard or haskell-font-lock-quasi-quote-modes will cause haskell-indentation to be incorrect afterwards
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
Direzione di ricerca
Riproduci il problema con i file mostrati src/DoNothing.hs e src/Lib.hs, quindi segui il comportamento di haskell-indentation-newline-and-indent e indent-for-tab-command attorno alla quasiquotazione personalizzata doNothing. Confronta la loro gestione con [|foo|], [d|foo|] e la voce hsx in haskell-font-lock-quasi-quote-modes. Il lavoro è completo quando l'indentazione torna al livello circostante e font-lock gestisce la quasiquotazione personalizzata in modo coerente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Emacs Lisp
- Stelle
- 1.4k
- Fork
- 357
- Merge medio
- 7h 50m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di haskell/haskell-mode
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
haskell/haskell-mode#1889 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 65/100
haskell/haskell-mode#1522 ·
-
haskell-indentation: identifier named `signature` breaks indentation for the rest of the declarationForse già presa @PerryLink l’ha presa 48 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 78/100
haskell/haskell-mode#1895 ·
-
.hsc/CPP Can't find headers.Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
haskell/haskell-mode#1892 ·
-
Need help with haskell-modeAperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
haskell/haskell-mode#1890 ·
Tutte le issue di haskell/haskell-mode
Issue simili
-
area: middleware enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
rohitgollarahalli/mcpx#45 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
facebookresearch/atlas-lean#20218 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100