Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support VSCode using startup.jl #38

Open
jonniediegelman opened this issue Jul 3, 2022 · 8 comments
Open

Support VSCode using startup.jl #38

jonniediegelman opened this issue Jul 3, 2022 · 8 comments

Comments

@jonniediegelman
Copy link

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.

@BioTurboNick
Copy link
Owner

Can you please clarify "doesn't work"?

@jonniediegelman
Copy link
Author

It just prints the normal stack trace as if you weren't using AbbreviatedStackTraces.

@BioTurboNick
Copy link
Owner

BioTurboNick commented Jul 5, 2022

Hmm, so the issue is that the VSCodeServer has its own custom REPL functions. Anything that loads before it does will get overwritten.

@BioTurboNick
Copy link
Owner

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.

@axsk
Copy link
Contributor

axsk commented Aug 29, 2022

Another hotfix is delaying the laoding in startup.jl:

@async begin
    sleep(3)
    @eval using Suppressor
    @eval @suppress using AbbreviatedStackTraces
end

@ORBAT
Copy link

ORBAT commented Aug 2, 2023

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

@BioTurboNick
Copy link
Owner

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?

@BioTurboNick
Copy link
Owner

Nope, doesn't. VSCodeServer isn't defined when the extension is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants