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

Add new XAML option page #10

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

Evangelink
Copy link

Fix #9

@@ -0,0 +1,40 @@
<UserControl
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine the page to be some kind of fusion of

Resharper settings:
image

The old C# settings:
image

The new C# settings:
image

Copy link
Member

@deviousasti deviousasti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR!
It looks like it's off to a good start.

I wonder if we should prototype it as a separate WPF project.
Running it each time in VS is very slow.

src/FantomasVsPackage.cs Show resolved Hide resolved
src/FantomasOptionsDialogPage.cs Show resolved Hide resolved
src/FantomasOptionsPage2.xaml Outdated Show resolved Hide resolved
@Evangelink
Copy link
Author

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

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

@deviousasti
Copy link
Member

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

@Evangelink
Copy link
Author

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
Copy link
Member

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:

  • Searchable
  • Grouping
  • Changes made to properties trigger a format of the sample with the new rules

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
Copy link
Member

Were you able to try this out? Any opinions?

# Conflicts:
#	fantomas
#	src/FantomasHandler.cs
#	src/FantomasOptionsPage.cs
#	src/FantomasVs.sln
@Evangelink
Copy link
Author

@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
Copy link
Member

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.

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

Successfully merging this pull request may close these issues.

Describe default formatting options
2 participants