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

"[Error] tl types has returned an empty response" whenever I open a tl file #34

Closed
horatiohafnaugels opened this issue Feb 26, 2021 · 10 comments
Labels
bug Something isn't working

Comments

@horatiohafnaugels
Copy link

horatiohafnaugels commented Feb 26, 2021

Whenever I open or save a tl file with VS Code I get this error:
[Error] tl types has returned an empty response

I'm using the latest precompiled binary version of tl (0.11.2+dev) on Windows 10 and the latest version of vscode-teal available on the marketplace (v0.7.4).

@pdesaulniers
Copy link
Member

pdesaulniers commented Feb 26, 2021

Thanks for the bug report. On the command line, can you try running tl types <filename> on one of the files that are causing the error? You should see a JSON response.

@pdesaulniers
Copy link
Member

pdesaulniers commented Feb 26, 2021

Now that I think of it, the extension might have some trouble picking up the tl executable because it assumes tl is a .bat script, not an .exe: #11

@pdesaulniers pdesaulniers added the bug Something isn't working label Feb 26, 2021
@horatiohafnaugels
Copy link
Author

horatiohafnaugels commented Feb 26, 2021

Thanks for the bug report. On the command line, can you try running tl types <filename> on one of the files that are causing the error? You should see a JSON response.

tl types <filename> invoked from the command line works as expected, producing the JSON response.

@pdesaulniers
Copy link
Member

pdesaulniers commented Feb 26, 2021

The issue should be fixed on latest master. I will push the fix to the marketplace as soon as tl gets a new release.

@pdesaulniers
Copy link
Member

pdesaulniers commented Feb 27, 2021

@horatiohafnaugels @evanpaul22 I pushed a new release, does it work now?

@evanpaul
Copy link

evanpaul commented Feb 27, 2021

@pdesaulniers That error went away for me!

I have a new (likely unrelated) error "[Error] Could not find the tl executable Please make sure that is available in the PATH"

This definitely seems like a me problem though; I actually have luarocks and tl installed on my Ubuntu WSL. Probably the answer would be to install them both outside of WSL and add tl to the PATH like mentioned

@pdesaulniers
Copy link
Member

pdesaulniers commented Feb 27, 2021

@evanpaul22 Yeah, on Windows, the extension tries to invoke tl using the default shell (generally cmd.exe).

As a workaround, you could probably create a shell script called tl.bat to serve as a bridge between cmd.exe and WSL. Something like this (disclaimer: I didn't test it!)

@echo off
wsl.exe tl %*

Then, just make sure the script is available in the PATH outside of WSL, so that the extension can detect it.

@evanpaul
Copy link

@evanpaul22 Yeah, on Windows, the extension tries to invoke tl using the default shell (generally cmd.exe).

As a workaround, you could probably create a shell script called tl.bat to serve as a bridge between cmd.exe and WSL. Something like this (disclaimer: I didn't test it!)

@echo off
wsl.exe tl %*

Then, just make sure the script is available in the PATH outside of WSL, so that the extension can detect it.

Clever! I'll give it a try. Thanks!

@pdesaulniers
Copy link
Member

@evanpaul22 On second thoughts, you might run into some issues, considering that Windows-style paths differ from POSIX-style paths:

# POSIX
/somedir/myfile

# Win32
C:\\somedir\\myfile

tl inside WSL might not be able to understand Windows-style paths. (Also, I don't know how require() would behave with this setup :))

Anyway, I'm closing this issue in favor of #35.

@horatiohafnaugels
Copy link
Author

@horatiohafnaugels @evanpaul22 I pushed a new release, does it work now?

Yes, it does. Thank you a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants