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

Enable Workspace Trust #8048

Open
timheuer opened this issue Mar 7, 2025 · 4 comments
Open

Enable Workspace Trust #8048

timheuer opened this issue Mar 7, 2025 · 4 comments

Comments

@timheuer
Copy link
Member

timheuer commented Mar 7, 2025

Related microsoft/vscode-dotnettools#1774

As the C# Dev Kit examines changes to workspace trust, due to the dependency, they would need to match. C#DK cannot say 'trusted' and if C# remains restricted (default when not specified). Based on the documentation, C# should add the capability to say trusted.

Capabilities: code.visualstudio.com/api/extension-guides/workspace-trust

See also discussion: microsoft/vscode#240856 (comment)

@JoeRobich
Copy link
Member

@timheuer I do not believe C# should be 'supported' in untrusted workspaces, or if so, it should be limited and we do not launch the LSP. When CDK sees that trust has been granted it could prompt the user to reload the window as we do when some settings change.

const reloadTitle: CommandOption = {
title: vscode.l10n.t('Reload Window'),
command: 'workbench.action.reloadWindow',
};

@timheuer
Copy link
Member Author

@JoeRobich see the discussion at the VSCode issue mentioned above. Quite a bit of discussion about this. The general sense is that what we are doing should be ‘okay’ to the trusted workspace.

@JoeRobich
Copy link
Member

The general sense is that what we are doing should be ‘okay’ to the trusted workspace.

I think we may need to think through the things that we will be doing and lighting things up on a case by case basis. I am not sure we should sign up for running MSBuild targets or Roslyn Analyzers in an untrusted workspace. Advertising 'limited' support and getting the minimum functionality registered in order to help users get to a better (trusted) experience seems reasonable.

@dibarbet
Copy link
Member

I am not sure we should sign up for running MSBuild targets or Roslyn Analyzers in an untrusted workspace.

Agreed - analyzers / msbuild targets can run arbitrary code and I don't believe are safe to run in untrusted mode.

Advertising 'limited' support and getting the minimum functionality registered in order to help users get to a better (trusted) experience seems reasonable.

Fine with potentially delaying the launch of the server until we are in trusted mode. There is a request to delay LSP startup to reduce the time we take on the extension host thread in activation anyway. But we need to define what exactly the C# extension should do while in untrusted mode - do we disable everything and just activate (to allow dev kit to provide additional functionality)? Do we allow any of our commands to run (debugger attach, etc)?

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

3 participants