Commit Graph

379 Commits

Author SHA1 Message Date
Christian Clason
2ca8f02a64
lsp: add preview_location util function (#12368)
* add preview_location

* add doc stub

* doc style; return bufnr&winnr of preview

* doc: function may return nil

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>

* doc: fixup

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
2020-05-26 09:07:10 -04:00
Jesse
f559e5249e
LSP: Add textDocument/codeAction support (#11607)
* Add textDocument/codeAction

* Add callback for workspace/executeCommand
* Escape newlines in codeAction titles
* Return empty list in get_line_diagnostics if no buffer diagnostics
* Add stub documentation
* Validate context parameter in code_action
* Add support for edit in CodeAction responses
* Group diagnostics by line in vim.lsp.util.get_line_diagnostics()
* Advertise code action literal support
2020-05-16 01:18:59 +02:00
Christian Clason
ea347b18d8
lsp: add workspace/symbol (#12224)
* lsp: add workspace/symbol
* refactor symbol callback
* set hierarchical symbol support to true
* add documentation and default mapping

Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
2020-05-02 17:56:05 +02:00
Ghjuvan Lacambre
f9055c585f
LSP: enable using different highlighting rules for LSP signs (#12176)
This commit creates 4 new highlight groups:
- LspDiagnosticsErrorSign
- LspDiagnosticsWarningSign
- LspDiagnosticsInformationSign
- LspDiagnosticsHintSign

These highlight groups are linked to their corresponding LspDiagnostics
highlight groups by default.

This lets users choose a different color for their sign columns and
virtualtext diagnostics.
2020-04-29 16:53:13 +02:00
jakbyte
5f41717838
LSP: don't redefine LspDiagnostics signs #12164
fix #12162
2020-04-26 15:36:40 -07:00
Thore Weilbier
68511924d0
LSP: remove obsolete "peek definition" code #12178
The method with the name 'textDocument/peekDefinition' is not part of
the official language server protocol specification. Therefore no
language server can/will support this. Thereby all related code and
documentation as been removed.
2020-04-25 21:47:48 -07:00
Mathias Fußenegger
ef0398fe88
LSP: Expose diagnostics grouped by bufnr (#11932)
Expose `vim.lsp.buf.diagnostics_by_buf`

This makes it easier to customize the diagnostics behavior. For example
to defer the update they can override the
`textDocument/publishDiagnostics` callback to only call
`buf_diagnostics_save_positions` and then defer the other actions to a
autocmd event.
2020-04-25 15:46:58 +02:00
Hirokazu Hata
2a5d766581
doc: fix vim.lsp.stop_all_clients doc (#12055) 2020-04-21 14:51:51 +02:00
Hirokazu Hata
16262472cd
lsp: add 'textDocument/documentSymbol’ callback
Spec: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_documentSymbol
2020-03-01 09:10:02 +09:00
Alvaro Muñoz
83add102cf
Add signs for Lsp diagnostics (#11668)
* Add signs for Lsp diagnostics
* defer sign definition until init.vim is loaded
2020-02-27 12:12:53 +01:00
Alvaro Muñoz
ad745f9da2
add support to show diagnostics count in statusline (#11641)
* add support to show diagnostics count in statusline
* documentation
2020-02-26 20:22:14 +01:00
Alvaro Muñoz
ca8699378c
LSP: implement documentHighlight (#11638)
* implement documentHighlight
* fix bug
* document highlight groups
* use uppercase for help section title
* documentation
2020-02-26 20:10:16 +01:00
Mathias Fußenegger
d9657b3ae2
doc/lsp: start_client config cmd must be a list (#11866)
doc/lsp: start_client config cmd must be a list

After the merge of https://github.com/neovim/neovim/pull/11847 cmd can
no longer be a string but must be a list.
2020-02-13 20:38:47 +01:00
Justin M. Keyes
9231684986
doc [ci skip] #11656 2020-01-12 23:41:55 -08:00
Justin M. Keyes
0a1c6d9a37 LSP: highlight groups test, doc 2020-01-08 22:18:18 -08:00
Justin M. Keyes
ac6ebfcc1d LSP: eliminate lsp.print_debug_info…()
Reduce API surface.  We should not add functions unless they are really
needed.  Users should be nudged to use vim.inspect() directly.
2019-12-31 15:39:17 -08:00
Justin M. Keyes
8b84119650 LSP: eliminate lsp.stop_all_clients()
Reduce API surface.  We don't need so many variations of functions. Too
many functions means verbose, largely redundant documentation, tests,
and cognitive burden.
2019-12-31 15:39:17 -08:00
Justin M. Keyes
b112fe828f gen_vimdoc.py: generate LSP docs 2019-12-31 08:06:48 -08:00
Justin M. Keyes
d839c35871 doc: LSP 2019-12-31 02:55:12 -08:00
Justin M. Keyes
93e7c7e3bd doc [ci skip] 2019-12-31 02:25:10 -08:00
Ashkan Kiani
34a59242a0 Revert "runtime: Add vim.lsp.get_client_by_name" #11623
reverts 680693e263 #11603
2019-12-29 09:05:32 +01:00
Hirokazu Hata
680693e263 runtime: Add vim.lsp.get_client_by_name (#11603)
Since the client name is more obvious than the client id for the user, add an
API to get the lsp client by the client name.
2019-12-28 09:28:00 -08:00
Justin M. Keyes
7111fe9459
doc: LSP [ci skip] #11524 2019-12-10 00:29:39 -08:00
Justin M. Keyes
fd5710ae9a
doc + extmarks tweaks #11421
- nvim_buf_get_extmarks: rename "amount" => "limit"
- rename `set_extmark_index_from_obj`
2019-11-25 01:08:02 -08:00
Ashkan Kiani
43d73ee884 Fix position params for encoding. 2019-11-21 15:41:32 -08:00
Ashkan Kiani
bcae04f6c6 Updates
- Use correct implementation of text_edits.
- Send indent options to rangeFormatting and formatting.
- Remove references to vim bindings and filetype from lsp.txt
- Add more examples to docs.
- Add before_init to allow changing initialize_params.
2019-11-21 15:19:06 -08:00
Ashkan Kiani
03eb88848c Change callback resolution to be dynamic.
This allows default_callbacks to be specified after client creation to
be considered. Also it simplifies the code.
2019-11-20 16:09:03 -08:00
Ashkan Kiani
a4b7004f48 Move everything to buf & default_callbacks
- Rename builtin_callbacks to default_callbacks and slightly change its
semantics:
  - No longer contains the default implementations. Instead, any
  default_callbacks will be used in preference for our .buf methods.
  - Add this to the docs.
2019-11-20 16:03:32 -08:00
Ashkan Kiani
00dc12c5d8 lua LSP client: initial implementation (#11336)
Mainly configuration and RPC infrastructure can be considered "done". Specific requests and their callbacks will be improved later (and also served by plugins). There are also some TODO:s for the client itself, like incremental updates.

Co-authored by at-tjdevries and at-h-michael, with many review/suggestion contributions.
2019-11-13 21:55:26 +01:00