Commit Graph

242 Commits

Author SHA1 Message Date
nickspoon
8e4a372ff7 Wrap :LspNextError and :LspPreviousError
Make :LspErrorNext wrap to the first error when the cursor is positioned
after the last error, and the inverse for :LspErrorPrevious.
2019-02-24 00:02:13 +13:00
nickspoon
ada958031a Navigate directly to error column
This commit adds the error column to the array of errors (previously an
array of line numbers, now an array of [line,column] pairs). This allows
navigation directly to the error position, but also nvaigating to
multiple errors in a single line.
2019-02-24 00:01:28 +13:00
Prabir Shrestha
1dfc456428 handle if sign is not supported 2019-02-21 23:11:49 -08:00
Prabir Shrestha
a99a4e53d8 use signs_getplaced api for lsp#ui#vim#signs#next_error and lsp#ui#vim#signs#previous_error 2019-02-20 01:49:42 -08:00
Prabir Shrestha
0b99bf26ab use sign_define api 2019-02-20 01:12:55 -08:00
Prabir Shrestha
3c3274a30a check for s:supports_signs 2019-02-20 01:12:55 -08:00
Prabir Shrestha
98f7abac7d cleanup 2019-02-20 01:12:55 -08:00
Yasuhiro Matsumoto
675be7d9b7 Use spaces instead of tab 2019-02-09 02:28:47 +09:00
Yasuhiro Matsumoto
aacf4b47c4 Do not update register 2019-02-08 12:15:15 +09:00
Yasuhiro Matsumoto
90cd24fe62 normalize URI for diagnostic on Windows 2019-02-05 10:51:44 +09: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
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
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
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
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
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
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
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
d3af2b8e1a return empty string so the output#preview will not add 0 in cmdline (#83) 2018-01-01 14:36:25 -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
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
358e1eec44 added support for basic textDocument/publishDiagnostics via :LspDocumententDiagnostics 2017-09-17 23:44:50 -07:00
Prabir Shrestha
2802c39ca0 move utils to lsp#utils#... 2017-08-12 14:48:36 -07:00
Prabir Shrestha
974614e197 handle nulls 2017-08-12 14:01:52 -07:00
Prabir Shrestha
0b102b5c1c added LspDefinition 2017-08-05 15:55:54 -07:00
Prabir Shrestha
4c01e85c02 get document symbols 2017-07-10 00:26:05 +00:00