28 Commits

Author SHA1 Message Date
machakann
3121f0a916 Multibyte-character support (Fix #425) (#490)
* Multibyte character support for lsp#get_position()

* Multibyte character support for "textDocument/documentHighlight"

* Fix `lsp#utils#byteindex()` would fails if a file is not yet loaded

* Add tests

* Rename lsp#utils#byteindex() and lsp#utils#charindex()

lsp#utils#byteindex() -> lsp#utils#to_col()
lsp#utils#charindex() -> lsp#utils#to_char()

* Multibyte character support for textEdit

* Remove unused line

* Multibyte character support for  "textDocument/rangeFormatting"

* Multibyte character support for  "textDocument/publishDiagnostics"
2019-09-08 09:13:09 -07:00
smhc
7e3625ed7a Merge branch 'master' into signs_prio 2019-08-30 19:11:50 +10:00
Timur Celik
2cb386d294 Add g:lsp_signs_priority option (#470)
* Add g:lsp_signs_priority option

When used with other plugins (e.g. gitgutter), the signs will often get
replaced. This patch makes priority configurable for the user and
defaults to a value of 15, which should be a reasonable value for most
use cases.

* Adapt vim's default value of 10 as sign priority
2019-08-22 20:48:12 +02:00
hiroebe
668405756b Clear all vim_lsp signs when disabling (#436) 2019-07-21 09:35:18 -07:00
smhc
5fd87f413d Added g:lsp_signs_priority map 2019-07-10 16:57:39 +10:00
smhc
9cbc9f49cc Added g:lsp_signs_priority 2019-07-10 16:03:49 +10:00
Ruslan Kiyanchuk
8891d93dc3 Fix check for signs support in Neovim (#402)
Fixes #322
2019-06-11 13:46:53 -07:00
Prabir Shrestha
eadfab3d68 Merge pull request #313 from nickspoons/next-error-column
Navigate directly to error column
2019-03-07 09:23:36 -08:00
mattn
3ee778a0c6 Check buffer loaded (#334)
* Check buffer loaded

* Cosmetic change
2019-03-06 18:16:13 -08:00
nickspoon
2986ccbe74 Refactor error_next/previous out of signs.vim
Moving the error navigation code out of signs.vim to diagnostics.vim
means that errors can be navigated when signs are disabled.

This commit re-introduces error-column navigation, after the signs
refactoring.
2019-03-03 22:43:32 +13:00
nickspoon
e16822d617 Remove column-handling
The signs API doesn't currently have support for storing "arbitrary"
data in the sign {dict}, so we can't store the column that way.
2019-02-24 00:03:09 +13:00
nickspoon
09afaa0f48 Add explicit variable declarations and whitespace 2019-02-24 00:02:16 +13:00
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
Yasuhiro Matsumoto
675be7d9b7 Use spaces instead of tab 2019-02-09 02:28:47 +09:00
Prabir Shrestha
74ad1e1c0d fix lint issues and enable linting for autoload folder (#224) 2018-12-27 23:03:49 -08: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
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
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
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
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
Prabir Shrestha
148bc9a9a1 initial support for diagnostics signs (#89) 2018-01-06 13:25:32 -08:00