Commit Graph

777 Commits

Author SHA1 Message Date
Prabir Shrestha
af55fd3a2c set synchornization client capabilities (#964) 2020-12-23 23:16:16 -08:00
Prabir Shrestha
632ae96876 add addtionalTextEdits for resolve support capability (#963) 2020-12-23 22:32:05 -08:00
Prabir Shrestha
4ff1d41412 [WIP] do not merge: integration tests with language servers (#959)
* download rust-analyzer

* added empty testproject-rust

* add integration tests for LspDocumentFormatSync

* wipeout all buffer

* set shiftwidth and tabstop

* set gobal shiftwidth and tabstop

* remove tabstop

* sleep 100m

* remove l:got

* get latest line

* sleep 4000m

* use setl shiftwidth=4

* use %bwipeout!

* wait for rust-analyzer to start

* fix lint issues

* indent left

* remove log

* disable log

* set timeout to 10sec

* add 100m sleep

* download rust-analyzer for linux neovim

* add message to diagnostics test

* severity is optional in diagnostics

* download rust-analyzer for mac_neovim

* update README.md with test section
2020-12-23 20:10:22 -08:00
Prabir Shrestha
5c91c59f2a add lsp#utils#buffer#get_indent_size() (#957) 2020-12-23 11:48:46 -08:00
Prabir Shrestha
b316729ef5 use callbag to implement document format with timeout (#956)
* use callbag to implement document format with timeout

* document lsp#stream() with example

* send message to stream when using lsp#_new_command

* use -- for args parsing and add g:lsp_document_format_sync_timeout

* throw string exception

* use new func for <plug>(lsp-document-format)

* document g:lsp_format_sync_timeout

* rename to document_formatting

* add document_range_formatting.vim

* remove formatting from ui/vim.vim

* document :LspDocumentRangeFormatSync

* add LspDocumentFormatSync example in README.md
2020-12-22 22:08:32 -08:00
Prabir Shrestha
9dce8c50ed update callbag to 9108df10d721c04a8908a391dde14aeabacc422d (#951)
* added lsp#callbag#skip()
* added lsp#callbag#spawn()
2020-12-13 12:07:23 -08:00
cxxxr
7d12fe6145 support for non-boolean values in serverCapabilities (#949) 2020-12-12 10:55:16 -08:00
Subhaditya Nath
29f93922c3 Fix highlight_references (#947)
matchadd() matchdelete() are window-local functions, and the matches are
window-local. So, use window-local variable to store and delete them.

Otherwise, the highlights are often not deleted properly, and remain
fixed. (The issue is not consistently reproducible, but frequent)
2020-12-11 20:46:50 -08:00
mattn
a56304f238 Fix width of documentation popup (#932)
* Fix width of documentatoin popup

* Show borders
2020-11-26 15:33:06 +09:00
Thomas Faingnaert
ce034201cd Do not remove empty lines in popup (#940)
This reverts commit 7ebf07135e.
2020-11-24 18:32:32 +01:00
mattn
c2f216b9ab Fix linecount (#939)
* Fix linecount

* Use line('$', winid)
2020-11-23 15:19:51 +09:00
Trevor Stone
e1adf0f84e Fix lsp-type-hierarchy plug mapping and a typo. (#934)
Fixes #933.
2020-11-20 01:28:21 +00:00
Sean Dewar
b8c9256f61 update callbag to 7648b13; fixes "innerTalkback" typo (#930) 2020-11-15 03:10:20 +00:00
Subhaditya Nath
45babeb947 Improved neovim floating windows, and misc. other improvements (#921) 2020-11-15 01:37:01 +09:00
mattn
594751093d Fix vint errors (#926) 2020-11-04 16:42:00 +09:00
mattn
eba0839b79 Check win_findbuf return empty (#922)
Fixes #803
2020-10-30 00:23:46 +09:00
William Boman
fdb69ab913 populate location list with all modified changes in a WorkspaceEdit (#555) 2020-10-23 19:41:32 -07:00
David Briscoe
d821bd8e18 Allow LspWorkspaceSymbol query on cmdline (#742)
Allow users to specify their query on the cmdline so they have easier
access to registers and vim-editing methods (especially with ctrl-f to
enter cmdline-window).
2020-10-18 09:16:32 -07:00
Prabir Shrestha
36cc104764 fix is_error for highlight_references (#920) 2020-10-18 09:07:22 -07:00
Prabir Shrestha
51eb1f6676 add support for window/showMessageRequest (#919)
* show message request
* materialize so doesn't throw error and add message to input list
* fix lint issues and rename flag to lsp_show_message_request_enabled
* use action and fix filter
* document g:lsp_show_message_request_enabled
2020-10-18 08:46:03 -07:00
Prabir Shrestha
860dcabb6b send server requests to stream (#918)
* send server requests to stream
* comment out method not found
2020-10-17 14:34:58 -07:00
Prabir Shrestha
9abaa02ad8 refactor type_hierarchy to different file (#916)
* refactor type_hierarchy to different file
* fix not supported
2020-10-17 10:32:49 -07:00
Łukasz Jan Niemier
dcdc00c296 fix(omni): add triggerKind to the completion_request (#913)
While this is not strictly required by standard, some LS freaks out
without it (looking at you ErlangLS).
2020-10-11 15:57:04 -07:00
hrsh7th
b6651468b7 Fix textEdit check (#914) 2020-10-05 03:46:25 +09:00
Josh Stone
d2b6922250 Set Vim variables directly instead of win_execute (#911)
- `lsp#ui#vim#output#setcontent` can use `setbufvar`, as suggested in
  https://github.com/tpope/vim-sleuth/issues/68#issuecomment-699512260.
- The example customizing the popup highlighting can use `setwinvar`,
  just like the example in [Vim's popup documentation][1].

[1]: 373863ed48/runtime/doc/popup.txt (L49)
2020-09-26 10:16:21 -07:00
hrsh7th
9755ec0c99 Improve completion (#908) 2020-09-24 10:54:58 +09:00
Luis Piloto
eea5cc0da7 Load retriggerCharacters for signature help. (#906)
* Load `retriggerCharacters` for signature help.

The LSP (v3.15) specification dictates both `triggerCharacters` and
`retriggerCharacters` in SignatureHelpOptions to trigger Signature
Help.  Currently, vim-lsp only loads `triggerCharacters` and not
`retriggerCharacters`.

This PR detects if the LSP server also sent `retriggerCharacters` along
`triggerCharacters`.  If so, we append them to the list of
`triggerChars` and treat them as if they were regular `triggerChars`.

* Fix indentation to conform to existing style.
2020-09-19 12:30:31 -07:00
mattn
6da958babd Fix 849: find nearest paths (#905) 2020-09-18 23:21:08 -07:00
mattn
46330cd0cb Set <nomodeline> to all of doautocmd (#904) 2020-09-17 22:36:19 +09:00
Prabir Shrestha
a8dd16f59a fix comment 2020-09-01 04:04:23 +00:00
Prabir Shrestha
a9ac38e0f4 update callbag.vim to v0.3.0 and better handling of errors using materalize (#899)
* use materialize() for highlight references
* re-enable highlight references by default
* unlet s:Dispose()
* fix checking for isUndefined()
* update callbag to v0.3.0
* dispose if exists
2020-08-31 21:02:34 -07:00
Prabir Shrestha
3c4ae44b38 update callbag.vim to v0.2.0 (#896)
* adds `fromPromise()` operator
* fixes `tap` operator
* adds `toList()` operator
* rename `fromArray()` to `fromList()`
2020-08-30 19:42:01 -07:00
Prabir Shrestha
eb0e5fb885 use callbag for Highlight references (#891) 2020-08-30 11:11:51 -07:00
Martin Kourim
1a01ffddbe Make sure signature_help and completion get properly disabled (#875)
* Make sure signature_help and completion get properly disabled

* Rename teardown -> _disable

Co-authored-by: Prabir Shrestha <mail@prabir.me>
2020-08-26 12:45:10 -07:00
Tim Weber
69dc272277 Supply first argument to bufnr() (#893)
* Supply first argument to bufnr()

The first argument defaults to the empty string ('') in Vim >= 8.1.1924
and NeoVim >= 0.4.0, but needs to be specified in older versions. The
empty string and the string '%' are equivalent.

* Use bufnr('%') instead of bufnr('')
2020-08-24 14:40:27 -07:00
Tim Weber
864b5e5409 Only define au for CompleteChanged if supported (#892)
This prevents an exception to be thrown by this function, causing the
lsp_server_init event not to be fired.
2020-08-24 14:18:12 -07:00
Prabir Shrestha
183047c5b9 update callbag to e8598fe3fcbd74bfee21 which fixes tap() 2020-08-24 00:40:49 +00:00
Prabir Shrestha
fc975d7260 update callbag to 9ef556bce269 - adds tap() (#890) 2020-08-23 14:17:43 -07:00
Jan Damm
e6912a01cd Make languageId configurable per lsp (#880)
* Make languageId configurable per lsp

* Fix linter warnings

* Use function to define languageId
2020-08-23 10:25:53 -07:00
mattn
e40e457744 Fix completion (#889)
* Fix completion

Some Language Server still return {"textEdit": null} or {"insertText": null}

* Add test
2020-08-24 01:07:40 +09:00
Prabir Shrestha
a18783de25 add lsp#stream() (#884) 2020-08-22 22:39:52 -07:00
Thanabodee Charoenpiriyakij
47bf0112d9 Don't call buf_clear_namespace if can't get buffer number from bufnr (#887)
Language server can send textDocument/publishDiagnostics on starting the
server and it can make vim call error because the uri that language
server publish can be un-opened file. Fix by checking buffer is exist
before calling buf_clear_namespace.

Fixes #886
2020-08-18 09:05:07 -07:00
skanehira
9fd514f4a8 fix doesn't work omni complete (#885) 2020-08-18 21:09:20 +09:00
mattn
a926dcf9f8 Handle invalid range (#878) 2020-08-06 18:51:23 +09:00
Luma
d9835b8a4a check nvim_win availability before attempting to close (#877) 2020-08-04 18:31:27 -07:00
mattn
04cef02eed Trigger didOpen for buffers already loaded (#873) 2020-07-29 20:32:31 +09:00
Prabir Shrestha
b05c8da3ec remove dup float2nr 2020-07-18 17:10:45 +00:00
Ttayu
8673f8e109 Avoid window height is 0. (#864)
Co-authored-by: Prabir Shrestha <mail@prabir.me>
2020-07-18 10:08:13 -07:00
hrsh7th
bb765bb7af Fix cursor position after text edit (#870) 2020-07-18 14:44:45 +09:00
Davit Samvelyan
11b1350700 Text props for reference highlights (#679)
* text props for references, semantic high. bug.

Use text props for highlighting references, since they support
combining and look better with semantic highlighting.
Fix bug in semantic highlighting when invalid data for semantic
highlighting in the middle of file breaks semantic highlighting for the
half after erroneous line.

* Add SemanticHighlight prefix to log error message
2020-06-29 13:55:06 -07:00