At some point when writing the `LspStopServer` description I've
incorrectly merged two sentences into. Fixed that and added a few minor
clarifications.
* fix languageId incorrectly set to "ctrlspace"
* remove get_line_count_buf() which incorrectly returned line('$') for hidden buffers
The problem was that current buffer may not be the one requested. Later it
caused vim to throw exception about invalid line number when setting text props,
and that led to initialization failure for some buffers (and lsp_buffer_enabled
autocommand not fired).
* don't register server twice
* skip registering server only if server_info matches
* revert changes to lsp#register_server
---------
Co-authored-by: Krzysztof Sachanowicz <ksachanowicz@striketechnologies.com>
It is convenient to be able to stop all LSP servers, regardless of the
currently active buffer.
Also, it seems confusing that when a server name is specified, it is
only stopped if it is also one handling the current buffer type. I
would imagine it is quite rare to have more than one server handing a
specific buffer type. And if one explicitly specified a name, it seems
reasonable to stop this particular server, regardless of the currently
active buffer.
When set `let g:lsp_use_native_client = 1` to enable native lsp client support,
if call `:LspStopServer` to stop the lsp server, the server stopped but the
status still show it as `running` by `:LspStatus`, this patch try to fix
this issue.
When using typescript-language-server, in content `Math.ab|`, if you type
`<C-X><C-o>` for omni completion, it will be completed with `s`. Then, the
content will become `Math.abs|`. If you continue typing `(`, the `(` will
be removed. Also, if type `<CR>`, a new line will be added, resulting in
`Math.abs|s\nMath.ab`. This patch attempts to fix this issue.
It is not immediately clear what are the possible values for this
configuration parameter. And it is nice to be a bit more explicit about
the meaning of each option.
Co-authored-by: Prabir Shrestha <mail@prabir.me>
It is sometimes useful to generate `workspace_config` using a callback.
For example, if the produced config needs to include some information
from the actual workspace.
When checking for backspace in `CompleteDone` event, also look at the
line number. If the line number changed, the user probably pressed
something like `<CR>` and not backspace.
Since v9.0.0993 vim performs a full redraw when removing text property
types, which causes flickering because vim-lsp currently removes and
re-adds the property type every time the highlight is updated. To avoid
that, we can just check if the property type already exists on the
given buffer, and only add it if it doesn't exist yet.
* add g:lsp_experimental_native_lsp flag to enable native vim lsp client
* send request and correctly call on_notification
* add support for native client in lsp#client#send_notification
* Add native lsp client support for lsp#client#send_response
* add native notification support
* add support for native stop job
* handle error response for document_formatting.vim and code_action.vim
* add missing return for code action
* fix indent
* undo code action error
* check for a:response to be of type dict as stderr will send string
* use out_cb and err_cb instead of channel callback
* bump has_native_client version check to 8.2.4780 which fixes LSP parsing messages when partial data is received
* rename g:lsp_experimental_native_lsp to g:lsp_use_native_client
* fix s:native_err_cb
* pass env
* disable lsp_use_native_client
* add lsp#utils#has_native_lsp_client()
* clean up log
* handle requests from server
* fix lint issues
* update docs