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

missing intellisence/autocomplete support for resource keys #1503

Open
Xiaoy312 opened this issue Nov 18, 2024 · 3 comments
Open

missing intellisence/autocomplete support for resource keys #1503

Xiaoy312 opened this issue Nov 18, 2024 · 3 comments
Labels
kind/enhancement New feature or request

Comments

@Xiaoy312
Copy link
Contributor

What would you like to be added:

intellisence/autocomplete support for resource keys

Why is this needed:

general QoL

For which Platform: design-time editor

Anything else we need to know?

https://discord.com/channels/1182775715242967050/1182775715729526908/1308207632812740700

Does autocompletion work for anyone for material theme styles/colors/etc? i.e. stuff like this:

<... Background="{ThemeResource SurfaceBrush}" />

I haven't had that working in forever now, since like Uno 3
I need to look up the styles and names in uno docs whenever I want to reference something from the material theme
The material stuff just doesn't show in intellisense

the user claims that this used to work in the past, and broke for some reason
he hypothesized that could be when we promoted the main res-dict to a class

@Xiaoy312 Xiaoy312 added the kind/enhancement New feature or request label Nov 18, 2024
@Xiaoy312
Copy link
Contributor Author

SO answer for wpf: https://stackoverflow.com/questions/49779105/xaml-intellisense-doesnt-work-for-referenced-assembly-resources
but we could inspire from this idea, and generate a "shopping list" res-dict that is only used during design-time

@DevTKSS
Copy link

DevTKSS commented Dec 30, 2024

@MartinZikmund I think I seen (and commented) from you to the resourceDictionary xaml thing mentioned similar here, but I can not find yours again. Could you check if that both could/should be joined?

Since I did strangly got the intellisense working for this in a past project (not working anymore to my disapointment) and did some research to that also:
https://developercommunity.visualstudio.com/t/xaml-intellisense-not-showing-suggestions-for-reso/521085
They told there and the linked issue, that should be solved if the xaml designer is enabled, which is not working for my/your uno app, so if I read this linked here correct, that is guiding to a UAP (copilot told its the UWP in Directory lang?) generic.xaml as we know from creating own resources...
Okay, but if I remember correctly, Uno do not activly support uwp anymore and I think this Project where I had this working was also targeting Windows which maybe indirectly holds references to UWP, or I could at least imagine it to do under the hood...

I am not familiar with uno repo structure, so could you or someone else from the team maybe check that point for source of the ResourceKey intellisense missing?

Microsoft docs told, that it can be its only guiding to the first dict we introduce in app.xaml but then it should at least show anything more than "ResourceKey=". If that might be the source, that uno projects are not using the
C:\Program Files (x86)\Windows Kits\10\DesignTime\CommonConfiguration\Neutral\UAP\10.0.22621.0\Generic
because as my current project is only targeting other (my app would have desktop only) Platforms, my Idea to check from expert-view would be: Can we replicate that file(s) in similar directory and place/guide the used intellisense to lookup this?

And if you find the issue of you existing to that, would be nice to have both if possible merged because it could have same root issue. Thanks!

@DevTKSS
Copy link

DevTKSS commented Dec 30, 2024

So.... I checked some things and even if I dont know where this would have to be canged, to enable the intellisense to look this up for non windows targets, but! the package, that is providing the intellisense in that project mentioned (recognized I uploaded it and was on the go to delete it because this one is having other dump issues which would make me step on to new project instead)

Can we somehow get a similar link/setup for reference replacement in case of non windows target, that would provide the link for the intellisense to the maybe existing uno resourceDictionary or replace the link we set up in the app.xaml MergedDictionarys XamlControlsLibrary?
@jeromelaban @MartinZikmund

The Package successfully providing the intellisense for the ThemeResource for example me is C:\Users\TKSSonja.nuget\packages\microsoft.windowsappsdk\1.6.241114003\lib\net6.0-windows10.0.18362.0\Microsoft.WinUI\Themes\generic.xaml

Do you see any option to hint the intellisense in your uno projects which are not targeting windows? like... if only desktop we could kind of replace a bit of that namespace or do some uno platform specific # things I did not learn till now... would be great to have that intellisense available for everyone using uno :)

just for the clone and see the setup: https://github.com/DevTKSS/UnoHotDesignApp1

I do know that Project has really performance issue, its the one that having also the gridView-FeedView Drag Drop issue, i would link in the correct issue already known for this, just linking here so you can compare.
You should be able to clone it for example and and somewhere like some textbox add something like
Background="{ThemeResource }" and the intellisense will suggest content from the windowsAppSDK which you can find in the windows target dependencys and also you should be able to peek or go to definition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants