@@ -8,6 +8,8 @@ module Idris.Parser(module Idris.Parser,
9import Prelude hiding (pi)
9import Prelude hiding (pi)
11+import qualified System.Directory as Dir (makeAbsolute)
11import Text.Trifecta.Delta
13import Text.Trifecta.Delta
12import Text.Trifecta hiding (span, stringLiteral, charLiteral, natural, symbol, char, string, whiteSpace, Err)
14import Text.Trifecta hiding (span, stringLiteral, charLiteral, natural, symbol, char, string, whiteSpace, Err)
13import Text.Parser.LookAhead
15import Text.Parser.LookAhead
@@ -1244,7 +1246,8 @@ parseImports fname input
1244 Failure err -> fail (show err)
1246 Failure err -> fail (show err)
1245 Success (x, annots, i) ->
1247 Success (x, annots, i) ->
1246 do putIState i
1248 do putIState i
1249+ fname' <- runIO $ Dir.makeAbsolute fname
1247− sendHighlighting (addPath annots fname)
1250+ sendHighlighting $ addPath annots fname'
1248 return x
1251 return x
1249 where imports :: IdrisParser ((Maybe (Docstring ()), [String],
1252 where imports :: IdrisParser ((Maybe (Docstring ()), [String],
1250 [ImportInfo],
1253 [ImportInfo],
@@ -1263,7 +1266,7 @@ parseImports fname input
1263 addPath :: [(FC, OutputAnnotation)] -> FilePath -> [(FC, OutputAnnotation)]
1266 addPath :: [(FC, OutputAnnotation)] -> FilePath -> [(FC, OutputAnnotation)]
1264 addPath [] _ = []
1267 addPath [] _ = []
1265 addPath ((fc, AnnNamespace ns Nothing) : annots) path =
1268 addPath ((fc, AnnNamespace ns Nothing) : annots) path =
1266− (fc, AnnNamespace ns (Just path)) : addPath annots path
1269+ (fc, AnnNamespace ns (Just path)) : addPath annots path
1267 addPath (annot:annots) path = annot : addPath annots path
1270 addPath (annot:annots) path = annot : addPath annots path
1269-- | There should be a better way of doing this...
1272-- | There should be a better way of doing this...
@@ -1390,7 +1393,10 @@ loadSource lidr f toline
1390 IDR fn -> Just fn
1393 IDR fn -> Just fn
1391 LIDR fn -> Just fn
1394 LIDR fn -> Just fn
1392 _ -> Nothing
1395 _ -> Nothing
1396+ srcFnAbs <- case srcFn of
1397+ Just fn -> fmap Just (runIO $ Dir.makeAbsolute fn)
1398+ Nothing -> return Nothing
1393− sendHighlighting [(nfc, AnnNamespace ns srcFn)])
1399+ sendHighlighting [(nfc, AnnNamespace ns srcFnAbs)])
1394 [(re, fn, ns, nfc) | ImportInfo re fn _ ns _ nfc <- imports]
1400 [(re, fn, ns, nfc) | ImportInfo re fn _ ns _ nfc <- imports]
1395 reportParserWarnings
1401 reportParserWarnings