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 e5fcadb commit 22a9339Copy full SHA for 22a9339
plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Handlers.hs
@@ -34,7 +34,8 @@ import Data.Foldable (toList)
34
import Data.List (dropWhileEnd,
35
find,
36
intercalate,
37
- intersperse)
+ intersperse,
38
+ unsnoc)
39
import qualified Data.Map as Map
40
import Data.Maybe (catMaybes)
41
import Data.String (IsString)
@@ -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