ton-society / grants-and-bounties

TON Foundation invites talent to imagine and realize projects that have the potential to integrate with the daily lives of users.
https://ton.org/grants
310 stars 137 forks source link

Convenient packaging solution for existing Tact and FunC language servers #352

Open novusnota opened 1 year ago

novusnota commented 1 year ago

Summary

Convenient packaging solution for existing Tact and FunC language servers (of LSP specification), which are currently tightly integrated into their respective VSCode extensions: Tact, FunC.

The end-result should be available for use in any editor or IDE with language server client available, such as: Neovim, Emacs, Helix, Zed, etc.. Simple-to-use documentation on installation and usage of the re-packaged language servers has to be provided as well.

Context

The Language Server protocol (LSP) is used between a tool (the client) and a language smartness provider (the server) to integrate features like auto complete, go to definition, find all references and alike into the tool.

Existing official VSCode extensions for Tact and FunC language have implemented language servers according to the LSP, which currently are only used from within the VSCode contexts. However, its absolutely possible to extract and re-package them as a Node.js script bundles, which then can be distributed using NPM Registry and easily accessible from any editors and IDEs with LSP client available. This would consolidate TON developers into using the upstream, official language server implementations and allow for streamlined bugfixes and improvements of the upstream extensions.

Deliverables:

References

Estimate suggested reward

Total: $400

novusnota commented 1 year ago

@anton-trunov @delovoyhomie Ready to get assigned, as my work on #302 will be completed in about one and a half weeks from now

anton-trunov commented 1 year ago

It would be great if the deliverables included refactoring of the https://github.com/tact-lang/tact-vscode to use the packaged solution.

As tact-vscode maintainers, what do you think @logvik and @pizza-777?

novusnota commented 1 year ago

@anton-trunov Oh, that'll make it a very different proposal. The thing I was intended to do was similar in spirit to vscode-langservers-extracted and not to the rather big refactor of tact-vscode, which probably has to be done not by me, but by the respective maintainers of the extension: @logvik and @pizza-777.

anton-trunov commented 1 year ago

Hmm, I'd very much like the packaged solution and the one from tact-vscode stay in sync.

novusnota commented 1 year ago

They will stay in sync in the sense that packaged solution would be automatically updated every time tact-vscode is, making the extension the main thing and this project its subsidiary :)

anton-trunov commented 1 year ago

That sounds good to me, thanks. Let's wait for the input from the VS Code plugin team, though.

novusnota commented 1 year ago

@delovoyhomie Submitted a Questbook proposal for this task. Submission deadline is set to 12th of November, 2023. Will deliver results right after completion of #302.

liketurbo commented 1 year ago

Will I be able to use a repackaged version with nvim-lspconfig?

novusnota commented 1 year ago

Yes, I'll send them a PR :)

anton-trunov commented 9 months ago

Hi @novusnota, any updates here?

anton-trunov commented 8 months ago

Hey @novusnota, sorry for pinging you one more time about the LSP packaging for Neovim, Emacs, Helix, etc. We are going to have a new Tact contest in about a month now, so it would be really cool to provide it to our contestants

novusnota commented 8 months ago

@anton-trunov No worries, thanks for pinging. I'll post an update here this or next week and finish the task.

novusnota commented 8 months ago

Almost there, wrapping up in 1-2 days (*when I find such time). FunC's LSP is being a bit rigid, but Tact one behaves much better, see screenshot below:

image

novusnota commented 6 months ago

I finally found time enough to debug most issues with FunC's server, such that it's now working for Helix, Neovim, etc. (see Neovim on screenshot below) :tada:

image

Wrapping up starting tomorrow. Now for sure :)

novusnota commented 6 months ago

Tact LS: :heavy_check_mark: Packed

image

Install it via npm i -g tact-extracted-ls (or with other Node.js package managers), then setup in your editor using instructions in README:

Will pack FunC LS today, then start gradually sending PRs to:

novusnota commented 6 months ago

FunC LS: :heavy_check_mark: Packed

image

Install it via npm i -g func-extracted-ls (or with other Node.js package managers), then setup in your editor using instructions in README:

That concludes the bounty! Now, I'll proceed to send PRs to ease configuration as described in https://github.com/ton-society/grants-and-bounties/issues/352#issuecomment-2059456416

novusnota commented 6 months ago

@delovoyhomie all done!

  1. Tact LS comment (above): https://github.com/ton-society/grants-and-bounties/issues/352#issuecomment-2059456416
  2. FunC LS comment (above): https://github.com/ton-society/grants-and-bounties/issues/352#issuecomment-2059895630
  3. PR to this repo: https://github.com/ton-society/grants-and-bounties/pull/558
  4. Questbook proposal update
anton-trunov commented 6 months ago

Great job @novusnota! As always :)