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

Project selection always visible #19102

Open
bornachk opened this issue Dec 18, 2024 · 4 comments
Open

Project selection always visible #19102

bornachk opened this issue Dec 18, 2024 · 4 comments

Comments

@bornachk
Copy link

bornachk commented Dec 18, 2024

Type: Feature Request

Current Behavior

The issue manifests whenever a C# solution that does not contain any Uno Platform projects is discovered while the Uno Platform extension is loaded.

Expected Behavior

Uno Platform detects that there are no Uno Platform projects in the current solution and disables the project selection (red by default when sln is seleced, normal color when a loadable csproj is selected)

How to reproduce it (as minimally and precisely as possible)

Create a new solution and console project, and include the project in the solution.

Workaround

The Uno Platform extension can be hidden from the status bar. However this means for actual Uno Platform projects, the project selection will not be usable.

Extension Status

Extension: Dev Kit Mode
Debugger: Ready
Hot-Reload: Inactive
XAML LSP: Ready

Environment information

  • Platform: linux 6.8.0-49-generic (x64)
  • VSCode version: 1.95.3
  • dotnet version: 8.0.404
  • C# Extension: 'ms-dotnettools.csharp' version 2.55.29
  • C# Dev Kit Extension: 'ms-dotnettools.csdevkit' version 1.14.14
  • Uno Extension: 'unoplatform.vscode' version 0.18.5

Extension version: 0.18.5
VS Code version: Code 1.95.3 (f1a4fb101478ce6ec82fe9627c43efbf9e98c813, 2024-11-13T14:50:04.152Z)
OS version: Linux x64 6.8.0-49-generic
Modes:

@jeromelaban
Copy link
Member

Thanks for the report.

This is something we intend to change soon, though our problem is mainly about detecting what an Uno Platform project is in a reliable way. We'll update this issue when we know more.

@spouliot
Copy link
Contributor

An easy (and immediate) workaround is to create a profile for Uno (or for .net) and only have the Uno Platform extension in the Default or Uno profile.

@bornachk
Copy link
Author

Thanks for the report.

This is something we intend to change soon, though our problem is mainly about detecting what an Uno Platform project is in a reliable way. We'll update this issue when we know more.

One method to reliably detect the Uno-ness of the project is the Sdk property on Project in the csproj -- if it contains the string "Uno", then it's an Uno Platform project. We can ignore the edge cases such as some other SDK that happens to contain "Uno" in it, at that point the user might as well go with @spouliot's suggestion to create a profile.
Uno Platform, when it's about to display the project selection box, has to check the list of projects it knows somewhere, so during that listing, if at least one of the projects matches the pattern above, the project selection in the status bar should be displayed.
I haven't looked into the code for the extension where it's relevant but I think this would be a well-needed feature, especially for people like me who use vscode and dotnet nearly exclusively, since I have many Uno Platform and plain old C# projects that I'm working on.

An easy (and immediate) workaround is to create a profile for Uno (or for .net) and only have the Uno Platform extension in the Default or Uno profile.

This works but it's not as streamlined or intuitive as having it built into the extension.

@jeromelaban
Copy link
Member

One method to reliably detect the Uno-ness of the project is the Sdk property on Project in the csproj -- if it contains the string "Uno", then it's an Uno Platform project. We can ignore the edge cases such as some other SDK that happens to contain "Uno" in it, at that point the user might as well go with @spouliot's suggestion to create a profile.

Yes, that's what we can use, but we also need to support older projects that don't have this cue.

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

No branches or pull requests

3 participants