fsprojects / fantomas-for-vs

Visual Studio Formatter for F#
https://marketplace.visualstudio.com/items?itemName=asti.fantomas-vs
46 stars 10 forks source link

Add new XAML option page #10

Open Evangelink opened 3 years ago

Evangelink commented 3 years ago

Fix #9

Evangelink commented 3 years ago

@deviousasti Let me know how you want to split up the work.

Also the Highlighter doesn't work, there is no default ctor.

deviousasti commented 3 years ago

Pushed the highlighter. I moved the controls out to a new WPF project. It'll be easier to debug from there.

Evangelink commented 3 years ago

I will try to work on this by the end of the week. I am just wondering whether you prefer to go in the direction of hardcoding each property on the VM (similar to what is currently done) or if you would rather have some kind of a collection of some type (name, description?, values and maybe a map of value -> example)?

deviousasti commented 3 years ago

Based on your suggestions, I made a sort of hybrid of all the above editors. It's a custom editor which can generate the UI based on properties defined in our options class.

Nice things:

image

To proceed, we'd need to figure out:

  1. Where to put the help text for a setting
  2. How to choose appropriate formatting samples

...and anything else you can think of.

deviousasti commented 3 years ago

Were you able to try this out? Any opinions?

Evangelink commented 3 years ago

@deviousasti Hey sorry for the BIG delay in my contribution... I got really busy at work and kind of without motivation at home for some time.

I have just tried to merge master and play with the UI, I think it looks really interesting and promising. I would probably stick to a more common style for some controls (e.g. disabled/enabled) but that's a personal preference.

2. How to choose appropriate formatting samples

I think it would be worth sharing them with/from the fantomas repository to have something in-sync. I don't know if there is any format used/defined. If nothing exists, we could create some locally but it feels like duplicating work from the original repo so I would probably ask there if they would be ok to do something common.

  1. Where to put the help text for a setting

Probably depends upon the answer of the previous question.

deviousasti commented 3 years ago

It's important to take care of yourself, and how things are right now, nobody would blame you even if you didn't come back to finish this. So, first of all, a BIG thank you for thinking about finishing this!🙇

After merging with master, has the extension worked for you? My VS breaks after I upgraded to FCS 39 - could you confirm if the extension works (i.e, responds to the format command) if you run it right now?

duplicating work from the original repo We could add a description attribute on the record but would need merging into Fantomas. I'm also not sure what will happen when there's a beta version and we have to account for its properties. But we could definitely get something working fast by adding it our internal options page - we can always move it to Fantomas later.