Giter Club home page Giter Club logo

Comments (21)

dungpa avatar dungpa commented on July 19, 2024

I understand the importance of MonoDevelop and Xamarin Studio support.

At the moment I use a private build of F# compiler 3.0 assembly and do pattern matching directly on F# ASTs. Could you explain how it would work if we use reflective soft binding? I imagine it's a huge change and it's a pain to get it working.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

Depending on what features of the compiler you are using, the majority of the work might already be done. The bulk of the work would be converting fantomas to produce its output in a form thats applicable to the MonoDevelop IDE interfaces, you would probably find this with VS too. A common code base usable by both would emerge.

from fantomas.

 avatar commented on July 19, 2024

Once you start adding features like this you should bundle the compiler DLL. You don't have to call it FSharp.Compiler.dll - better to call it FSharp.Compiler.Editing.dll or the like (and it should certainly have a different strong name key).

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

I prefer to bundle the compiler DLL. It's easier to work with and easier to make changes.

@dsyme: any suggestion on how to keep them in sync with F# open source compiler repository? I think lexers and parsers are less likely to change, but the compiler itself is improved from time to time.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

@dsyme Are also alluding to building with the bundled compiler too? Otherwise a discrepancy could creep in between build output and editor formatting.

from fantomas.

 avatar commented on July 19, 2024

Well, I don't think you should ship a GAC'd binary-replacement of FSharp.Compiler.dll. That's a Visual Studio/Mono/... component and you should not try to replace those at this stage.

It is also pretty much impossible to ship an isolated compiler you use for building from XS, because XS uses "msbuild"/"xbuild", which locate the compiler vis FSharp.Build.dll, in the location pointed to by Microsoft.FSharp.targets. So I believe that means you can't usefully ship an fsc.exe.

You might eventually fold things back into the core FSharp.Compiler.dll, but you can't rely on those updates being in the F# compiler installed on the target system.

So I think you just have to live with what's on the machine for building F# code.

This means your only option is to bundle an FSharp.Compiler.Editing.dll with functionality suitable for formatting, type-checking, refactoring etc. over some particular version(s) of F# (currently F# 3.0). For each feature you get to use either functionality in the FSharp.Compiler.dll on the machine (via soft-binding) or functionality in FSharp.Compiler.Editing.dll (via hard-binding). Currently I'd suggest formatting comes from FCE.dll and the other functionality comes from FC.dll. That keeps the risk risk of discrepancy in type-checking low.

If your work is a branch or fork of http://github.com/fsharp/fsharp then you will be able to update this to F# 3.1 when it comes out.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

I have a feeling that adding more load on the soft binding (better tokenisation support) will cause it to creak at the seams. A hard binding for all editor support including intellisense and autocompletion would be my preference, relying on the soft binding for compilation only. This would mean stripping out the current implementation(In the F# binding) for a more dedicated full editor support for Xamarin Studio.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

@dungpa We've talked about FSharp.Compiler.Editing.dll and its still on my list :)

What about adding this to the F# binding in MonoDevelop/XS are you ok with me referencing the Nuget package and including it? (Thats if the API is usable as is from MonoDevelop)

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

Yes, please do so.

I imagine there are major changes before you can integrate formatting commands to F# binding seemlessly.

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

@7sharp9 @rneatherway I published Fantomas 1.0.0 on NuGet, which depends on FSharp.Compiler.Editor. Let me know what I can help to integrate this to FSharpBinding. Thanks.

from fantomas.

rneatherway avatar rneatherway commented on July 19, 2024

It would be great to have it integrated! We are just working on cutting the
binding over to FSharp.Compiler.Editor as well, so once that is done we can
look at this.

On Tue, Jul 16, 2013 at 8:22 AM, Anh-Dung Phan [email protected]:

@7sharp9 https://github.com/7sharp9 @rneatherwayhttps://github.com/rneatherwayI publish Fantomas 1.0.0 on NuGet, which depends on FSharp.Compiler.Editor.
Let me know what I can help to integrate this to FSharpBinding. Thanks.


Reply to this email directly or view it on GitHubhttps://github.com//issues/5#issuecomment-21025390
.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

At the moment I don't even have the time to think about it, first step would be to build an F# GUI that can drop into Xamarin studio to hold the required settings:

screenshot

After that it a matter of either:

a) Choosing to integrate formatting similar to C# with code policies, this would mean a copy paste would reformat the pasted code etc.
b) A simple context command: Format selection, Format Document.

Dave.

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

@ovatsus When the hard binding is in place inside FSharpBinding, would you like to take a look at integrating Fantomas? If you're too busy, I can start working on that in January.

from fantomas.

ovatsus avatar ovatsus commented on July 19, 2024

It's already on my todo list. I'll also update the NuGet package to the latest master in the process. Is the version on the VS gallery already up to date? BTW, we should really sync up both version numbers, otherwise it's confusing

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

Yes, the version on the VS gallery is up to date (except your two recent bug fixes).

Two version numbers are indeed confusing. We should increase the version in VS gallery to catch up with the one in NuGet package.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

@dungpa My hardbinding had been merged to master now.

from fantomas.

ovatsus avatar ovatsus commented on July 19, 2024

Can you publish a new version on the gallery with my two bugfixes as 1.0.3? I'll publish the equivalent NuGet package. Also, make sure you build it against FSharp.Compiler.Editor 1.0.7, which is the one being in use in fsharpbinding

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

@ovatsus Done.

@7sharp9 I thought it was an ongoing process since fsharp-refactor pull request hasn't been merged yet.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

The hardbinding part is merged in, refactoring is a separate thing.

from fantomas.

7sharp9 avatar 7sharp9 commented on July 19, 2024

@ovatsus One of the first steps is adding bit of GUI to display F# formatting options, I mentioned that above.

from fantomas.

dungpa avatar dungpa commented on July 19, 2024

Not the fastest way to get in but the feature got merged into FSharpBinding yesterday fsprojects/zarchive-fsharpbinding#604.

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.