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

Sublime Text: Packages marked as missing references #796

Open
fredcallaway opened this issue Jul 12, 2020 · 2 comments
Open

Sublime Text: Packages marked as missing references #796

fredcallaway opened this issue Jul 12, 2020 · 2 comments

Comments

@fredcallaway
Copy link

After following the directions here all of my non-base packages are marked as missing. I think this might be because contrib/languageserver.sh does not pass an env_path. This probably should be handled correctly down stream, but it seems that it isn't (maybe due to #391). If I edit contrib/languageserver.sh to specify an environment, the packages are correctly found.

I think @randy3k contributed this file, so he might have the best idea about what's going on.

@davidanthoff davidanthoff added this to the Backlog milestone Jul 12, 2020
@jwortmann
Copy link
Contributor

jwortmann commented Jul 13, 2020

Hi, I believe your assumption is correct that you need to pass the env_path to your project folder in the starting options. The description on readthedocs is actually a bit outdated, because some configuration keys changed at the current language server versions. And some features of the server are not available only with a simple user configuration. For personal use I made a plugin for the LSP package at https://github.com/jwortmann/LSP-julia which adds a command to easily change the current environment, and per default it will change the env_path to a currently opened Julia project when the language server starts (can be disabled in settings). In general, I would suggest to always open a folder in Sublime Text, because e.g. the linter only works in that case. My plugin is not on Package Control yet, but you could clone that repo into your Packages directory for now. Just be aware that I will probably change the plugin to use new API functions as soon as ST 4 becomes publicly available (hopefully soon), because the LSP package for ST 4 has got a lot of new and enhanced features compared to ST 3. In that case, the plugin will break on ST 3.

Additionally, if you install the Terminus package from Package Control, the plugin will add functionality to run code blocks with Alt+Enter like in VS Code. The downside of the plugin is that it doesn't use the languageserver.sh file, and therfore LSP will leave orphaned Julia processes on close in ST 3. For me, that's not a big deal because these will have 0% CPU and 0.1 MB RAM usage after a while, and I can kill them with the task manager if I want or it will happen when I turn off my PC automatically (I cannot use the Shell-script anyway because I'm on Windows). I think that this problem is also resolved already on ST 4.

Edit: the plugin I mentioned has been moved to https://github.com/sublimelsp/LSP-julia now. If anyone made a clone of my repo, adjust the URL via git remote set-url origin https://github.com/sublimelsp/LSP-julia. It should work fine on Sublime Text 3, but if there are any problems or feature requests, please open an issue there. (cc @fredcallaway, @randy3k )

Regarding this issue here, I believe there are some considerations to remove the env_path from the starting options in the future and use the protocol's configuration system instead, see #748. In that case it gets fetched via the workspace/configuration request, and clients can send changes via workspace/didChangeConfiguration notification. As a workaround, #772 might make it easier for now (I haven't tried it yet), but that still seems to require a small adjustment in contrib/languageserver.sh.

@prassee
Copy link

prassee commented Jul 22, 2021

Any update on this , I still face this issue on latest stable release of ST4

@davidanthoff davidanthoff removed this from the Backlog milestone Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants