Giter Club home page Giter Club logo

Comments (22)

dungpa avatar dungpa commented on July 1, 2024

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.

greenbutton avatar greenbutton commented on July 1, 2024

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.

dungpa avatar dungpa commented on July 1, 2024

@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.

dungpa avatar dungpa commented on July 1, 2024

@greenbutton @itowlson What is the status of the VS add-in :-)?

from fantomas.

itowlson avatar itowlson commented on July 1, 2024

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.

dungpa avatar dungpa commented on July 1, 2024

@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.

itowlson avatar itowlson commented on July 1, 2024

@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.

dungpa avatar dungpa commented on July 1, 2024

@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.

dungpa avatar dungpa commented on July 1, 2024

@greenbutton @itowlson Did you receive my message at itowlson/fsharp-vs-commands#2 (comment) about status of the VS add-in?

from fantomas.

itowlson avatar itowlson commented on July 1, 2024

@dungpa Many apologies. I've been away this weekend and wasn't checking email. I'll respond over there.

from fantomas.

dungpa avatar dungpa commented on July 1, 2024

@itowlson No problem. I'm waiting for your answer there.

from fantomas.

dungpa avatar dungpa commented on July 1, 2024

@greenbutton @itowlson Have you seen my message at itowlson/fsharp-vs-commands#2 (comment) :-)?

from fantomas.

itowlson avatar itowlson commented on July 1, 2024

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.

dungpa avatar dungpa commented on July 1, 2024

@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.

ovatsus avatar ovatsus commented on July 1, 2024

Could you upload the addin to the Visual Studio gallery, so it's searchable and installable from the VS extension manager?

from fantomas.

dungpa avatar dungpa commented on July 1, 2024

@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.

ovatsus avatar ovatsus commented on July 1, 2024

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.

 avatar commented on July 1, 2024

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.

ovatsus avatar ovatsus commented on July 1, 2024

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.

dungpa avatar dungpa commented on July 1, 2024

@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.

halcwb avatar halcwb commented on July 1, 2024

Is this still supported for VS? Couldn't find it?

from fantomas.

dsyme avatar dsyme commented on July 1, 2024

Repo now at https://github.com/fsprojects/fantomas-for-vs

from fantomas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.