diff --git a/src/exception_types.jl b/src/exception_types.jl index ae5302d0..c653f71d 100644 --- a/src/exception_types.jl +++ b/src/exception_types.jl @@ -64,8 +64,9 @@ end struct LSInvalidFile <: Exception msg::AbstractString + uri::URI end function Base.showerror(io::IO, ex::LSInvalidFile) - print(io, ex.msg) + print(io, ex.msg, " File: '", uri2filepath(ex.uri), "'") end diff --git a/src/textdocument.jl b/src/textdocument.jl index 3c972ff1..95faa96c 100644 --- a/src/textdocument.jl +++ b/src/textdocument.jl @@ -8,7 +8,7 @@ struct TextDocument function TextDocument(uri::URI, text::AbstractString, version::Int, lid = nothing) # TODO Remove this check eventually - occursin('\0', text) && throw(LSInvalidFile("Tried to set a text with an embedded NULL as the document content.")) + occursin('\0', text) && throw(LSInvalidFile("Tried to set a text with an embedded NULL as the document content.", uri)) line_offsets = _compute_line_offsets(text) line_indices = _compute_line_indices(text)