JakeBecker / elixir-ls

A frontend-independent IDE "smartness" server for Elixir. Implements the JSON-based "Language Server Protocol" standard and provides debugger support via VS Code's debugger protocol.
Apache License 2.0
843 stars 52 forks source link

Requesting didSave notification in server capabilities #175

Closed Coffei closed 4 years ago

Coffei commented 5 years ago

Since the server is using didSave notification, it needs to specifically ask for it in the server capabilities. In VS Code it works fine without this, because the editor sends the notification regardless of what server advertises. However, other editors, such as Emacs with lsp-mode, break without this config.

I run into this issue in Emacs lsp-mode (https://github.com/emacs-lsp/lsp-ui/issues/300), when I added the %{"save" => true} to the server capabilities in the client, it fixed the problem.

Coffei commented 5 years ago

Hmm.. today I switched to VIM, and to my surprise I found this change breaks coc.nvim. So I tried VSCode and it's also broken. I get the following errors:

** (UndefinedFunctionError) function nil.text/0 is undefined
        nil.text()

which point to either hover handle request or definition handle request. It seems the state.source_files[uri] evaluates to nil.

I don't have the resources to fix this ASAP but do plan to look into it eventually.

Coffei commented 5 years ago

Fixed, forgot to include open/close events. Tested in Coc.nvim, VSCode and Emacs and all works fine.

shakram02 commented 4 years ago

hello @Coffei, do you mind submitting this PR to this repo? The other one is more active than this one, please check this post.

Coffei commented 4 years ago

Yeah, will do that. Kinda forgot about this PR altogether.

JakeBecker commented 4 years ago

This project has moved!

It's now being maintained by proactive volunteers from the Elixir community over at elixir-lsp/elixir-ls. Updates will continue to be published from that repo to the original VS Code extension, so no need to switch plugins if you're using VS Code.

If you're still interested in merging this PR, please do the following:

  1. Check that the issue you're addressing still occurs with the latest version of the VS Code plugin (which is published from the new repo)
  2. If your PR references a Github issue, check if there's already an issue filed on the new repo and create one if not
  3. Rebase your PR from the new repo (which has diverged significantly) and re-submit it there.

Thank you!