We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent caa1c32 commit 64e235aCopy full SHA for 64e235a
plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs
@@ -85,6 +85,7 @@ import qualified Development.IDE.GHC.Compat.Core as SrcLoc (unLoc)
85
import Development.IDE.Types.HscEnvEq (HscEnvEq (hscEnv))
86
import qualified GHC.LanguageExtensions.Type as LangExt (Extension (..))
87
88
+import Data.List.Extra (unsnoc)
89
import Development.IDE.Core.FileStore (setSomethingModified)
90
import Development.IDE.Core.PluginUtils
91
import Development.IDE.Types.Shake (toKey)
@@ -317,7 +318,7 @@ finalReturn :: Text -> TextEdit
317
318
finalReturn txt =
319
let ls = T.lines txt
320
l = fromIntegral $ length ls -1
- c = fromIntegral $ T.length . last $ ls
321
+ c = fromIntegral $ T.length $ maybe T.empty snd (unsnoc ls)
322
p = Position l c
323
in TextEdit (Range p p) "\n"
324
0 commit comments