microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
228 stars 12 forks source link

UXML, USS Indentation auto formatting and Intellisense #325

Open tsanyqudsi opened 1 year ago

tsanyqudsi commented 1 year ago

Describe the feature you'd like

As for now, the formatting is using 4 spaces, it would be nice if you could change it to your own preference ( for my case it's 2 ). And it would be nice if you could add intellisense as well.

Alternatives considered

No response

Environment Information

sailro commented 1 year ago

Could you try to use an .editorconfig file with the following content ?

[*.{uss,uxml}]
indent_style = space
indent_size = 2
tsanyqudsi commented 1 year ago

@sailro does it auto format the file ?

sailro commented 1 year ago

First you need to install the EditorConfig extension.

Then you need to add "editor.formatOnSave": true in your project .vscode/settings.json to enable auto-format on save.

tsanyqudsi commented 1 year ago

nope, not working.

zoy-l commented 1 year ago

Will uxml/uss code hints be added later? :)

PythooonUser commented 11 months ago

I think UXML intellisense has some major challenges involved. As I understand each element in UXML can have custom properties based on the underlying C# class. So the language server for UXML would need to be able to parse C# code first, generate some understanding of what properties exist and then show some completion items, e.g. for built-in classes we would need to read UnityEngine.UIElements.

Also, methods like resource or url in USS need to be able to read your entire Assets folder in order to provide completion items for your texture or font assets. As I understand Resources folders can appear in any nested folder structure, so we have to keep some kind of index when trying to provide a completion item here.

MateuszSadowski commented 8 months ago

I understand that there are challenges involved, but I second the request for Intellisense for UXML.