Commit Graph

616 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto
49a886853e Set default path_uri if not given or not found with patterns. 2020-02-19 11:44:41 +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
Maxim Kim
f36410202e Resolve LspHover Conceal Issue (#720)
1. Do not clear Conceal highlight group
2. Do not highlight concealed chars by using syntax region.
   This fixes different background of concealed cchar and popup window
   original solution had.

See #719 for details.
2020-02-14 11:31:56 +01: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
Prabir Shrestha
fabb572f7e document vim-vsnip for snippets (#710) 2020-02-09 09:20:39 -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
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
hrsh7th
b9e6816193 Use prefix filter when does not specified (#678) 2020-01-20 21:27:24 +09:00
mattn
6cbb4238e9 Check capability is dict (#675) 2020-01-19 00:39:17 +09:00
hrsh7th
dbfbdddb94 Merge pull request #673 from prabirshrestha/check-textedit
Check textEdit is not null
2020-01-17 23:53:38 +09:00
Yasuhiro Matsumoto
7b793a1d79 Check textEdit is not null 2020-01-17 21:46:46 +09:00
hrsh7th
e2a052acce Merge pull request #669 from hrsh7th/fix-user-data-clear
Fix #668
2020-01-15 13:54:17 +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
64d514d14f Fix completion for clangd (#665)
* Fix completion for clangd

* Fix for old vim
2020-01-11 20:10:33 -08:00
mattn
2f1ce88a83 Add missing function (#667)
Fixes #666
2020-01-11 11:53:22 -08: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
mattn
896abb2d69 Ignore cmdwin (#664)
* Ignore cmdwin

* Ignore / cmdwin
2020-01-09 08:07:29 -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
Christian Clason
8f48b74e55 Fixup lsp_location_item_to_vim (#657)
Refactoring introduced an additional +1 to line numbers; correct it for `PeekDefinition`.

see discussion on https://github.com/prabirshrestha/vim-lsp/pull/647
2020-01-05 11:13:33 -08:00
Prabir Shrestha
730f1c40f0 disable semantic highlight by default (#656) 2020-01-05 09:37:14 -08: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
6bb1252a9c show long of starting server 2020-01-04 09:12:12 -08:00
Yuta Sakurai
3c42f25540 Fix #651 (#652) 2020-01-02 23:06:56 -08:00
prabirshrestha
13c439051c do not echo Retrieving signature help 2020-01-02 20:13:58 -08:00
hrsh7th
c39127d85c Improve user_data format (#649) 2020-01-02 02:34:32 -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
Prabir Shrestha
4468bbc2bd add lsp#_new_command() and lsp#_last_command() (#648)
* add lsp#_new_command() and lsp#_last_command()

* remove log

* fix rename
2020-01-01 18:18:55 -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
c347a80dfa fix _open_lsp_location (#646) 2020-01-01 11:58:31 -08:00
Prabir Shrestha
189a3118b1 add tests for lsp/utils/position.vim (#644) 2020-01-01 10:49:29 -08:00
Prabir Shrestha
c35a328774 refactor LspTypeHierarchy (#643)
* add lsp#utils#buffer#_open_lsp_location(location)
add lsp#utils#position#lsp_to_vim(expr, position)
add visual selection when using _open_lsp_location
update tagstack when opening hierarchy item
* move to location.vim
* use normal!
* rename to lsp#utils#position#_lsp_to_vim
* update bufnr to the latest buffer
2019-12-31 22:37:14 -08:00
prabirshrestha
50133a79e1 use * for settagstack check 2019-12-31 19:27:25 -08:00