Skip to content

Conversation

karrtikr
Copy link

@karrtikr karrtikr commented Nov 10, 2021

@heejaechang
Copy link

@karrtikr what would be best way for me to test it? can I download vsix?

@karrtikr
Copy link
Author

karrtikr commented Nov 11, 2021

@heejaechang Yep you can use the VSIX from the latest run, which is https://github.com/microsoft/vscode-python/suites/4321020335/artifacts/113044846.

export const onDidChangeTestResults: Event<void>;
}

export namespace workspace {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Proposed? Is this not in their stable API?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is but updating vscode types involves a lot of stuff #17656, so we're temporarily going with this hack.

@heejaechang
Copy link

heejaechang commented Nov 12, 2021

I installed the vsix and tried on untrusted path and python extension is disabled?

image

pylance correctly show untrusted workspace thing
image

as we set in package.json

 "capabilities": {
        "untrustedWorkspaces": {
            "supported": "limited",
            "description": "Python will not be executed; the latest Python version will be used for analysis and installed libraries will not be available."
        },

but python extension is just plain disabled.
image

@karrtikr
Copy link
Author

Weird, it activates just fine for me. Does your extension version and the package.json message match?

image

@karrtikr karrtikr added the skip package*.json package.json and package-lock.json don't both need updating label Nov 15, 2021
@karrtikr karrtikr marked this pull request as ready for review November 15, 2021 12:24
@karrtikr karrtikr added this to the November 2021 milestone Nov 15, 2021
@heejaechang
Copy link

@karrtikr let me try again with vsix in this PR

@heejaechang
Copy link

@karrtikr alright, it works as expected once I re-installed vsix from latest build. I tested a bit and Pylance works as expected.

@heejaechang
Copy link

@karrtikr I tested virtual workspace as well (with GitHub Repositories extension), mostly it works as expected. but internally, there seems some stuff Pylance need to sort out (mostly around uri and file system access) but end user experience seems mostly what we would expect.

except one thing. even in virtual workspace scenario, trusted workspace concept seems to apply as you can see below

image

that I can make trusted

image

and status bar change to this

image

I am not sure what it meant to be trusted in virtual workspace environment. usually trusted means not file access but permission to execute exe (ex, python). are we going to let user to choose python (including venv) that are installed on local machine with virtual workspace?

code seems doesn't care about virtual workspace when passing python path though but only care about whether it is trusted or not. (and vscode code seems let user to trust virtual workspace).

@karrtikr
Copy link
Author

Thanks for testing this!

are we going to let user to choose python (including venv) that are installed on local machine with virtual workspace?

Yep we discussed it here #17519 (comment), that way users can hover over the libraries they have installed for a particular interpreter. There's no reason to block it AFAICS, do you see any potential issues?

@karrtikr karrtikr marked this pull request as draft November 16, 2021 15:04
@karrtikr karrtikr marked this pull request as ready for review November 19, 2021 17:22
@karrtikr karrtikr changed the title Make Pylance work with untrusted workspaces Declare limited support for untrusted workspaces by only supporting Pylance Nov 19, 2021
@karrtikr karrtikr merged commit b96b9fb into microsoft:main Nov 19, 2021
@karrtikr karrtikr deleted the pylancetusted branch November 19, 2021 18:12
wesm pushed a commit to posit-dev/positron that referenced this pull request Mar 28, 2024
…ylance (microsoft/vscode-python#17998)

* Untrusted workspaces

* Reactivate extension when trust is granted to a workspace

* If Jedi is selected as language server, do not activate it

* Only send telemetry which is applicable for untrusted workspaces
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip package*.json package.json and package-lock.json don't both need updating
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make Pylance work with untrusted workspaces Support Workspace Trust
4 participants