Commit Graph

336 Commits

Author SHA1 Message Date
Yasuhiro Matsumoto
675be7d9b7 Use spaces instead of tab 2019-02-09 02:28:47 +09:00
Yasuhiro Matsumoto
5542b9019e Fallback to range functions if visual-mode 2019-02-08 13:43:47 +09:00
Yasuhiro Matsumoto
aacf4b47c4 Do not update register 2019-02-08 12:15:15 +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
90cd24fe62 normalize URI for diagnostic on Windows 2019-02-05 10:51:44 +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
Matteo Landi
ac22efb91e Add flag to disable diagnostics (#197)
* Add switch, g:lsp_diagnostics_enabled, to disable support for diagnostics

* Reduce PR changeset
2019-01-01 20:43:46 -08:00
Prabir Shrestha
74ad1e1c0d fix lint issues and enable linting for autoload folder (#224) 2018-12-27 23:03:49 -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
Prabir Shrestha
82375012d0 Truncate diagnostics cursor message when message is too long (#191)
* truncate diagnostics message

* fix echo with truncation
2018-10-13 11:15:13 -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
Christian Kjær
45f9d7528e Add not_supported in scope for get_hover_under_cursor (#190)
Currently calling hover on a filetype without support throws an error, stating
that 'Unknown function: <SNR>274_not_supported'. This adds the `not_supported` 
function into the scripts' scope.
2018-10-11 20:09:32 -07:00
smhc
2e593701ad Fix erasing ALE (and other) diagnostic errors (#184)
ALE (and other plugins) echo diagnostic error messages. vim-lsp erases these by echoing a blank line unnecessarily.
2018-09-27 18:59:05 -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
Prabir Shrestha
ba1cf3ba47 rename next_err to next_error() and prev_err() to previous_error() 2018-07-26 12:08:04 -07:00
Cosson2017
f19213d30b add jump to next/pre error (#129)
* add jump to next/pre error

* upd

* optimization

* fix named
2018-07-26 12:02:34 -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
2cc06e6bf5 bring back custom sign and fix sign when icon is not defined (#122)
* Revert "Revert "Custom signs (#115)" (#119)"

This reverts commit ce1ad6f01a.

* handle cases where sign icon is not set for gui vim
2018-03-18 12:13:44 -07:00
Prabir Shrestha
72916bce5f use echo instead of echom (fixes #74) 2018-03-17 20:08:25 -07:00
Prabir Shrestha
ce1ad6f01a Revert "Custom signs (#115)" (#119)
This reverts commit 8210694b25.
2018-03-17 19:47:09 -07:00
Prabir Shrestha
91005ca30c add support for document changes rename (#118) 2018-03-17 11:04:01 -07:00
Pavel Davydov
8210694b25 Custom signs (#115)
* add variables to define custom signs

* set signs via exec

* use dict for custom signs

* support all sign params

* update readme with a note about custom signs

* add lsp highlighting groups, remove options to set texthl and linehl via dict.
2018-03-17 10:32:53 -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
Hayato Kawai
08fdbf51d0 Add support for keeping focus to the current window (#109)
This commit allows to stay in the current window with `:LspHover`.
This behavior enables if `g:lsp_preview_keep_focus` is `1`. (default is `0`)
2018-02-20 12:51:03 -08:00
Yosuke Kurami
449c8c9d22 make echo message oneline (#108) 2018-02-13 09:06:53 -08:00
Prabir Shrestha
53e805bb8d add support for case-insensitive drive lookup for windows (#102) 2018-01-27 22:13:16 -08:00
Prabir Shrestha
897b60960c Revert "Show matching lines on :LspReferences (#93)" (#98)
This reverts commit a2483c71d1.
2018-01-21 13:08:00 -08:00
xtal8
a2483c71d1 Show matching lines on :LspReferences (#93) 2018-01-07 14:20:07 -08:00
xtal8
10d45996ff Use keepalt (#91) 2018-01-07 13:28:44 -08:00
Prabir Shrestha
cbf0fd26df support for showing diagnostics under cursor (#90)
* support for showing diagnostics under cursor
* added README.md
2018-01-06 18:58:35 -08:00
prabirshrestha
1bb957d6bf added s:error_msg in diagnostics.vim 2018-01-06 16:35:42 -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