-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider using fsprojects/fsharp-language-server as a starting point for LSP #361
Comments
TLDR; Thanks for the suggestion, but no, we won't do this. Longer explanationWhile I appreciate that https://github.com/fsprojects/fsharp-language-server exists and I welcome anyone wanting to work on the F# tooling, I don't think it provides advantages outweighing potential costs of such move. FSAC is a long-standing project (7 years old) that has been battle-tested by thousands of users on multiple different editors. Technical partWhat you call "incidental complexity" it's usually not an incident - FSAC enhance what FCS does in every single feature - from simple tooltips including signature formatting and markdown formatting of documentation, through autocomplete doing the ordering, autocomplete of external symbols and inserting opens, making sure Attribute autocomplete doesn't insert unnecessary Those features were created over the years, with hundreds of hours of work of different contributors. Moving away from FSAC is not "clean break". I rather see this as abandoning things that are not trivial to port, that are pretty well designed and what's most important for the users are working right now. PerformanceAlso, I'd like once again (I've done this in Slack some time ago as far as I remember) address this "fsharp-lang-server is faster" point. Of course, it's faster, it does fewer things. Simple as that. As I've mentioned - FSAC is not just a thin layer of calling FCS, it does a lot of heavy lifting. As such, obviously, FSAC puts a lot more pressure on FCS reactor queue. In any complex system that's bottlenecked by single-threaded queue, you cannot judge the performance of a single feature. Because it's impacted by any other action that's happening right now in the server. And we do a lot of computing in the background, in fact, most from any F# editor that's on the market - code lenses, custom analyzers, linter, error reporting across files without saving, error reporting across projects without rebuilding projects, etc. All those features impact the general performance of any feature at any moment in time. Additionally as I've said before - for basically any feature we're doing some additional enhancements - ofc, simple autocomplete that's calling one function from FCS and mapping results is faster than the one that orders entries, uses entities cache to provide completions for not opened namespaces/modules, checks if we're in Attribute scope, and do other stuff. Especially type checking of the projects depending on current project to get cross-project errros without rebuilding solutution is something puting lot of pressure on reactor, and accidentally is something that VS is not doing. Of course, FSAC performance is not perfect - but not beacuse LSP is somehow inharently better. Over the years performance was never huge point of focus for the FSAC maintainers, and I'm strongly sure that there are multiple low hanging friuts, easy to fix, that will imporve FSAC performance. Fortunatly, this is something Microsoft wants to help me with, so I expect improvements in this area over next few months. I think such performance focused work is a way forward rather than reimplementing same set of features in other projects and hoping that we won't have same performance problems. CommunityAbandoning one project and moving to another is not only a technical question, nor it's the "let me know who to add as maintainers" problem, but it's also a thing impacting the community of given projects in general. FSAC is a long-standing project, with a decent amount of contributors that's been contributing for years. Those people know how to contribute, they know parts of the code base they created, they are experts in some particular niches. I'm the only one lucky (and this is just temporary state for me, so I understand them well) - all of them are doing this in their free time, they care about some particular functionalities, or they just want to help. Moving to another project is just an additional thing making their life more difficult - they'd need to learn new code base, they'd potentially need to port something they've already written to the project. |
Thanks for writing such a detailed response! For what it’s worth, based on my experience traipsing through FSharp.Compiler.Service and the FSAC code about a year ago, I think you will be able to get the same performance with FSAC, even with all its features. My experience was that it’s a matter of calling FSharp.Compiler.Service in just the right order that makes its internal caches happy and then suddenly it goes really fast. The fsharp-language-server implementation might be a useful speed comparison for you once you turn your attention to performance—you should be able to get the exact same autocomplete times, for example. Good luck! |
Thanks a lot @georgewfraser for the suggestion. If we can share knowledge will be awesome, also if the two projects continue to exists as separate entities, because the issues are shared. I think @Krzysztof-Cieslak has already explained really well what i think about it too, so i'll try answer about your points and my high level view of FSAC. As a personal note about FSAC, my personal feeling and my effort as maintainer is:
That's what's important for me. That mean we can put some enhancement/bugfix inside FSAC asap who seems accidental complexity, but we later refactor and extract to new libraries so easier to maintain (like with current effort of project system to A single library like FCS cannot do everything (project system, F# info, additional features, different scenarios and integration with extenal tools), because will become too big to be maintained and entangled (difficult to reason about), so features are splitted in multiple libs. FSAC do the plumbing. About architecture, the core layer is independent from the transport and api layer, to maintain IO mode (vim/emacs) and http (ionide) in parallel, making easier to add LSP now. @georgewfraser your project is really interesting, every new solution helps improving the state of the art because we can share ideas, and try different approach. I'll check the repo sources to see if we can reuse some of the code and pattern to speedup things later.
That's a good point.
That's really interesting, i really when community try different ways to fix the same solution, because all projects can benefit of it.
I'll check these thanks, the test suite is an area who helps a lot with maintenance. |
I actually agree with @georgewfraser this is the approach we took with the tooling in Visual Studio for Mac. (back in the day it was xamarin studio) Some of the first work I did was to strip away some incidental complexity from FSAC originally 80% of the internals were also used by xamarin studio, rip out the parser, remove the cracker, remove json encoding etc. Basically remove all the bits that we had issues with. Last I checked in FSAC there were still some parts of what we removed still present, so this could be a good chance to do some internal clean up too. |
We're considering cleanup and perf work as a part of the deliverables in our contract with @Krzysztof-Cieslak. However, we want to rebaseline performance and measurements after LSP support is in. Among other things, it changes how data is serialized to/from the FSAC process and VSCode, which means issues like #324 will now be different. How that shapes up is TBD, but it will be based on measurements before/after specific changes. |
@cartermp Are these performance measurements available now that LSP has been merged in? Also, regarding the intended feature cleanup and performance optimizations, as @7sharp9 forecasts some FSAC features will end up removed - is there a definitive list of FSAC features you are aiming for? While I have huge respect for FSAC, I also liked the simple approach fsharp-language-server took, and at the end of the day performance is what matters to most. Some of what has been brought up in this ticket, such as markdown formatting, rarely belongs to a language server. |
@granicz i dont think most of the features create performance issues. While i think performance matter, also real world scenarios matter, both project specific or user specific Some are not features, like said before, but are corner case, so are quality fix. Each command in FSAC is separate and async. For example if Ionide ask for I dont think conversion from xmldoc to markdown (done in a single command, to get specific symbol documentation) is really that time consuming or add up. If there are perf issues (like #324) happy is someone want to address these.
@granicz just to check xam studio, there the story was a bit different
Project parsing was removed because handled builtin in Xamarin. We cannot do that, because it mean editors will need to reimplement that. Instead i am currently improving it (ref #347 )
the LSP mode like other two FSAC modes (stdio/http) is a server, need to talk to client (LSP based clients or FSAC based like vim, emacs or ionide atm) using a protocol.
Xam studio was in process (like Visual Studio), i think that's not a good way forward for editors. Also only editors built with .NET can do that, not emacs/vim/vscode who need anyway a server layer. @granicz FSAC is a real world codebase, we are evolving (like previous contributors), it not rewriting it. |
We don’t plan to remove any features |
If performance is all that matters let’s replace all implementation of features with I’m pretty sure such implementation will provide even better gifs that can be shown to prove “better performance”
I guess our users who enjoy detailed tooltips or info panel wouldn’t agree with such opinions. |
@cartermp I didn't imply it was, it just doesn't belong there IMHO. I will watch this space for more upcoming details on the perf work then, thanks! |
Heh, old thread but I never got notified at the time :-) I didn't mean to imply features would be removed just that slow problematic code would be. At Xamarin we removed the parser and used an alternative, we removed cracking and added an msbuild information gatherer much in the same way @enricosada did years later when msbuild was improved with dotnet i.e. the |
I recently read on @Krzysztof-Cieslak twitter that he'll be working full-time on contract with MS for the next few months, and that one of the major focuses will be finishing the LSP implementation of FSAC. Congrats!
For one moment, let me try to convince you (@Krzysztof-Cieslak) to use https://github.com/fsprojects/fsharp-language-server as a starting point for your efforts:
I would be very happy to make @Krzysztof-Cieslak , @enricosada and any other maintainers of this repo admins on https://github.com/fsprojects/fsharp-language-server. I think you could very quickly port the features of FSAC that aren't in fsharp-language-server, such as the "type hints" that appear to the right of function definitions.
If I have failed to convince you of this proposal, there are several notable features of fsharp-language-server that it would still be worth trying to replicate in FSAC:
dotnet
, which eliminates a large category of errors.On the other hand, if I have succeed in convincing you to try to "adopt" fsharp-language-server and port the missing functionality from FSAC, just let me know who to add as maintainers 😄
@cartermp FYI
The text was updated successfully, but these errors were encountered: