packages feed

hls-splice-plugin 0.2.0.0 → 0.3.0.0

raw patch · 2 files changed

+20/−4 lines, 2 filesdep ~ghcide

Dependency ranges changed: ghcide

Files

hls-splice-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version:      2.2 name:               hls-splice-plugin-version:            0.2.0.0+version:            0.3.0.0 synopsis:           HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes description:        HLS Plugin to expand TemplateHaskell Splices and QuasiQuotes. license:            Apache-2.0@@ -23,7 +23,7 @@                   , hls-plugin-api                   , ghc                   , ghc-exactprint-                  , ghcide >= 0.7.1+                  , ghcide >= 0.7.3.0                   , lens                   , dlist                   , retrie
src/Ide/Plugin/Splice.hs view
@@ -47,11 +47,12 @@ import Ide.PluginUtils (mkLspCommand, responseError) import Development.IDE.GHC.ExactPrint import Ide.Types-import Language.Haskell.GHC.ExactPrint (setPrecedingLines, uniqueSrcSpanT)+import Language.Haskell.GHC.ExactPrint (TransformT, setPrecedingLines, uniqueSrcSpanT) import Language.Haskell.LSP.Core import Language.Haskell.LSP.Messages import Language.Haskell.LSP.Types import qualified Language.Haskell.LSP.Types.Lens as J+import Retrie.ExactPrint (Annotated) import RnSplice import TcRnMonad import Data.Foldable (Foldable(foldl'))@@ -391,7 +392,10 @@             ParsedModule {..} <-                 MaybeT . runAction "splice.codeAction.GitHieAst" state $                     use GetParsedModule fp-            let spn = rangeToRealSrcSpan fp ran+            let spn =+                    rangeToRealSrcSpan ran $+                        fromString $+                            fromNormalizedFilePath fp                 mouterSplice = something' (detectSplice spn) pm_parsed_source             mcmds <- forM mouterSplice $                 \(spliceSpan, spliceContext) ->@@ -455,3 +459,15 @@             case f x of               Stop -> Nothing               resl -> foldl' (flip (<|>)) (fromSearchResult resl) (gmapQ go x)++posToRealSrcLoc :: Position -> FastString -> RealSrcLoc+posToRealSrcLoc pos fs = mkRealSrcLoc fs (line + 1) (col + 1)+    where+        line = _line pos+        col = _character pos++rangeToRealSrcSpan :: Range -> FastString -> RealSrcSpan+rangeToRealSrcSpan ran fs =+    mkRealSrcSpan+        (posToRealSrcLoc (_start ran) fs)+        (posToRealSrcLoc (_end ran) fs)