Commit Graph

70 Commits

Author SHA1 Message Date
Linda_pp
b6898841c7 fix error on editing empty file (#1154) 2021-04-29 14:53:56 +09:00
Prabir Shrestha
2ba31c2b9d update async.vim to 0fb846e1eb3c2bf04d52a57f41088afb3395212e (#1117)
avoid has_key check for on_stdout and on_stderr
2021-03-21 11:36:38 -07:00
Linda_pp
d4f2fa13ac Fix calculating last line of text diff in Lua and add new CI for Vim on macOS (#1097)
* add CI workflow for Vim on macOS
* fix calculating last line of text diff in Lua
2021-03-14 19:53:47 +00:00
Linda_pp
f076e6a7c0 Use 'label' value when 'insertText' or 'filterText' is falsy (#1095)
* use label when filterText is falsy value

* use label when insertText is falsy value on completion done

* Revert "fix inserting "v:null" when newText in textEdit is null (#1093)"

This reverts commit 907f1c9667.

* Revert "add test case where newText is null for #1093 (#1094)"

This reverts commit e214f1cfee.
2021-03-14 01:59:08 +09:00
Linda_pp
907f1c9667 fix inserting "v:null" when newText in textEdit is null (#1093) 2021-03-13 23:32:36 +09:00
mattn
ee854b4c55 Add tcp feature (#985)
* Add tcp feature

* Update doc

* Update async.vim embed

* Update doc
2021-01-01 01:28:06 +09:00
Prabir Shrestha
1489cf8295 Revamp diagnostics virtual text (#990) 2020-12-30 14:49:44 -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
5c91c59f2a add lsp#utils#buffer#get_indent_size() (#957) 2020-12-23 11:48:46 -08:00
Prabir Shrestha
b316729ef5 use callbag to implement document format with timeout (#956)
* use callbag to implement document format with timeout

* document lsp#stream() with example

* send message to stream when using lsp#_new_command

* use -- for args parsing and add g:lsp_document_format_sync_timeout

* throw string exception

* use new func for <plug>(lsp-document-format)

* document g:lsp_format_sync_timeout

* rename to document_formatting

* add document_range_formatting.vim

* remove formatting from ui/vim.vim

* document :LspDocumentRangeFormatSync

* add LspDocumentFormatSync example in README.md
2020-12-22 22:08:32 -08:00
William Boman
fdb69ab913 populate location list with all modified changes in a WorkspaceEdit (#555) 2020-10-23 19:41:32 -07:00
Prabir Shrestha
eb0e5fb885 use callbag for Highlight references (#891) 2020-08-30 11:11:51 -07:00
mattn
a926dcf9f8 Handle invalid range (#878) 2020-08-06 18:51:23 +09:00
hrsh7th
bb765bb7af Fix cursor position after text edit (#870) 2020-07-18 14:44:45 +09:00
Prabir Shrestha
c4f7291f5e Lua arrays are now one based starting v8.2.1066 (#851)
This aligns with lua and neovim.
bd84617d1a
2020-06-27 10:22:45 -07:00
Prabir Shrestha
649affc6e4 Embed async.vim (#842) 2020-06-20 16:12:48 -07:00
Prabir Shrestha
3d0153bcf9 improve diff by using lua if available (#821)
* use lua if available for diff

* add docs

* sync with latest vim-lsc changes

* lazily init lua

* update vim to 8.2.0817

* update vim to 8.2.0817 for windows

* use vim 8.2.0814

* check for path 8.2.0775 before enabling lua

* use vim 8.2.0813 since it exists for both linux and windows

* update lua patch check

* optimize vimscript diff by using range

* fix lint issues
2020-05-24 13:03:32 -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
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
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
hrsh7th
4d8cd302bb Follow vscode textEdit behavior (#764)
* Follo vscode textEdit behavior

* Remove unnecessary cursor position fixing
2020-03-25 00:56:27 +09:00
Prabir Shrestha
24d9f18bca update vim-yggdrasil to 043d0ab53dcdd0d91b7c7cd205791d64d4ed9624 (#755) 2020-03-15 15:10:02 -07: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
hrsh7th
651bccfab8 Fix cursor pos on appling additionalTextEdit (#726) 2020-02-21 23:35:35 +09:00
hrsh7th
415f6e685f Fix cursor pos after text edit (#724) 2020-02-17 21:39:46 +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
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
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
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
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
Yuta Sakurai
3c42f25540 Fix #651 (#652) 2020-01-02 23:06:56 -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
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
Prabir Shrestha
8c5ee44eee lsp#utils#tagstack#_update (#642) 2019-12-31 19:25:37 -08:00
Prabir Shrestha
67caa411c8 add initial support for type hierarchy (#641) 2019-12-31 17:12:55 -08: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
Yasuhiro Matsumoto
780e7538a4 Fix #516 2019-09-20 18:09:49 +09:00
Yasuhiro Matsumoto
ff94e63af8 Remove s:parse 2019-09-10 10:01:03 +09:00
Yasuhiro Matsumoto
4ee0799b4d Fix textEdit 2019-09-09 23:31:15 +09:00
Yasuhiro Matsumoto
3a6def04b9 Add test 2019-09-09 14:29:17 +09:00
Yasuhiro Matsumoto
e9a428d2e1 Fix textEdit 2019-09-09 13:07:20 +09:00
Yasuhiro Matsumoto
44e30a430d Use black hole register 2019-09-08 22:10:29 +09:00
Yasuhiro Matsumoto
dd36602267 Fix a bug 2019-09-07 22:47:19 +09:00
Yasuhiro Matsumoto
aebafac116 Fix a bug 2019-09-07 22:39:27 +09:00
Yasuhiro Matsumoto
13fac90000 Fix textEdit
The p comand append empty line. So when replacing text block with "\n", it need
to remove with dd.

Fixes #483
2019-09-07 22:18:49 +09:00
hrsh7th
8fccf7a408 Add prefix 'l:' for local variables 2019-07-25 19:56:37 +09:00
hrsh7th
a2e4e040d2 Re-porting vim-lsc's diff logic 2019-07-25 17:23:41 +09:00