diff --git a/Project.toml b/Project.toml index 6a4255f..ab46e9a 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "AbbreviatedStackTraces" uuid = "ac637c84-cc71-43bf-9c33-c1b4316be3d4" authors = ["Nicholas Bauer "] -version = "0.1.13" +version = "0.1.14" [deps] Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b" diff --git a/src/AbbreviatedStackTraces.jl b/src/AbbreviatedStackTraces.jl index 24779ba..6eb1ee6 100644 --- a/src/AbbreviatedStackTraces.jl +++ b/src/AbbreviatedStackTraces.jl @@ -21,7 +21,9 @@ import Base.StackTraces: is_top_level_frame, stacktrace -is_ide_support(path) = false # replacable by IDE environment +if !isdefined(@__MODULE__, :is_ide_support) + is_ide_support(path) = false # fallback if not defined +end is_repl(path) = startswith(path, r"(.[/\\])?REPL") is_julia_dev(path) = contains(path, r"[/\\].julia[/\\]dev[/\\]") is_julia(path) = diff --git a/src/override-vscode.jl b/src/override-vscode.jl index cccb719..fe09a33 100644 --- a/src/override-vscode.jl +++ b/src/override-vscode.jl @@ -1,6 +1,11 @@ __precompile__(false) try + if isdefined(Main, :VSCodeServer) + @eval (@__MODULE__) begin + is_ide_support(path) = contains(path, r"[/\\].vscode[/\\]") + end + end @eval Main begin import .VSCodeServer: crop_backtrace, @@ -13,8 +18,6 @@ try import Base.StackTraces: stacktrace - is_ide_support(path) = contains(path, r"[/\\].vscode[/\\]") - function display_repl_error(io, err, bt) ccall(:jl_set_global, Cvoid, (Any, Any, Any), Main, :err, AbbreviatedStackTraces.ExceptionStack([(exception = err, backtrace = bt)])) st = stacktrace(VSCodeServer.crop_backtrace(bt))