-
Notifications
You must be signed in to change notification settings - Fork 847
Description
Please Note: in order to satisfy community curiosity about this exciting set of new features, we are providing this snapshot of the current state of our planning. There are more details for us to figure out yet. You should expect to see us working on this in a few weeks.
Srivatsn worked over Christmas and did this:
This is F# colorized and with a lightbulb fixer implemented at the Roslyn workspace layer in Visual Studio. It uses Roslyn to handle the editing and the FSharp Language Service to parse the code. As we all know this model works and is well understood, TypeScript uses it for their editor experience. Currently not all of the APIs necessary are public, some are a bit ugly and need redesign, for now we should get an internals visible added to roslyn and allow the roslyn team to evolve a decent public Api for this based on our usage scenarios.
He maintains a branch here: https://github.com/srivatsn/visualfsharp/tree/roslynls By now it is based on quite an old branch fsharp compiler branch 303 commits behind (October 30th 2015)
I believe we all agree that scrapping our existing IDE experience and building on top of this mechanism is the best chance for Visual F# to try to keep up with the huge pace of IDE enhancements that Visual C# and VB are currently achieving. Also the IDE and fixer model will allow us to vastly improve the Visual F# error experience, because often the error isn’t at the line of code the compiler says, so we can create fixers that offer 4 or 5 solutions with preview to solve an error. The only real thing for discussion is how and when to take this forward. Building the editor gives us a solid foundation for creating an IDE experience that will work cross platform
We propose to:
- We add Sri’s prototype into the current master branch which targets DEV15
- We add a switch to the Visual F# IDE settings that enables this language service and disables the existing Visual F# language service, that will allow Visual F# early adopters and OSS devotees to try out the new IDE experience without losing all of their existing functionality
- We build the tooling on the newly integrated F# CompilerService APIs rather than the old FSharp.Compiler.LanguageService APIs.
- Priority is get to parity with existing IDE / language service
- To get to editor parity is probably not a lot of effort, the existing Visual F# IDE relies a lot on default editor behavior
Parity consists of:
- Colourization
- Intellisense
- Build integration
- Debugger integration
- Error reporting to error window
- Execute in FSI
- Brace matching
- Smart indent is currently wrong for the Roslyn prototype
- Encourage OSS contributions
Powertools
The existing Visual F# Power Tools may not work correctly in this new language service. We will encourage the powertools contributors to migrate their implementation to this new editor. Ideally they could contribute the implementation of many of the higher order features
Roslyn Features
Identify easily separable IDE features that already exist in Roslyn, and open up for grabs issues on fsharp repo to implement them, with pointers to existing Roslyn implementations. The rework will often be required because our AST is completely different from the Roslyn one.
- A ton of new tests will need to be created to ensure that experience is correct
- _Consider …. Implementing Editor TestApp support for Visual F# _
- This needs to be sharable at least in binary form with OSS community
- Once we reach parity, remove the switch and the Legacy Visual F# editor
Note:
- The initial work is to make language service switchable, this will allow Dev 15 previewers to continue to use current IDE code including the Visual F# Powertools, while also giving the ability to use the new one.
- The Visual F# PowerTools features will likely require porting to the new Roslynized language service (it is not yet known if they can coexist). Ideally they would be submitted as feature PR's but doing them as in add-in is a possibility too and so successfully working with the community to figure out the best way to package and work on these features is key to this being successful.
- The F# compiler service APIs have been integrated it into the Visual F# build which gives us a solid API to get information about the code.
- This approach may lead us towards a vscode/omnisharp integration strategy too, though projects such as FsAutoComplete also provide multi-editor integration
- Initially this will require us using Roslyn Internal APIs. The Roslyn team will be using our experience implementing this to figure out what needs to be public, and what the Public API shapes should look like.
I hope this gives you a taste of what we are thinking, it is not firmly committed yet, although we are all very excited about it and are very hopeful this will be the approach we take. Please don't read too much into any particular phrasing I have chosen. This is certainly a malleable project, and will evolve through our joint work.
Thanks
Kevin
