Commit Graph

115 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto
6eb1271697 Failed to codeAction 2019-02-10 14:03:07 +09:00
Yasuhiro Matsumoto
ee93da00e4 When codeaction fail, show errors 2019-02-10 13:45:59 +09:00
Yasuhiro Matsumoto
5542b9019e Fallback to range functions if visual-mode 2019-02-08 13:43:47 +09:00
Yasuhiro Matsumoto
95c5045312 Add format-range-sync 2019-02-07 19:09:13 +09:00
Yasuhiro Matsumoto
ffa67f21f1 Split window with jumping to another file from modified buffer 2019-02-06 12:53:09 +09:00
Yasuhiro Matsumoto
dc0a073aeb Workaround for input() issue 2019-01-16 18:55:52 +09:00
Yasuhiro Matsumoto
9e4dc3b151 Prepare range for rename 2019-01-16 18:10:37 +09:00
Prabir Shrestha
896c747c62 add support for :LspDeclaration (#243)
* add support for :LspDeclaration
* update docs and add plug mappings
2019-01-13 15:21:20 -08:00
mattn
b58841b0a1 Merge pull request #215 from prabirshrestha/sync-request
Add option to request synchronized .
2018-12-21 12:25:04 +09:00
Yasuhiro Matsumoto
eba9ca25c0 Show error description 2018-12-21 10:49:17 +09:00
Yuri Skripachov
3f6b3cfcb2 fix-216 2018-12-21 09:08:00 +09:00
Yasuhiro Matsumoto
395c63eee9 Correct end position for editing
When end column is 0, This mean 'whole-line'.

Fixes #216
2018-12-20 15:31:49 +09:00
prabirshrestha
8024ac55cd add retrieved definition message 2018-12-17 21:05:15 -08:00
Yasuhiro Matsumoto
d4c8e001e6 Add option to request synchronized .
Also add LspDocumentFormatSync. This can be used for autocmd before
saving the file.
2018-12-17 16:40:44 +09:00
mattn
43770c3416 Format (#209)
* Save/restore cursor position
* Cosmetic change
* selection should be inclusive
Because exclusive doesn't select fisrt character with 1GvG0
* Remove last extra \n
* Be graceful
* Use winsaveview/winrestoreview
2018-12-14 13:00:32 -08:00
Augusto Melo
778630e682 Fix apply text edits (#193)
The correct way to deal with edge cases (column = 0 or column = line
length) is to use selection=excluise (does not delete the last
character) and virutaledit=onemore (enable select last line
character) instead of transforming the text edits
2018-10-21 17:56:25 -07:00
Augusto Melo
40825e380c [RFC|RDY] code actions (#162)
* WIP code actions

It was addded the code actions funcionality
https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction

Processing the result is not quite right, because it is always applying
the c (change) command, and it does not insert the new line (\n)
character

* WIP code actions

It was addded the code actions funcionality
https://microsoft.github.io/language-server-protocol/specification#textDocument_codeAction

Processing the result is not quite right, because it is always applying
the c (change) command, and it does not insert the new line (\n)
character

* Improved apply_text_edit

Now the function apply_text_edit insert texts as well, instead of only
replacing it.

Fixed some typos and broken links

* Added documentation and fixed code_action

Now lsp#ui#vim#code_action uses the diagnostic range instead of the
get_position

* Fixed code action

The code action had a problem when it needed to delete/replace some
text, and when the code was folded it did not work since to execute do
not seem to unfold the code

* Changed copy to deepcopy

Since we modifying nested objects we need to use deepcopy

* Fixed preprocessing and added sort to textedits

To perform an unfold it is necessary to check first if the line has
fold level, if the line has foldlevel = 0 and you try to unfold it will
cause and error.

Since LSP specification does not guarantee that text edits are ordered,
we needed to sort it so it will work on any valid LSP

* Fixed text edits sort

Removed stable_sort since it is not necessary

Now it sorts the text edits in a reverse order and merge text edits
that are inserts on the same place

* Fixed codeAction deleting lines

* Passing capability on initialization

* Added buffer validation before setting the sign

This validation is necessary since the documentation states that the
file {fname} must be already be loaded in a buffer.

* Changed msgpack_type to v:true

Msgpack_type does not work on vim
2018-10-11 20:13:59 -07:00
daquexian
5a9be40bec Use word instead of WORD for renaming hint (#177) 2018-09-15 14:51:46 -07:00
Prabir Shrestha
1366e07795 added :LspTypeDefinition (#165) 2018-08-06 00:29:41 -07:00
Jiwan
a510bc66e0 Use character index instead of column index for renaming feature. (#153) 2018-08-01 20:33:39 -07:00
Alisue
3441fa8c2d Use <cWORD> as a default value of rename (#149)
In general, <cWORD> should be an initial value of rename.
2018-06-25 14:51:36 -07:00
James Owen
265d36fc68 Escape single quotes in text commands applied to the document (#147) 2018-06-16 15:15:25 -07:00
Cosson2017
7d64e8aa11 add support for textDocument/implementation (#127) 2018-03-29 23:44:43 -07:00
Maxim Kot
c547986d3b Naive implementation of location preview instead of just path (#123)
* Naive implementation of location preview instead of just path

* Make cache usage actual

* Fix wrong cached line index computation. Fix copy paste.
2018-03-29 22:01:08 -07:00
Prabir Shrestha
2db284e61e remove old handle_hover 2018-03-18 22:20:13 -07:00
Prabir Shrestha
29c986c729 move hover to separate file (#77) 2018-03-18 22:17:37 -07:00
Prabir Shrestha
72916bce5f use echo instead of echom (fixes #74) 2018-03-17 20:08:25 -07:00
Prabir Shrestha
91005ca30c add support for document changes rename (#118) 2018-03-17 11:04:01 -07:00
Tristan Konolige
a070ef4ac8 Print error message when server fails to initialize (#113)
* Print error message when server fails to initialize
* move error_msg to utils.vim
* rename error_msg to lsp#utils#error
2018-03-14 23:08:24 -07:00
xtal8
10d45996ff Use keepalt (#91) 2018-01-07 13:28:44 -08:00
Prabir Shrestha
148bc9a9a1 initial support for diagnostics signs (#89) 2018-01-06 13:25:32 -08:00
Prabir Shrestha
75863ac26f Always pass response for is_error function (#86) 2018-01-05 00:05:13 -08:00
Łukasz Jan Niemier
203d682e30 Create preview window instead of using quickfix list (#78)
* Create preview window instead of using quickfix list

This removes from us burden of providing formatting for content as this
is now simple as setting proper filetype.

* Create custom filetype for preview window

This will allow users to provide their own mappings and features in
hover window easily.

* Add proper statusline for LSP Hover

* Guard and undo_ftplugin

* Support all LSP hover syntaxes
2018-01-01 13:29:50 -08:00
xtal8
a15344352f Keep position and alternate buffer after :LspRename (#72) 2018-01-01 13:16:09 -08:00
Łukasz Jan Niemier
53a8fa0fe9 Use paste mode when inserting text from response (#79)
* Use paste mode when inserting text from response

This will disable all built in Vim formatting and will input text
exactly as is. This will prevent any formatting issues due to invalid
Vim configuration.

* Use try/finally when setting paste mode
2018-01-01 13:05:06 -08:00
xtal8
c5d6ffdc10 Fix :LspDefinition (#65)
Mark position only when jumping.
Screen is sometimes not redrawn after jump. Force redraw.
2017-12-23 11:02:04 -08:00
xtal8
f1517022bb Add position to jumplist before :LspDefinition (#59)
* Add position to jumplist before :LspDefinition

Currently when we jump with :LspDefinition there's no easy
way to go back. With this change we can move back easily
with `<c-o>` or  `''`.

* fix space
2017-11-23 13:06:39 -08:00
xtal8
27565be44f Fix :LspDefinition (#63)
Vim and servers sometimes use different case for file path.
`bufnr()` will ignore case when used on Windows.
2017-11-23 12:57:43 -08:00
xtal8
b973d62b6e Fix :LspRename (#58)
When buffer is modified renaming fails.
Use :buffer instead of :edit for listed buffers.
2017-11-14 20:06:26 -08:00
Marc Deop
812d890707 Send proper params on lsp#ui#vim#references (#54) 2017-10-24 11:02:29 -07:00
Jacob Wahlgren
c4b3b2f605 Fix errors and warnings produced by vint (#51)
* Wrap silent aucmds in augroup
Prevents stacking up multiple.
* Fix function signatures
Add ! and/or abort.
* Fix syntax and variable name typo
* Use robust equality comparison
* The == operator behaves differently depending on 'ignorecase'.
2017-10-17 10:57:08 -07:00
Prabir Shrestha
5ae7a59caa better jump for goto definition (#47) 2017-10-02 13:57:29 -07:00
tsufeki
d51194fa4b Use botright for opening quickfix window. 2017-09-19 14:30:08 -07:00
Prabir Shrestha
358e1eec44 added support for basic textDocument/publishDiagnostics via :LspDocumententDiagnostics 2017-09-17 23:44:50 -07:00
Prabir Shrestha
bae35d03d3 notify server instantiated notifications to client 2017-09-17 22:45:54 -07:00
Prabir Shrestha
dd1ac6378c only call edit file if the file is not open yet 2017-08-28 20:51:02 -07:00
Prabir Shrestha
25578dbbfa fix :LspDocumentRangeFormat 2017-08-26 20:24:23 -07:00
Prabir Shrestha
5eb114d1a4 fix workspace/symbol casing 2017-08-23 21:20:40 -07:00
djrenren
9a793490aa LspDefinition aggregation and jumping (#24)
* Make LspDefinition aggregate multiple server responses and jump if only one definition is found
* Add jump_if_one and last_req_id to ctx
2017-08-23 12:34:28 -07:00
Prabir Shrestha
2802c39ca0 move utils to lsp#utils#... 2017-08-12 14:48:36 -07:00