Commit Graph

69 Commits

Author SHA1 Message Date
Prabir Shrestha
90d61f1114 fix snippet (#1051)
* fix snippet
* add snippet test
2021-01-16 12:09:01 -08:00
Prabir Shrestha
6038748cb1 Improve completion perf (#1038)
* improve completion perf

* improve completion popup perf

* fix tests

* remove old s:get_vim_completion_item
2021-01-16 11:05:21 -08:00
Prabir Shrestha
098509278d refactor diagnostics count to using diagnostics state (#999) 2021-01-02 00:14:05 -08:00
micchy326
7770b7d5a3 Add public api get window/workDoneProgress (#979)
* impl lsp#get_progress() for statusline plugin.

* add workDoneProgress spec link

* refactor s:handle_work_done_progress()

* [workDoneProgress] prevent to subscribe multiple times

* [workDoneProgress] Fixed s:lsp_progress['percentage'] to always be float

* [workDoneProgress] support multiple progress registration.

* [workDoneProgress] Fixed s:lsp_progress['percentage'] to uinteger

* [workDoneProgress] fix for vint

* [workDoneProgress] rename variable

* [workDoneProgress] add test

* [workDoneProgress] write document

* [workDoneProgress] initialize s:progress_ui when enable/disable

* [workDoneProgress] refactor test code

* [workDoneProgress] add lsp_progress_updated

* [workDoneProgress] fix typo

* [workDoneProgress] refactor token handling

* [workDoneProgress] Fixed differences from
specifications(messages->message)

* [workDoneProgress] fix test
2020-12-31 10:51:20 -08:00
Prabir Shrestha
58e81e6fca try fix mac neovim ci (#992)
* try fix mac neovim ci
* remove document_definition integration tests
2020-12-30 14:35:47 -08:00
mattn
4f4fdf4aa1 Fix tests (#989)
* Sort results
* Sort by text
* Workaround for older version of Vim that does not include module in the list given from getloclist
* Sort items by text
* Fix test
2020-12-30 10:26:01 -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
Prabir Shrestha
8f5bec6ce9 add buffer state of disabled diagnostics state (#981) 2020-12-27 18:29:22 -08:00
Prabir Shrestha
778ebd3ca2 add internal/diagnostics/state.vim (#978)
* add internal/diagnostics/state.vim

* add unit tests

* add s:enabled

* clean up diagnostics state during server exit

* remove echom

* add tests for lsp_server_exit

* reset when enable

* add notify function

* add link to diagnostics spec
2020-12-27 11:27:17 -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
0c2a9d34e0 add goto definition integration tests for same file (#972)
* add goto definition integration tests for same file
2020-12-24 14:21:49 -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
Prabir Shrestha
3176fd0fd4 use reporter spec by default in themis (#962) 2020-12-23 17:58:48 -08:00
Prabir Shrestha
aef000765c four spaces (#961) 2020-12-23 17:51:54 -08:00
Prabir Shrestha
67c6e9040a always add range for diagnostics test (#960) 2020-12-23 17:27:39 -08:00
Prabir Shrestha
5c91c59f2a add lsp#utils#buffer#get_indent_size() (#957) 2020-12-23 11:48:46 -08:00
William Boman
fdb69ab913 populate location list with all modified changes in a WorkspaceEdit (#555) 2020-10-23 19:41:32 -07:00
mattn
6da958babd Fix 849: find nearest paths (#905) 2020-09-18 23:21:08 -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
Prabir Shrestha
e0cacffe54 optimize lsp#omni#get_vim_completion_items() (#835)
* optimize

* fix two omni tests

* fix omni tests
2020-06-13 02:11:02 -07:00
Prabir Shrestha
8df76a63c0 [perf] add g:lsp_get_vim_completion_item_set_kind to enable or disable kind (#824)
* add g:lsp_get_vim_completion_item_set_kind to enable or disable kind
* enable lsp_get_vim_completion_item_set_kind for tests
2020-05-24 23:36:42 -07:00
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