Comments (22)
Hi Gustavo,
Despite my zero knowledge on VS extension, this is on the TODO list.
There are a few reasons that it hasn't been implemented yet:
- This tool means to be an offline one. I use the F# parser instead of the F# lexer, so some information is distorted.
- It only can support formatting the whole source file, formatting a block is impossible due to whitespace significance.
- The set of preferences is still primitive. I would love to hear your suggestions to improve them (see https://github.com/dungpa/fantomas/blob/master/Usage.md#preferences).
That said, there are some problems with the core that will occupy my time. I hope that someone in F# community steps up to help with this issue.
from fantomas.
Hi,
I've started a project for this at https://github.com/itowlson/fsharp-vs-commands. It's very rudimentary at the moment, no support for preferences, but I'll try to get that fixed over the next few days (and will probably try to move some of the code over into F# -- it's C# at the moment because that makes it slightly easier to get the VS integration going). Please feel free to take it into Fantomas if you want -- I started a separate project so that I could add other non-formatting commands to it if I wanted to. Also please let me know if you want me to provide additional attribution or include a copy of your licence.
from fantomas.
@greenbutton This is sweet. Thank you for starting it. Let me know when the project is ready for testing; I'm eager to try.
I did some investigation, my assessment also shows that starting C# is the reasonable choice. Later we could gradually move the add-in towards F#.
Personally, I would like to separate formatting commands from other commands and add the add-in to this repository. It's easier to update and deploy the add-in.
from fantomas.
@greenbutton @itowlson What is the status of the VS add-in :-)?
from fantomas.
Planning to look at it this weekend. I'm happy for you to take the code into the Fantomas repo. What are your priorities for me to address before you do that -- build script, bug fixes, etc.?
from fantomas.
@itowlson Thanks. My priorities would be:
- Allowing changing preferences
- Detecting fsi files correctly
- Preliminary support for formatting selection
- Adding build script
- Bug fixes
from fantomas.
@dungpa Preferences and FSI detection are now in. I need to have a think about 'format selection' but your and Vasily's suggestions sound like a promising compromise between making it functional and keeping it simple!
from fantomas.
@itowlson Great. When the addin is feature complete, could you please create a pull request and put the project into vs
or addin
, etc under the root folder. It definitely is the most awaited pull request :-).
from fantomas.
@greenbutton @itowlson Did you receive my message at itowlson/fsharp-vs-commands#2 (comment) about status of the VS add-in?
from fantomas.
@dungpa Many apologies. I've been away this weekend and wasn't checking email. I'll respond over there.
from fantomas.
@itowlson No problem. I'm waiting for your answer there.
from fantomas.
@greenbutton @itowlson Have you seen my message at itowlson/fsharp-vs-commands#2 (comment) :-)?
from fantomas.
Sorry, been travelling (again). I am happy to transfer whenever is convenient for you (and agree it would be best as I'm struggling to be responsive!). How do you want to do this? Do I need to fork the main Fantomas project and add my code to the fork, then you merge back in? Or would it be easier for you to just take the files and add them to your repo?
from fantomas.
@itowlson It would be great if you can create a pull request and put the VS extension under vs
folder in the root directory. That's even better if you can preserve commit history while transferring the code.
Let me know how I should attribute your work. I will add a few more sentences on README, but I'm not sure it's enough.
from fantomas.
Could you upload the addin to the Visual Studio gallery, so it's searchable and installable from the VS extension manager?
from fantomas.
@ovatsus @vasily-kirichenko The extension is now live at http://visualstudiogallery.msdn.microsoft.com/24ef5c87-b4e3-4c3b-b126-1064cc66e148
I would love to hear your initial feedbacks. If there is no serious issue, I will write up a short blog post and announce the release tomorrow. Thanks.
from fantomas.
Thanks, I gave it a try and it seems to work fine. I didn't like some of the adjustments, but I'll report them separately
from fantomas.
The plugin itself is installing fine and works well.
However, you’ve now made it so easy to use that you’re going to get an absolute flood of issue reports. We noticed this with the F# type checker – as soon as we added type checking to Visual Studio, we found bugs at a much greater rate.
You’re doing an amazing job – so don’t take the feedback the wrong way. It’s the joy of having users
Cheers!
Don
from fantomas.
Yes, this tool is awesome, in addition to being very useful, it's going to make a noticeable difference when demoing F# to C# devs. From my experience, when they complain about tooling, after not having rename and folders, the auto formatting is the third thing mentioned.
from fantomas.
@dsyme @ovatsus Thanks for your compliments. I'm glad that the tool is useful. Just feel overwhelmed about the amount of work to be done.
from fantomas.
Is this still supported for VS? Couldn't find it?
from fantomas.
Repo now at https://github.com/fsprojects/fantomas-for-vs
from fantomas.
Related Issues (20)
- Breaks shorthand lambda atomicity for lowercase method invocations
- Consider relaxing ASTTransformer treatment of ranges in record fields HOT 1
- Unable to format F# 8 extended interpolated strings with curly braces HOT 3
- Move editor config to library rather than tool HOT 6
- "Incomplete declaration of a static construct" which the F# compiler accepts HOT 2
- Multiline secondary constructor HOT 4
- Equals sign should only be on same line if last tuple is multiline HOT 2
- Return type should go on next line
- Invalid F# code after formatting HOT 1
- Formatting removes necessary additional closing brackets for multiline interpolated strings HOT 1
- Fantomas reports an error when formatting interpolated string with tripple quotes HOT 7
- Idempotency problem when _.Property shorthand
- Regression: Stroustrup bracket style in anonymous record type parameter is not respected
- HashDirective before closing `]`
- Long parameter attribute gives weird line break before type annotation
- Fantomas corrupts an explicit constructor with `then` clause HOT 2
- FormatASTAsync loses single quotes for characters HOT 4
- Regression: An empty line or comment at the end of a list breaks Stroustrup formatting HOT 2
- `SpaceBeforeUppercaseInvocation` corrupts underscore lambda invocation HOT 1
- Non needed parentheses are added around lambda call from tuple/members HOT 3
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.