QuasiQuotes that are not part of the Haskell standard or haskell-font-lock-quasi-quote-modes will cause haskell-indentation to be incorrect afterwards
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
Línea de trabajo
Reproduce el problema con los archivos mostrados src/DoNothing.hs y src/Lib.hs y, después, sigue el comportamiento de haskell-indentation-newline-and-indent e indent-for-tab-command alrededor de la cuasiquotation personalizada doNothing. Compara su tratamiento con [|foo|], [d|foo|] y la entrada hsx en haskell-font-lock-quasi-quote-modes. Se considera terminado cuando la indentación vuelve al nivel circundante y font-lock gestiona la cuasiquotation personalizada de forma coherente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Emacs Lisp
- Estrellas
- 1.4k
- Forks
- 357
- Merge medio
- 7 h 50 min
- PR fusionados (30 d)
- 1
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de haskell/haskell-mode
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
haskell/haskell-mode#1889 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
haskell/haskell-mode#1522 ·
-
haskell-indentation: identifier named `signature` breaks indentation for the rest of the declarationPosiblemente ocupada @PerryLink la tomó hace 48 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 78/100
haskell/haskell-mode#1895 ·
-
.hsc/CPP Can't find headers.Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
haskell/haskell-mode#1892 ·
-
Need help with haskell-modeAbierto
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
haskell/haskell-mode#1890 ·
Todos los issues de haskell/haskell-mode
Issues similares
-
area: middleware enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
enhancement good first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rohitgollarahalli/mcpx#45 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
facebookresearch/atlas-lean#20218 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100