fsprojects / fsharp-language-server

Other
215 stars 37 forks source link

Sublime Text 3 support #13

Open tboby opened 6 years ago

tboby commented 6 years ago

You list Vim and Emacs as wanting support, but would you be interested in getting Sublime Text 3 support set up?

This can be done through the "LSP" plugin: https://github.com/tomv564/LSP

You can see my "LSP-cwtools" plugin here: https://github.com/tboby/cwtools-sublime

The main issue (which I haven't solved myself yet) is that ST3 plugins are downloaded from git repos, using "releases" as versions. So after every release your CI needs to copy the server executable to the plugin repo and then mark a release. Currently, I do this manually, and I haven't registered with the central "Package Control" service yet.

There is an ST3 F# plugin, but it's not LSP, and hasn't been updated in years (although nothing has changed I supposed).

Want me to try and set some of this up/write some more detailed instructions on what you'd need to do?

georgewfraser commented 6 years ago

Sounds great. CircleCI is already set up, should be easy enough to piggyback off that.

georgewfraser commented 5 years ago

@tboby This would still be a cool thing to do! If you can get this 80% of the way there, I'm happy to help get it working in CircleCI.

tboby commented 5 years ago

Sorry, I gave up on good ST3 support for my language server, it was too much effort for me (as I have quite a lot of configuration and extra VS Code only features).

However, I've created a working client plugin with usage instructions here: https://github.com/tboby/fsharp-language-server-sublime

I used dotnet publish -c Release -r win-x64 --self-contained to create the binaries for the extensions. Things that need to be done to "finish" it:

  1. Work out why it's only parsing files individually. It logs to console and I can see it talking about cracking the project, but not sure if it's just my project that's breaking :)
  2. Set up CI to run dotnet publish for each platform and commit them to the plugin repo
  3. Set up CI to create a new github release (what package control uses to detect versions)
  4. Edit the python client code to detect platform and run the right binaries
  5. Edit the python client to get the incremental update notification working (I did start/end progress)
  6. When it's stable, submit it to the official package control repository: https://packagecontrol.io/docs/submitting_a_package
  7. If you ever add any settings, you can fill out the framework for settings I've created. It's roughly the same as vscode

Feel free to copy the code in that repo into one you control :)

tboby commented 5 years ago

I added the multi-platform support, although haven't tested it fully.

It now needs dotnet publish to be run three times, once for each platform win-x64, linux-x64 and osx.10.11-x64.

One downside is the size balloons to almost 100MB, but no much to do about that unless we make dotnet a dependency for users! Which on second thought is plausible seeing as it's for F#. I didn't have that coincidence :)

georgewfraser commented 5 years ago

This repo uses dotnet publish too. Having dependencies on the system-installed dotnet creates a bad user experience ("step 1: install this other thing") and it introduces a zillion new ways for things to go wrong ("error: Microsoft.Widget.Core.1.2.34567 is not found")