Commit Graph

206 Commits

Author SHA1 Message Date
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
mattn
eba0839b79 Check win_findbuf return empty (#922)
Fixes #803
2020-10-30 00:23:46 +09: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
mattn
46330cd0cb Set <nomodeline> to all of doautocmd (#904) 2020-09-17 22:36:19 +09: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
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
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
Luma
d9835b8a4a check nvim_win availability before attempting to close (#877) 2020-08-04 18:31:27 -07: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
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
Prabir Shrestha
0d3c165a64 fix Invalid window id when calling close preview (fixes #858) (#859) 2020-06-29 13:15:50 -07:00
pocari
1c58fd6020 fix API call error (#857) 2020-06-28 21:51:29 -07:00
Thomas Lee
14e553613d Fix documentation preview window (#856)
* Cast height to integer
* Cast width to integer
2020-06-28 21:13:02 -07:00
Ttayu
78ccf69584 Avoid window width is 0. (#852) 2020-06-27 10:31:09 -07:00
Prabir Shrestha
32fae1f0e9 use allowlist and blocklist instead (#847)
* use allowlist and blocklist instead
* add lsp#get_allowed_servers()
2020-06-26 16:13:09 -07:00
Prabir Shrestha
9389c28ae2 migrate diagnostics float cursor to use callbag (#846)
* use callbag for diagnostics float cursor
* fix feature flag test
2020-06-26 11:15:31 -07:00
Prabir Shrestha
c245bfd7a4 use callbag (#845)
* add callbag.vim

* add diagnostics

* add comments

* implement cancel

* optimize cancelled=1

* handle more cancel cases

* use callbag for echo.vim

* rename to _enable() _disable() and also check for changedtick

* move to internal

* group lsp#request

* ignore terminal for echo

* dont bother to subscribe if diagnostics echo not enabled

* remove deprecation comment

* update callbag.vim to v0.1.0

* fix lint issues
2020-06-25 07:42:28 -07:00
randomgeek78
ac908d61e8 fix stuck floating window issue in neovim (#844)
Issue: https://github.com/prabirshrestha/vim-lsp/issues/819

Co-authored-by: Random Geek <randomgeek78@gmail.com>
2020-06-22 20:04:17 -07:00
Thomas Faingnaert
a3673dde78 [WIP] Popup documentation (#507)
* Show documentation in Vim popup

* Use timer

* Reuse logic from output.vim

* Change default text

* Rename functions

* Refactor

* Use v:event

* Add comment

* Remove log

* Refactor

* Implement documentation in Neovim

* Cleanup Neovim popup

* Let Neovim float take all available space

* Extract get_size_info

* Reuse sizing logic from output.vim

* Fix Neovim positioning being reset

* Update autoload/lsp/ui/vim/documentation.vim

Co-Authored-By: Christian Clason <christian.clason@uni-due.de>

* Make vint happy

* Retrigger Travis CI

* add g:lsp_documentation_float flag

* fix lint issues

Co-authored-by: Christian Clason <christian.clason@uni-due.de>
Co-authored-by: Prabir Shrestha <mail@prabir.me>
2020-06-20 12:21:25 -07:00
mityu
07d0f481cd Add checks for cmdwin (#812)
Calling lsp#ui#vim#output#preview() or lsp#ui#vim#output#focuspreview() in cmdwin gives E11 errors.
2020-06-09 22:51:15 -07:00
Daisuke Suzuki
18f2e922f7 Add support for code lens (#831) 2020-06-09 22:45:20 -07:00
John Schug
2ca2fe3854 Add support for the tagfunc option (#815)
* Add support for tagfunc option

* Consolidate various synchronous wait implementations

* Refactor to use lsp#utils#position#lsp_to_vim

Also marks get_symbol_text_from_kind as internal and fixes compatibility
with older vims.
2020-05-25 14:41:21 -07:00
Cody Buell
a943fe558d Add ability to set unique hi for virtual text (#811)
Have virtual text default to vim-lsp defaults for each severity sign,
follow any set or link for a user defined Lsp*Text highlight group, but
allow for unique hi for Lsp*Virtual.

Updated documentation to reflect changes.  Fixed typo in README.md.
2020-05-08 21:37:30 -07:00
Eivy
c029ce1330 Jumping to diagnostics with command args '-nowrap' (#770)
* Add func 'lsp#utils#parse_command_options'

* Add wrap option to jumping to diagnostic

* Update doc

* Fix lint error

* Remove debug code
2020-05-02 18:41:55 -07:00
Agrin
adfdbe1483 Fix error on diagnostics from files not in buffer (#793) 2020-04-19 10:07:19 -07:00
Mitin Arseny
5dd94c66f7 lsp_diagnostics_updated autocommand (#783)
* feat: lsp_diagnostics_updated autocommand

* docs: remove lightline.vim

* docs: generalize not only for status line
2020-04-10 20:38:28 -07:00
mattn
f79bf39922 Count errors if severity is 1 or not have severity (#758)
* Count errors if severity is 1 or not have severity

Fixes #757

* Add test
2020-03-17 19:24:41 +09:00
hrsh7th
2de8f4d479 Compute overflow information in completion (#739)
* Fix completion for overflowinfo

* Use complete start position to compute offset

* Fix test
2020-03-05 23:22:53 +09:00
Hyeon Kim
9fa593aed4 Fix preview feature for vim without patch-8.1.1517 (#728)
Even if `g:lsp_preview_float` is true, vim-lsp should call `:pclose` if
`s:use_preview` is true.
2020-03-03 23:38:26 +09:00
mattn
85a03f2b01 Merge codeAction(s) (#736)
* Merge codeAction(s)

* Print server name

* Fix indentation

* Use empty()
2020-03-03 14:29:42 +09:00
hrsh7th
46308234a2 Implement register command (#735)
* Implemente register command

* Add server_name to command context

* Expose lsp_to_vim, vim_to_lsp API's as public
2020-03-03 13:09:41 +09:00