48 Commits

Author SHA1 Message Date
mattn
7ce02b0781 Fix lsp#utils#path_to_uri (#809)
This should accept URI
2020-04-30 21:55:22 +09:00
hrsh7th
cbddb059b5 Add snippet indicator (#759) 2020-04-19 10:14:38 -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
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
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
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
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
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
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
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
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
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
189a3118b1 add tests for lsp/utils/position.vim (#644) 2020-01-01 10:49:29 -08:00
prabirshrestha
50133a79e1 use * for settagstack check 2019-12-31 19:27:25 -08:00
Prabir Shrestha
8c5ee44eee lsp#utils#tagstack#_update (#642) 2019-12-31 19:25:37 -08:00
Thomas Faingnaert
2f725fb4c3 Implement semantic highlighting (#464) 2019-12-26 10:08:30 -08:00
mattn
abc1d83dd5 Fix textEdit completion (#572) 2019-12-23 13:59:41 -08:00
Yasuhiro Matsumoto
afaba6a1f2 Revert accidentially commits pushed to master branch. 2019-12-23 01:05:56 +09:00
Yasuhiro Matsumoto
9493169b91 Fix test 2019-11-21 18:04:13 +09:00
Yasuhiro Matsumoto
64c8d091d6 Fix test 2019-11-21 17:49:44 +09:00
Damien Radtke
e566dcd160 Use "P" instead of "p" to insert text (#550)
* Use "P" instead of "p" to insert text
* Update replace command and add test case
2019-11-18 15:42:17 +01:00
Thomas Faingnaert
0e811a2874 Filter completions (#391)
* Filter completed items based on typed word

* Remove logs

* Only calculate typed_word once

* Revert "Only calculate typed_word once"

This reverts commit 161c7f460e.

* Revert "Remove logs"

This reverts commit 861c70fc7c.

* Revert "Filter completed items based on typed word"

This reverts commit c450e839b4.

* Reimplement filtering completion items

* Remove s:remove_typed_part

* Fix for NeoVim

* Use 'ignorecase' to filter items

* Allow configuration of filter

* Add documentation

* Add example for typed_pattern

* Change surrounding of `/$` to indicate it is a tag

* Add g:lsp_ignorecase

* Use filterText for filtering

* Add 'contains' filter

* Fix tests

* Avoid using regex

* Fix bug in 'contains' filter

* Use completion trigger chars for typed text

* Move copy

* Update documentation

* Use textEdit starting position

* Change default typed_pattern

* Update documentation

* Fix documentation

* Add note about narrowing down completions

* Fix tests

* Make filtering note clearer

* Remove duplicate text
2019-11-14 20:08:15 -08:00
Yasuhiro Matsumoto
a20a0c1da8 Add test 2019-09-20 18:14:07 +09:00
Yasuhiro Matsumoto
90d568d2fa Merge branch 'master' into fix-textedit 2019-09-09 14:58:12 +09:00
Yasuhiro Matsumoto
3a6def04b9 Add test 2019-09-09 14:29:17 +09:00
machakann
3121f0a916 Multibyte-character support (Fix #425) (#490)
* Multibyte character support for lsp#get_position()

* Multibyte character support for "textDocument/documentHighlight"

* Fix `lsp#utils#byteindex()` would fails if a file is not yet loaded

* Add tests

* Rename lsp#utils#byteindex() and lsp#utils#charindex()

lsp#utils#byteindex() -> lsp#utils#to_col()
lsp#utils#charindex() -> lsp#utils#to_char()

* Multibyte character support for textEdit

* Remove unused line

* Multibyte character support for  "textDocument/rangeFormatting"

* Multibyte character support for  "textDocument/publishDiagnostics"
2019-09-08 09:13:09 -07:00
machakann
73d98fc328 Rename lsp#utils#byteindex to lsp#utils#to_col 2019-08-20 19:42:21 +08:00
machakann
ccb2460fa6 Add tests for lsp#utils#byteindex() 2019-08-17 14:38:56 +08:00
Thomas Faingnaert
ed304dbb8a Fix LspDocumentFormat not working as expected (#410)
* Add test

* Fix LspDocumentFormat adding newlines

* Fix manually pressing enter when formatting
2019-07-11 13:41:15 -07:00
mikoto2000
75516719d5 Fix lsp#utils#text_edit#apply_text_edits when end position was newline character. (#388) 2019-06-15 11:08:48 -07:00
Thomas Faingnaert
21d51ffb83 Fix text edits not preserving v:completed_item (#389)
* Add test to check v:completed_item after textedits

* Fix v:completed_item being reset after text edits

* Add silent to execute call in apply_text_edits
2019-05-25 12:01:24 -07:00
mikoto2000
900e8619be Fix text edit when insert empty new text (#384)
* Add test of 'lsp#utils#text_edit#apply_text_edits'.

* Fix `lsp#utils#text_edit#apply_text_edits` is delete one character when textEdit command kind is insert.

I fix the problem the apply_text_edits is deleting one character
if "textEdit['range']['start'] equals textEdit['range']['end'] and textEdit['new Text'] is empty".

* Fix tests.

- create new buffer each tests
- add test utility function `s:set_text` and `get_text`
2019-05-20 17:24:41 -07:00
tsufeki
e346c77475 Fix newline in completion popup. (#369)
* Fix newline in completion popup.
* Add test.
2019-05-12 22:34:57 -07:00
IceNature
fe2ec6e040 Search for multiple file/dir names in lsp#utils#find_nearest_parent_file_directory (#373)
* Search for multiple file/dir names in lsp#utils#find_nearest_parent_file_directory

* Add tests for lsp#utils#find_nearest_parent_file_directory

* Document lsp#utils#find_nearest_parent_file_directory
2019-05-12 22:33:38 -07:00
mikoto2000
185aee6ac9 Allowing empty word complete item (#378)
* Modify to allowing empty word complete item.
* Fix test.
2019-05-07 19:42:59 -07:00
mikoto2000
5c3dcc952b Fix to allow "textEdit property provide and null value". (#356) 2019-03-27 09:56:48 -07:00
mikoto2000
573b3d2b8d Added lsp#omni#get_vim_completion_item test about textEdit. 2019-03-20 05:20:23 +09:00
mikoto2000
43a9752f1b Move textEdit's user_data to user_data['vim-lsp/textEdit']. 2019-03-18 21:59:34 +09:00
mikoto2000
4e7fe37d68 Fixed test failed. 2019-02-23 19:06:26 +09:00
Ville Hakulinen
0ef9fb7f1e Proper use of kind completion item property (#305)
* Proper use of `kind` completion item property
* Add tests for `kind` completion item property
2019-02-17 09:41:00 -09:00
Bryan Forbes
e40175d972 If the user has "fixendofline" set, append a blank line to preserve the EOF newline (#302)
* If the user has "fixendofline" set, append a blank line to preserve the EOF newline
* Break utility function out into its own file and add tests
* Improve EOL detection based on docs and improve tests
2019-02-15 21:05:46 -08:00
Yasuhiro Matsumoto
46fd937a73 Add test 2019-02-11 03:38:33 +09:00
Yasuhiro Matsumoto
cf0ff507cd Fixes exception for empty list 2019-02-11 03:33:26 +09:00
Yasuhiro Matsumoto
55c145e21b path should not contain query 2019-01-29 11:38:55 +09:00
Yasuhiro Matsumoto
52e1b05f29 Fix index 2019-01-29 11:17:03 +09:00
Prabir Shrestha
fa53543d91 add themis tests (#240) 2019-01-13 01:18:44 -08:00