504 Commits

Author SHA1 Message Date
Prabir Shrestha
82796606f0 port s:FirstDifference to lua 2020-05-23 16:58:30 -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
mattn
7ce02b0781 Fix lsp#utils#path_to_uri (#809)
This should accept URI
2020-04-30 21:55:22 +09:00
Sam McCall
386ee33c3c Fix capability parsing when textDocumentSync.save is a boolean (#804)
clangd recently started sending `true`; vim-lsp emits E715: Dictionary required
when preparing to save. A boolean is valid here:

https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_didSave

> Server Capability:
>
> property name (optional): textDocumentSync.save
> property type: boolean | SaveOptions
2020-04-26 12:48:53 -07:00
buztard
e37f5e31f4 Fix open_location without mods (#806)
Co-authored-by: Bastian Winkler <buz@serious.im>
2020-04-26 12:35:24 -07:00
C. Wu
5c5649bdda Avoid autocmd-once for compatibility of VIM8.0 (#802) 2020-04-25 15:42:58 -07:00
hrsh7th
73bc4f1ceb Support any completion-engine (#672)
Co-authored-by: Prabir Shrestha <mail@prabir.me>
2020-04-25 08:34:12 -07:00
d86leader
cf43b59127 Fix unneccesary window splits (#774)
* fixed jump function splitting windows when file is modified
* fix open_location not working in most cases
* Fix lint warnings
* Fixed bad behavior with modified buffer
2020-04-25 08:27:44 -07:00
hrsh7th
92a56292bb Support text edit with folding (#788) 2020-04-19 10:22:48 -07:00
hrsh7th
cbddb059b5 Add snippet indicator (#759) 2020-04-19 10:14:38 -07:00
Agrin
adfdbe1483 Fix error on diagnostics from files not in buffer (#793) 2020-04-19 10:07:19 -07:00
thinca
9a4f8de6be Add <mods> support for opening new window (#776)
* Commonalize some similar functions

* Add <mods> support for some commands

Supported commands:
- :LspDeclaration
- :LspDefinition
- :LspTypeDefinition
- :LspImplementation
2020-04-19 09:59:16 -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
C. Wu
174e4bf82e Replace builtin trim() by lsp#utils#_trim() (#782)
Builtin trim() does not exist in e.g. vim 8.0, which is the default version of Ubuntu 18.04 LTS.
2020-04-07 18:36:43 +09:00
Tsuyoshi CHO
43be528071 on_xx handle callback / excepton log expand throwpoint (#778) 2020-04-04 14:12:30 +09:00
hrsh7th
4d8cd302bb Follow vscode textEdit behavior (#764)
* Follo vscode textEdit behavior

* Remove unnecessary cursor position fixing
2020-03-25 00:56:27 +09: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
Prabir Shrestha
24d9f18bca update vim-yggdrasil to 043d0ab53dcdd0d91b7c7cd205791d64d4ed9624 (#755) 2020-03-15 15:10:02 -07: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
mattn
5537feca35 Call command after edit (#734)
codeAction may contains edit and command both

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2020-03-01 00:42:48 +09:00
mattn
3d4daa4d34 Show only first line while popup visible (#731) 2020-02-28 16:10:21 +09:00
mattn
55e88054ce executeCommand do not handle response (#732) 2020-02-28 15:44:34 +09:00
mattn
b2b3199f05 Handle empty buffer-name (#730) 2020-02-28 15:12:17 +09:00
mattn
80ec75e1da Export root_uri resolved (#729)
* Export root_uri resolved

* Avoid uninitialized
2020-02-25 17:39:16 +09:00
hrsh7th
6f3d2d4e79 Update diagnostics when document open (#727) 2020-02-25 11:08:49 +09:00
hrsh7th
651bccfab8 Fix cursor pos on appling additionalTextEdit (#726) 2020-02-21 23:35:35 +09:00
mattn
77f3536c8b Add lsp#activate() (#713)
Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2020-02-20 01:47:15 +09:00
itchyny
b399cde35f Stop toggling lightline on setting contents of popup (#677)
Co-authored-by: mattn <mattn.jp@gmail.com>
2020-02-19 18:52:33 +09:00
mattn
aca92ddad4 Remove suffix (#723)
* Remove suffix

* Get default value in placeholder

* Fix make_valid_word

* Fix test
2020-02-19 15:21:47 +09:00
hrsh7th
415f6e685f Fix cursor pos after text edit (#724) 2020-02-17 21:39:46 +09:00
mattn
6e78f35aad ESC to cancel workspace/symbol (#717) 2020-02-15 01:03:42 +09:00
mattn
d9e471e142 Remove typed_pattern (#704)
* Remove typed_pattern

* Rename asyncomplete_refresh_pattern to vim_lsp_refresh_pattern

* Fix textEdit to clear inserted text

* Fix when startcol can not be found

* Find first item for refresh_pattenr

* Fix

* Update doc

* Trim empty spaces right

* Use space
2020-02-15 01:00:19 +09:00
hrsh7th
3e207c0ee4 Change text edit implementation to support \r (#718)
* Change text edit implementation to support \r

* Fix edit on unloaded buffer

* Add \r\n tests

* Fix for perf

Co-authored-by: mattn <mattn.jp@gmail.com>
2020-02-15 00:39:40 +09:00
mattn
a79931dcc5 Ignore error of prop_add/prop_remove (#721)
Some language server send diagnostics which send wrong locations.

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2020-02-14 20:45:23 +09:00
mattn
9962ef9ac8 Show only first line while popup visible (#714) 2020-02-13 07:51:53 -08:00
hrsh7th
20d1cf3968 Expand snippets after some textEdit related modifications (#682)
* Expand snippets after some textEdit related modifications

* Remove `vim-lsp-snippets` specific codes

Co-authored-by: mattn <mattn.jp@gmail.com>
2020-02-10 12:53:21 +09:00
Fujiwara Takuya
682a20caf5 g:lsp_diagnostics_{echo,float}_cursor are NOT exclusive (#711) 2020-02-09 19:01:12 -08:00
Fujiwara Takuya
52539a54ae Show diagnostics in a floating window (#700)
* fix comment

* fix indent

* support diagnostics in a floating window

* doc: add g:lsp_diagnostics_float_{cursor,delay}

* fix vint errors except unused variables

* suppress vint unused variable errors

* lint: use robust operator
2020-02-10 01:44:05 +09:00
taiyu
f33d624290 clear_all_highlights: check if buffer is loaded (#709)
when buffer is not loaded, len(getbufline(...)) returns 0, calling
prop_remove(..., lnum=1, lnum-end=0) which fails with invalid range
error
2020-02-08 15:37:10 -08:00
mattn
d35d297447 LspWorkspaceSymbol should redraw prompt (#708) 2020-02-08 23:41:56 +09:00
Timur Celik
2a346106de Don't allow hover window to close preview window (#705)
If g:lsp_preview_float is enabled there is no reason to close the
preview window on LspHover and LspSignatureHelp. Moreover the preview
window may be in use by other plugins or by the user.

Co-authored-by: mattn <mattn.jp@gmail.com>
2020-02-08 23:16:33 +09:00
itchyny
2526438c44 Register CursorMoved event only when required (#699) 2020-02-08 22:17:57 +09:00
mattn
701c734c91 Check text_edits is null (#697)
* Check text_edits is null

Some Language Server return null

* Add test for textEdit is null

* Check additionalTextEdits is null
2020-02-01 14:17:01 +09:00
mattn
bf8d206eca Cache signature_help_trigger_chars (#696)
* Cache signature_help_trigger_chars

* Move code to the part which updating init_results.

* Tweaking delay for signature help

* Disable warning of unused-variables
2020-01-31 00:31:53 +09:00
mattn
08f702bfcd Remove \r in description in completion popup (#694) 2020-01-30 02:08:43 +09:00
mattn
2c9a2c6bdf Fix insert text (#688)
* Fix insert text

When insertTextFormat==2, it should prefer insertText. But it may include placeholder.
When insertTextFormat!=2, use insertText since it is plain-text.
When it have textEdit, the inserted text will be modified in later, so insert only word.
Otherwize, insert label since it should be what the server want to insert.

* Check with valid word pattern

* ":" should be invalid character

* Add lsp#utils#make_valid_word

* Add l: prefix

* Add test

* Add test

* \t should be ignored

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2020-01-28 14:41:30 +09:00