File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -252,11 +252,14 @@ type range(code1:int64, code2: int64) =
252252 try
253253 let endCol = r.EndColumn - 1
254254 let startCol = r.StartColumn - 1
255- File.ReadAllLines( r.FileName)
256- |> Seq.skip ( r.StartLine - 1 )
257- |> Seq.take ( r.EndLine - r.StartLine + 1 )
258- |> String.concat " \n "
259- |> fun s -> s.Substring( startCol + 1 , s.LastIndexOf( " \n " , StringComparison.Ordinal) + 1 - startCol + endCol)
255+ if FileSystem.IsInvalidPathShim r.FileName then " path invalid: " + r.FileName
256+ elif not ( FileSystem.SafeExists r.FileName) then " non existing file: " + r.FileName
257+ else
258+ File.ReadAllLines( r.FileName)
259+ |> Seq.skip ( r.StartLine - 1 )
260+ |> Seq.take ( r.EndLine - r.StartLine + 1 )
261+ |> String.concat " \n "
262+ |> fun s -> s.Substring( startCol + 1 , s.LastIndexOf( " \n " , StringComparison.Ordinal) + 1 - startCol + endCol)
260263 with e ->
261264 e.ToString()
262265#endif
You can’t perform that action at this time.
0 commit comments