Support VSCode using startup.jl
Currently AbbreviatedStackTraces doesn't work in VSCode if you have using AbbreviatedStackTraces in your startup.jl file. If you try to using again after startup, it still doesn't work. However it does work outside of VSCode using the startup.jl file and inside of VSCode not using the startup.jl file.
Can you please clarify "doesn't work"?
It just prints the normal stack trace as if you weren't using AbbreviatedStackTraces.
Hmm, so the issue is that the VSCodeServer has its own custom REPL functions. Anything that loads before it does will get overwritten.
One possible workaround is to set and read an environment variable. The problem is that you'd lose the ability to display full traces on demand, as it couldn't tell the difference between an original REPL error and a general show call.
Another hotfix is delaying the laoding in startup.jl:
@async begin
sleep(3)
@eval using Suppressor
@eval @suppress using AbbreviatedStackTraces
end
Looks like you can also do this with atreplinit, which I guess is a bit less hacky as it hooks directly in to REPL initialisation and guarantees VSCode's REPL stuff has had time to do its thing
atreplinit() do _
@eval using AbbreviatedStackTraces
end
I wonder if, now that I have the requisite code in a package extension in the master branch, that AbbreviatedStackTraces in startup.jl works without extra tricks?
Nope, doesn't. VSCodeServer isn't defined when the extension is loaded.