Skip to content

Commit

Permalink
v0.1.14; Fix detection of VSCodeServer frames
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick committed Sep 14, 2023
1 parent 6a5ee72 commit 9335d91
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "AbbreviatedStackTraces"
uuid = "ac637c84-cc71-43bf-9c33-c1b4316be3d4"
authors = ["Nicholas Bauer <[email protected]>"]
version = "0.1.13"
version = "0.1.14"

[deps]
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Expand Down
4 changes: 3 additions & 1 deletion src/AbbreviatedStackTraces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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) =
Expand Down
7 changes: 5 additions & 2 deletions src/override-vscode.jl
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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))
Expand Down

2 comments on commit 9335d91

@BioTurboNick
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/91390

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.14 -m "<description of version>" 9335d91f07c7d51ac479868a1687469ab9d51178
git push origin v0.1.14

Please sign in to comment.