unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
8.89k stars 720 forks source link

Select an active project to enable XAML Intellisense (v0.13.0 VSCode UNO platform extension) #16222

Open regolas opened 6 months ago

regolas commented 6 months ago

Your feedback

I open VSCode which has an active Blazor project. There isn't any xaml in the project, yet, the title issue appears. I would suggest that the UNO platform code only check the project if Uno is actually in use. It shouldn't rely on the fact that the extension is active..

Thanks!!

spouliot commented 5 months ago

I would suggest that the UNO platform code only check the project if Uno is actually in use.

But the message is only shown only where there's no project in use 😄 IOW when a solution is opened without any active project [1].

The current [2] text is a bit Uno-centric but this condition exists for all dotnet solutions when using VS Code.

Visually this condition is very easy to miss when using VS Code (since most features will work the same) but people wondered why some features (like our XAML intellisense) were not working like expected [3].

I'll try to think of something better that is not too heavyweight (like parsing all projects) since it would affect all dotnet solutions.

[1] Both O# and C# DevKit allows you to open a solution - with no project opened.

[2] The previous message was more generic

284683545-7a9f49a3-22ed-4f42-b882-54189cafce79-2

[3] https://github.com/unoplatform/uno.vscode/issues/495

regolas commented 4 months ago

In [3] that issue brings back error 404. Is there a way to detect the UNO workload in the project? For example, in my UNO related projects, there is usually a global.json file that contains reference to the UNO sdk. { "msbuild-sdks": { "Uno.Sdk": "5.1.31", "Microsoft.Build.NoTargets": "3.7.56" } } If it doesn't detect this, then it shouldn't load/run. I would assume that if I add it to or create an UNO project, it should know this exists.

Just a thought.