Comments (15)
I've been meaning to put that in for some time, although it's not very useful without concrete examples for before and after.
The options are here:
https://github.com/fsprojects/fantomas/blob/master/docs/Documentation.md
Do you have any good suggestions?
from fantomas-for-vs.
Ideally, having the description and a dynamic example which changes based on the value of the setting as it is done for ReSharper or C# code styles.
I would be happy to help here, this way I could learn the options and see if I want some tweaks to the default configuration :)
from fantomas-for-vs.
Any sort of help is appreciated!
These are the default options to be used if there's no .editorconfig
file.
This is where the descriptions are specified.
https://github.com/deviousasti/fsharp-formatting-for-vs/blob/bdb75fa49d01a3eb5b6f6a84ad5dcb71a634ca16/src/FantomasOptionsPage.cs#L204
from fantomas-for-vs.
Let me dive back into VS option pages (I haven't used them in a while).
from fantomas-for-vs.
If you're free this weekend, we can work together on this. VS live share session?
from fantomas-for-vs.
Sorry @deviousasti I missed this notif, I might have some availability next week-end or at evening (CET timezone).
from fantomas-for-vs.
Regarding the Description
, most of the entries are missing the [Description(XXX)]
attribute which explains why there is no example.
I am still trying to find how to have the dynamic code example, looking at roslyn and some other repositories we might have to use a WPF page instead of WinForms.
from fantomas-for-vs.
Oh, sorry, I forgot to explain.
We're using this attribute to specify that VS needs to use this as an options page:
https://github.com/deviousasti/fsharp-formatting-for-vs/blob/bdb75fa49d01a3eb5b6f6a84ad5dcb71a634ca16/src/FantomasVsPackage.cs#L27
Which shows up the options in a property editor.
Adding a description attribute is one step forward, but it isn't sufficient for the Roslyn like experience.
We're going to have to recreate the configuration UI (checkboxes, dropdown, etc) in a WPF UserControl, and then add a set of examples for the options.
I've been working with WPF for 10 years now, so not a big deal.
If we add a custom attribute for the corresponding .editorconfig
option, we can have a nice UI to generate an .editorconfig
file as well.
from fantomas-for-vs.
Yeah the only problem for me so far is just to be able to include a TextEditor
like component which will reuse all the formattings and colors from the F# configuration in the IDE. Maybe I am going a little too far and we could simply start with just a simple text (no colors + no IDE specific background color).
from fantomas-for-vs.
Yeah, that's probably a bit extreme for now. I have seen other extensions use AvalonEdit for displaying code, but that's a lot of stuff for this one feature.
If the examples are simple enough, coloring needn't be an issue.
Although... we're dependent on FCS and have to parse the examples anyway, so we could probably assign a colour per token, and it would be reasonable.
from fantomas-for-vs.
Hey Asti, I'm afraid I can't really add anything useful here.
Rider uses a custom editorconfig parsing thing, they added attributes for each setting as well: https://github.com/JetBrains/fsharp-support/blob/93ab17493a34a0bc0fd4c70b11adde02f81455c4/ReSharper.FSharp/src/FSharp.Psi/src/CodeFormatter/FSharpFormatSettingsKey.cs
Ionide does not have any UI for the settings.
Fantomas Online has a copy settings
button when you change the defaults from the menu.
Example
That copies the .editorconfig
settings to the clipboard.
But again no description.
from fantomas-for-vs.
@deviousasti How would you like to proceed, I start some PR and we contribute together?
Also I am wondering if you want to hardcode the various properties or if you want to actually read some configuration file and dynamically generate the settings page?
from fantomas-for-vs.
Well, no we can have some custom attribute on each property and use reflection to generate our UI.
Yeah the only problem for me so far is just to be able to include a TextEditor like component
I made this so we can have our cake and eat it too.
https://github.com/deviousasti/fsharp-highlighting
from fantomas-for-vs.
As for your branch, would I have commit access?
from fantomas-for-vs.
Sure!
That's a really nice idea you had to create a separate project for the highlighting, this will make it easier to share this across the F# tools.
from fantomas-for-vs.
Related Issues (20)
- Move to fsprojects/fantomas-for-vs? HOT 5
- Microsoft.VisualStudio.Shell.15.0 not found when loading extension HOT 8
- Missing Options: Fantomas Visual Studio 2022 Community Options Menu HOT 3
- Formatting doesn't work with WSL2 hosted files in VS2022 HOT 31
- Fantomas' package name changed from `fantomas-tool` to `fantomas` HOT 3
- Fantomas does not work in Visual Studio 2022 HOT 6
- Reformating on selection messes text following selection HOT 5
- Fantomas scrambled up a huge script file HOT 8
- Inconsistent version numbers
- Settings page looks different from screenshot and is missing many options HOT 2
- Broken "read the documentation" link HOT 2
- Enable or disable "Format on save" per repo
- The extension stopped working after upgrading Visual Studio 2022 to the latest version 17.4 HOT 2
- Unable to install the extension to VS 2022 on ARM64 HOT 2
- Extension does not load when a folder is opened in VS instead of a solution HOT 1
- Fantomas < 5.0 breaks nested lists HOT 16
- fsharp_multiline_bracket_style setting is not applied HOT 9
- Error in format files inside Visual Studio after updating fantomas to 6.0.0-alpha-010 HOT 7
- [Live buffers] Extension does not work with the new live buffers HOT 3
- Error: "Creating the Fantomas Deamon failed" when saving a file or trying to format in VS HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fantomas-for-vs.