165 Commits

Author SHA1 Message Date
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
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
55e88054ce executeCommand do not handle response (#732) 2020-02-28 15:44:34 +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
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
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
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
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
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
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
bfca7a974d silent call feedkeys (#691)
* clear message of calling feedkeys

* Fix comment

* Fix comment
2020-01-28 14:33:57 +09:00
mattn
47ad01195c Treat severity=1 when not specified (#686) 2020-01-23 23:46:23 +09:00
mattn
6cbb4238e9 Check capability is dict (#675) 2020-01-19 00:39:17 +09:00
Yasuhiro Matsumoto
7b793a1d79 Check textEdit is not null 2020-01-17 21:46:46 +09:00
hrsh7th
56835a9f3d Add comment 2020-01-14 12:27:06 +09:00
hrsh7th
6262baebcd Avoid clearing managed user_data unexpectedly 2020-01-14 12:22:12 +09:00
hrsh7th
70234feca4 Improve code action (#663)
* Improve code action

* Add LspCodeActionSync

* Fix miss argument

* Fix for the review

* Add utils and tests

* Remove unused function
2020-01-09 08:35:39 -08:00
Thomas Faingnaert
eadb20a0c8 Cache semantic tokens (#635)
* Move token calculation

* Cache tokens

* Avoid overflow in hash function
2020-01-06 21:07:16 +01:00
hrsh7th
fef60795ec Improve signature help with lexima.vim (#638)
* Improve signature help with lexima.vim

* Fix buffer change problem

* Display signature help after cursor jumped

* Fix event

* Add _ prefix for inner functions
2020-01-04 09:17:03 -08:00
prabirshrestha
13c439051c do not echo Retrieving signature help 2020-01-02 20:13:58 -08:00
hrsh7th
f769a450b2 Fix CompleteDone (#637)
* Move some codes to completion.vim that related to handling CompleteDone.

* Add abort

* Fix test

* Add l: prefix to self vars

* Disable unused vars

* Restore position

* Support snippet simple case and vim-lsp-snippets

* Support g:lsp_text_edit_enabled

* Fix for v:null results

* Fix multi-byte chars

* Add document

* Fix for vim-lsp-snippets for now

* Prepare to future improvements

* More clalify line comment

* User get_user_data instead of extract_user_data

* Always use [''] pattern for accessing dictionary property

* Fix misspelling

* More strict check for completionProvider.resolveProvider

* Fix obj.key to obj['key']

* Store completed_item id to the user_data

* Fix omni tests

* Apply for the review
- Rename expand_text_simply -> simple_expand_text
- to_col -> _lsp_to_vim
- Rename user_data key

* Add example tests

* Add timeout to completionItem/resolve in completion.vim

* Fix timeout feature

* Add timeout log

* Fix documents
2020-01-02 01:08:34 -08:00
prabirshrestha
44e0823d55 fix :LspDocumentDiagnostics 2020-01-01 18:12:26 -08:00
Prabir Shrestha
b02345d223 added lsp#utils#location#_lsp_to_vim_list (#647)
* added lsp#utils#location#_lsp_to_vim_list
* check of response.result
* remove lsp#ui#vim#utils#locations_to_loc_list
* refactor to use s:open_location
* use lsp#utils#is_file_uri
2020-01-01 16:10:33 -08:00
Prabir Shrestha
3aba91cf71 remove lsp#utils#to_col in favor of lsp#utils#position#_lsp_to_vim (#645)
* refactor to use lsp#utils#position#_lsp_to_vim
* remove lsp#utils#to_col in favor of lsp#utils#position#_lsp_to_vim
* fix doc
2020-01-01 13:33:36 -08:00
Prabir Shrestha
ae1aa1459f support hierarchical document symbol even if we don't explicilty set it to true (#631) 2019-12-26 13:52:46 -08:00
Thomas Faingnaert
2f725fb4c3 Implement semantic highlighting (#464) 2019-12-26 10:08:30 -08:00
Prabir Shrestha
9becd620b7 escape \r in preview (#626) 2019-12-25 22:45:29 -08:00
nhaliday
fa10d415d5 Fix an issue in highlighting of references. (#506)
The client tracks whether it has received a response using a global
'pending' variable. This commit ensures the client clears the 'pending'
variable in the case where it has received a response from the server
but that response was an error response, so that future requests actually
go through.
2019-12-25 13:15:35 -08:00
Łukasz Jan Niemier
f931d0d29f Use location list instead of quickfix for diagnostics (#335)
Diagnostics are enabled only for current document which makes it
pointless to feed them to the QuickFix which is global. This PR changes
that behaviour to use location list, which is window-local, instead.

Close #75
2019-12-25 13:00:02 -08:00
thinca
fcf5439b90 Fix error on s:set_textprops() (#600)
`bufwinid()` works on current tab page only, so when user changes the
current tab page, bufwinid() returns -1.
2019-12-15 14:20:10 +09:00
Shumpei Shiina
feefc53ea6 Jump to next/previous diagnostics other than error diagnostics (#587)
- add LspNextWarning, LspPreviousWarning commands to jump to warnings
- add LspNextDiagnostic, LspPreviousDiagnostic commands to jump to
  all kinds of diagnostics
2019-12-14 09:07:05 -08:00
Hirokazu Hata
7ebf07135e If the hover response has only empty string content, we don't display anything. (#553) 2019-12-08 14:08:57 -08:00
Thomas Faingnaert
864e7df1d2 Add explicit line numbers to prop_remove calls (#574) 2019-11-22 01:42:39 -08:00
mattn
1eef992603 Merge pull request #569 from itchyny/fix-async-error-buf-changed
fix error on switching the buffer with longer lines
2019-11-21 16:34:31 +09:00
hrsh7th
4d0ec0d698 Avoid wrong buffer open (#502) 2019-11-20 01:43:22 -08:00
itchyny
fd40b2f4d6 fix error on switching the buffer with longer lines 2019-11-20 06:30:32 +09:00