-
Notifications
You must be signed in to change notification settings - Fork 6
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
Allow use of custom JANET_PATH/JANET_TREE etc. #7
Comments
I've been working on this over the last few days and I might have a (temporary?) solution for you. Could you please try running |
I'm currently using it via the vscode extension, how can I run a custom lsp server with it? |
I just realized that this may be more of a problem with https://github.com/CFiggers/vscode-janet-plus-plus |
I don't have this option, possibly because I'm using the OSS version of vscode. |
Ah, understood—here, let me push the update to the Open VSX registry so you can give it a try. |
That's live now on Open VSX—I don't know how long it will take to propagate but once you see it it should be good to go :) |
Thanks! I just tried it out, and it works, no configuration needed! |
I appreciate the question! 🙂 Which "it" are you referring to? The LSP as a whole? Or specifically this update that makes it work with user-local installs? Assuming you probably mean the latter, it's working by shipping a .jimage file rather than a compiled executable, which is what we were doing before. The extension checks your path to make sure that That has a couple of benefits—for starters, it's intrinsically cross-platform (Windows, Linux, Mac, BSD, NixOS) and architecture-indifferent (x86_64, Arm64, M1 Apple Silicon, Raspberry PI, RISC-V, even TIC-80 I presume—anywhere Janet works, the LSP should also work seamlessly). And all that WITHOUT needing me to compile and ship separate executables for each OS/Architecture combo. Janet runs as an Abstract Machine anyhow, may as well get the benefits of it! Second, since it's running on YOUR Janet install, it'll always have access to any libraries you have installed and it'll error on any you don't—I don't need to know in advance what you have installed, or don't, or where you put them. If YOUR Janet can find a module, then so can the LSP, because it's literally running on YOUR copy of Janet. That also means the LSP can warn you when you are trying to import a library that you haven't installed yet. Third, we shouldn't have any issues with Janet version mismatches, like if you update your Janet to 1.32.1 but the last time I built and distributed Janet++ I was running Janet 1.31 (this happened last week—there's a closed issue about it somewhere). From this update on, the LSP is running on YOUR Janet, whatever version that may be. So, for e.g., if bakpakin adds new core functions in 1.33 and you update, those will automatically be recognized for hover-over documentation (since YOUR updated Janet will have them in its environment table, so the hover function will have access to call There's nothing magic about the .jimage specifically, all the same benefits would apply if I shipped the full Janet source for the LSP and had Janet run it as a script. The .jimage just saves a bit of startup time because Janet doesn't have to compile before running, and it makes the build process on my end a little cleaner, since the LSP can ship as a single .jimage file rather than multiple .janet files in a directory tree. |
I see, cool setup! |
I have a setup where my Janet deps live in a user-local folder, allowing the user to specify things like the $JANET_LIBPATH, $JANET_PATH, $JANET_PROFILE, $JANET_HEADERPATH etc. would allow users to use their custom environments.
The text was updated successfully, but these errors were encountered: