Commit Graph

242 Commits

Author SHA1 Message Date
mattn
516fd7ce95 diagnostics list can be v:null (#1190)
* diagnostics list can be v:null

Ref #1186

* ditto

* Small refactoring

* Use lsp#utils#iteratable for the list which possibly be v:null
2021-06-09 01:51:59 +09:00
Linda_pp
72b9a300c7 Set type of location list items for diagnostics (#1143)
* set type of location list items for diagnostics

* use s:get_diagnostic_severity_text() once while making location list from diagnostics results

Co-authored-by: mattn <mattn.jp@gmail.com>
2021-06-07 20:47:17 +09:00
Linda_pp
1f98a06566 check if selected items are empty on handling code action (fix #1156) (#1157) 2021-05-03 15:40:37 +09:00
rhysd
fd8bd1c799 make helper function to get completion text from CompletionItem 2021-04-03 14:44:32 +09:00
Linda_pp
ce3add957a Fix document layout and misspellings (#1127)
* fix document layout

* fix misspellings
2021-03-31 23:09:06 +09:00
Linda_pp
4d4a908224 select preferred action by default in quickpick (#1126)
spec: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_codeAction
2021-03-30 02:30:38 +09:00
Prabir Shrestha
882376cc66 apply markdown for output (#1100) 2021-03-28 12:11:07 -07:00
Linda_pp
337d834443 Include command argument labels in Code Lens item's text (fix #1118) (#1119)
* fix index out of range error when no item in quickpick list

* update embedded quickpick to cf41eecb983c41e5fc45e83291b551a85fe554d3

* generate subtitle of codelens item from command arguments' labels

* add tests for lsp#ui#vim#code_lens#_get_subtitle()
2021-03-28 11:58:41 -07:00
Linda_pp
51adba85f0 use quickpick to choose Code Action (#1123)
Co-authored-by: mattn <mattn.jp@gmail.com>
2021-03-28 22:06:41 +09:00
Linda_pp
a3b58eb7c4 Handle disabled code action (#1115)
* handle disabled code action

* enable disabledSupport capability

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2021-03-21 22:17:51 +09:00
Linda_pp
4819b7474a include kind in code action list item (#1111) 2021-03-20 10:57:58 -07:00
Linda_pp
84e9beb5c8 fix handling empty 'insertText' field (fix #1102) (#1109) 2021-03-19 01:34:37 +09:00
Prabir Shrestha
24533c28ae add lsp_signature_help_delay to allow users to configure and default to 200 (#1106) 2021-03-15 22:47:30 -07:00
Linda_pp
f076e6a7c0 Use 'label' value when 'insertText' or 'filterText' is falsy (#1095)
* use label when filterText is falsy value

* use label when insertText is falsy value on completion done

* Revert "fix inserting "v:null" when newText in textEdit is null (#1093)"

This reverts commit 907f1c9667.

* Revert "add test case where newText is null for #1093 (#1094)"

This reverts commit e214f1cfee.
2021-03-14 01:59:08 +09:00
hrsh7th
fea03524cb Does not fire lsp_float_closed if floating-window does not exists (#1082) 2021-03-02 19:59:14 -08:00
Prabir Shrestha
1cade410de refactor preview code (#1083) 2021-03-02 19:00:26 -08:00
Akinori Hattori
4e9a71c724 Fix preview without popup window (#1068) 2021-03-02 18:56:11 -08:00
Prabir Shrestha
a78536ad74 refactor LspHover (#1063)
* use callbag for hover
2021-02-22 04:35:01 -08:00
hrsh7th
0c77beb2eb Fix #1059 (#1060) 2021-01-26 20:18:32 +09:00
Prabir Shrestha
cacfc79eb4 completion/resolve support for documentation and use the new floating window (#1052)
* doc

* floating window with completion/resolve

* add comments

* use _split_by_eol

* copy event

* fix dupe

* Fix size/markdown/detail

* - Improve for exceptional case
- Fix code style
- Support detail only case

* Add lsp_float_opened/lsp_float_closed

* remove old documentation code

* update documenation and change flags to use g:lsp_completion_documentation

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2021-01-23 09:11:27 -08:00
Prabir Shrestha
51a566c878 default to using quickpick for codelens (#1053) 2021-01-18 09:54:59 -08:00
Prabir Shrestha
6038748cb1 Improve completion perf (#1038)
* improve completion perf

* improve completion popup perf

* fix tests

* remove old s:get_vim_completion_item
2021-01-16 11:05:21 -08:00
jerojasro
3bca7e8c8a Fix/showsigpreview (#1042)
* ensure l:bufferlines is defined when using preview window

previously, when using the preview window to show signatures, the code
failed with an stacktrace like:

    "s:on_stdout client request on_notification() error",
    "Vim(return):E121: Undefined variable: l:bufferlines",
    "function <SNR>118_out_cb[2]..
    <SNR>107_on_stdout[79]..
    <SNR>92_request_on_notification[3]..
    <SNR>93_createNext[1]..
    <SNR>93_subscribeSourceCallback[2]..
    <lambda>738[1]..
    <SNR>94_handle_signature_help[48]..
    lsp#ui#vim#output#preview[39]..
    lsp#ui#vim#output#get_size_info, line 22"

This commit ensures that the required variable is properly defined in
all the situations (popup, nvim, preview window)

* removed superfluous return statement
2021-01-13 15:57:28 +09:00
Subhaditya Nath
03ca21d60a Improve documentation popup in neovim. Fix typo. (#1017)
* Typo fixed

* Improve placement of documentation popup in neovim

If the available space in either side of the completion popup is less
than 3/4 of the required width, then we shall place the documentation
popup below (or above, if necessary) of the completion popup.

Previously, the documentation was just squashed into whatever space was
available. It made documentation undreadable in some cases.
2021-01-09 11:13:44 -08:00
Subhaditya Nath
ac7eacd3a2 Fix prabirshrestha/vim-lsp#1016 (#1027)
Closes prabirshrestha/vim-lsp#1016
2021-01-08 17:25:32 +09:00
Subhaditya Nath
2ef2f768d3 Fix prabirshrestha/vim-lsp#1024 (#1028)
Closes prabirshrestha/vim-lsp#1024
2021-01-08 16:38:39 +09:00
Prabir Shrestha
89135264c2 embed quickpick.vim and add experimental quickpick support for codelens (#1019) 2021-01-05 05:26:54 +00:00
Prabir Shrestha
cb506f5112 add line in codelens (#1015) 2021-01-03 14:31:16 -08:00
Prabir Shrestha
7d15d0f581 convert more of codelens to callbag (#1013) 2021-01-03 02:06:03 -08:00
Prabir Shrestha
62ef9585a1 remove CodeLensSync (#1011) 2021-01-02 23:12:09 -08:00
Prabir Shrestha
6d928e18ba use reduce instead of storing local variable (#1010) 2021-01-02 23:08:19 -08:00
hrsh7th
d2cbe800e7 Fix cursor position calculation on complete done (#1008) 2021-01-03 14:13:16 +09:00
Prabir Shrestha
1a7a6e08de add support for codeLens/resolve (#1007) 2021-01-02 19:25:19 -08:00
Prabir Shrestha
268341fe60 Diagnostics refactor movements (#1004) 2021-01-02 13:59:31 -08:00
Prabir Shrestha
7c43b01635 refactor diagnostics get buffer first error line to use the new internal state (#1003) 2021-01-02 13:06:07 -08:00
mattn
e846a999f7 Fix function argument (#1002)
Fixes #1000
2021-01-02 12:09:12 -08:00
hrsh7th
f6a66a11b5 Fix cursor position after completion (#998)
* Fix cursor position after completion

* Calculate end position

* Add comments
2021-01-02 17:38:16 +09:00
Prabir Shrestha
098509278d refactor diagnostics count to using diagnostics state (#999) 2021-01-02 00:14:05 -08:00
Prabir Shrestha
2eb8d16413 refactor diagnostics under cursor to use the new internal diagnostics state (#997) 2021-01-01 11:31:07 -08:00
Prabir Shrestha
efd07d859e Revamp diagnostics highlights (#995) 2020-12-31 23:13:19 -08:00
Prabir Shrestha
5743ae2110 Diagnostics signs revamp (#994) 2020-12-31 01:23:26 -08:00
Prabir Shrestha
1489cf8295 Revamp diagnostics virtual text (#990) 2020-12-30 14:49:44 -08:00
Prabir Shrestha
d025869d04 check for nvim float support before using it (#986) 2020-12-29 14:35:25 -08:00
Prabir Shrestha
6bb6069f94 Diagnostics for all buffers (#982)
* render diagnostics in loclist and fix args paser
* document --buffers flag for LspDocumentDiagnostics
* do not show diagnostics if it is disabled for buffer
* remove old code and fix plug mapping for lsp-document-diagnostics
* add unit tests for document diagnostics command
2020-12-27 22:44:18 -08:00
bamchoh
5f23ecd388 Convert lowercase drive letters to uppercase (#953)
* Convert lowercase drive letters to uppercase

I faced a problem that error diagnostics message does not shown in golang source code. In a result of my investigation, this problem occurs when I change the current directory with lowercase driveletter like `cd c:\dev\go\test001`. When `cd C:\dev\go\test001` is no problem. To avoid this problem, we need to convert driver letter to uppercase in lsp#utils#path_to_uri function.

* Update utils.vimspec

* Revise a code in diagnostics.vim instead of utils.vim to reduce impact of modification

* Create a function to normalize uri

* Add a comment about normalize discussion

* Delete s:is_win check

* Revise comment for normalization of urls
2020-12-25 11:11:47 -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
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
Subhaditya Nath
45babeb947 Improved neovim floating windows, and misc. other improvements (#921) 2020-11-15 01:37:01 +09:00