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

Improve environment handling #871

Merged
merged 25 commits into from
May 26, 2021
Merged

Improve environment handling #871

merged 25 commits into from
May 26, 2021

Conversation

ZacLN
Copy link
Contributor

@ZacLN ZacLN commented Jan 27, 2021

julia-vscode/StaticLint.jl#251

This is now in a state in which it's worth a discussion.

The general idea -

  • a vscode session has a 'global env', a proper env with a manifest and project file.
  • Each root file (i.e. a Document that is not included by another one) get's assigned a subset of the packages in the global env. This assignment is done by checking which workspace folder the root doc is in.
  • A workspace folder creates a separate env if it has a project file and is part of the global env.

Example:

Global environment: ~.julia/environments/v1.7
workspace folders ["~/.julia/dev/CSTParser", "~/.julia/dev/StaticLint"]

I have both those projects in the global env.

  • "~/.julia/dev/CSTParser/src/CSTParser.jl": Gets all the dependencies specified in "~/.julia/dev/CSTParser/Project.toml" (they're all available from the global env). CSTParser itself is not included.
  • "~/.julia/dev/CSTParser/test/runtests.jl": Get's the above packages but also CSTParser and anything included in the extras section of the project file.
  • "~/Documents/someotherfile.jl": Gets all packages from the global env (everything in the manifest, not limited to direct dependencies)

EDIT. In terms of the code - there are a lot of lines touched but most of this is just ensuring we're passing the appropriate ExternalEnv to various functions. Substantive changes are to languageserverinstance.jl, textdocument.jl and staticlint.jl

closes julia-vscode/julia-vscode#1248

@ZacLN ZacLN self-assigned this Jan 27, 2021
@ZacLN ZacLN mentioned this pull request Jan 27, 2021
9 tasks
@ZacLN ZacLN marked this pull request as ready for review February 4, 2021 13:09
@ZacLN ZacLN added this to the Next Minor milestone Feb 4, 2021
@ZacLN ZacLN changed the title compat for symbolserver env branch Improve environment handling Feb 4, 2021
@pfitzseb
Copy link
Member

We'll also need to figure out how this interacts with the env selector widget we have in VSCode, right?

@ZacLN
Copy link
Contributor Author

ZacLN commented Feb 10, 2021

Yeah, for the PR as-is the widget controls the global env

@pfitzseb
Copy link
Member

Ok that's probably fine for now. I'll try to review this tonight or tomorrow.

@davidanthoff
Copy link
Member

Would the idea be that we include this in 1.2, or for later? Should we first finish the cloud downloading stuff, and support for virtual environments? For now I'm not putting that on the list of PRs to include in 1.2, but let me know if you think otherwise.

@oppo-source oppo-source removed the request for review from a team April 16, 2021 07:35
@davidanthoff davidanthoff modified the milestones: Next Minor, Backlog May 12, 2021
@pfitzseb
Copy link
Member

Ok, I think we should get this in for 1.2 because we need some changes in LanguageServer.jl after merging julia-vscode/StaticLint.jl#251.

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

Successfully merging this pull request may close these issues.

Scope for using/import package name completions too wide?
3 participants