54 Commits

Author SHA1 Message Date
Prabir Shrestha
82796606f0 port s:FirstDifference to lua 2020-05-23 16:58:30 -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
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
Thomas Faingnaert
1d48fc83e2 Implement workspace/configuration (#427) 2019-07-11 13:39:05 -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
74988e44ad Fix WorkspaceEdit with both documentChanges and changes. (#368)
Prefer `documentChanges` property over `changes` when both are present
in a WorkspaceEdit, complying to the spec:
https://microsoft.github.io/language-server-protocol/specification#workspaceedit
2019-05-15 05:10:35 -07:00
Tomasz Zurkowski
a79fb04d36 Support refactorings through code actions. (#359)
* Support refactorings through code actions.

- make LspCodeAction work on a selected range, to support extract method
or extract variable refactorings
- properly execute commands returned by code actions
- support workspace/applyEdit requests from server

* Fixes to match the Google VimScript Style Guide

* Refactor handling of requests from server.

Introduce an on_request option in lsp#client#start, that will be called
every time a request is received from a server.

* Use robust operator ==#

* Move apply_workspace_edit to separate file.
2019-04-06 09:26:04 -07:00
mikoto2000
e195378260 Moved TextEdit process to utils. 2019-02-23 18:10:33 +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
cf0ff507cd Fixes exception for empty list 2019-02-11 03:33:26 +09:00
Yasuhiro Matsumoto
b4b91f7d0a Fix diff
Return empty array when not changes
2019-01-16 15:07:02 +09:00
Yasuhiro Matsumoto
0f0c07ff3f Check l:start_line too 2019-01-16 00:08:20 +09:00
Yasuhiro Matsumoto
1a13828750 When no diffs, send empty changes 2019-01-15 23:43:30 +09:00
Yasuhiro Matsumoto
218e4e5787 Fixes vint errors 2019-01-14 11:53:46 -08:00
Yasuhiro Matsumoto
11d408b38c Fixes vint errors 2019-01-14 11:53:46 -08:00
Yasuhiro Matsumoto
34c2a1e851 cosmetic changes 2019-01-14 11:53:46 -08:00