Commit Graph

336 Commits

Author SHA1 Message Date
Thomas Faingnaert
813ea77b91 Add LspPeekDefinition (#412)
* Add LspPeekDefinition

* Add documentation

* Add lsp-peek-definition mapping to documentation

* Add link to Vim preview-window help

* Rewrite LspPeekDefinition using preview window

* Implement peek for Vim popup window

* Make LspPeekDefinition work in Neovim

* Support align in Neovim

* Fix linter errors

* Extract duplicate code to s:align_preview function

* Merge setlocal settings in one line

* Remove suppress_close

* Clean up cursor movement for preview window

* Move Neovim cursor code to separate function

* Allow customising peek alignment

* Move Vim alignment code to separate function

* Implement Vim alignment of popup window

* Cleanup

* Remove extraneous lines

* Move set_cursor logic

* Move scrolloff setting

* Make function calls a bit more consistent

* Vim popup window fixes

* Remove extraneous call

* Fix Vim alignment

* Remove hardcoded width

* Add abort to closure function

* Fix artifacts

* Fix wrong height if popup above cursor

* Add remaining Peek commands

Add LspPeekImplementation, LspPeekTypeDefinition and LspPeekDeclaration.

* Fix wrong positioning of Vim popup
2019-07-21 09:40:19 -07:00
hiroebe
668405756b Clear all vim_lsp signs when disabling (#436) 2019-07-21 09:35:18 -07:00
hiroebe
9507824842 Fix namespace for clearing highlights (#432) 2019-07-17 21:13:31 -07:00
Thomas Faingnaert
91751670ed Allow setting popup max width (#416)
* Allow setting max width of popup window in Vim

* Allow setting max width of popup window in Neovim

* Add documentation

* Uses spaces instead of tabs for indent in help

* Move Neovim logic to s:setcontent

* Rename setting to g:lsp_preview_max_width

* Replace 'popup' with 'preview'
2019-07-17 21:01:07 -07:00
kailin4u
4006768fb4 call settagstack so that user can jump back to recent file positions by C-t (#435) 2019-07-17 20:50:32 -07:00
Thomas Faingnaert
533aef14d2 Fix clear textprops for unloaded buffers (#430) 2019-07-11 13:37:43 -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
Andrej Zieger
ba9e9b5a20 Fix float position with g:lsp_preview_keep_focus=0 (#419) 2019-06-26 16:11:42 -07:00
Thomas Faingnaert
d848083ca1 Fix newlines in popup window (#414) 2019-06-25 19:30:57 -07:00
tsufeki
f02bf20330 Expose diagnostics count for current buffer. (#376)
* Expose diagnostics count for current buffer.

* Add lsp#get_buffer_first_error_line()
2019-06-25 11:19:26 -07:00
Andrej Zieger
1790680598 preview information shown in hover at the cursor (#395)
* preview information shown in hover at the cursor

* lint

* Fix hover float positioning

* Integrate vim8.1 popup for hover/preview

* lint

* Fix hover float positioning above cursor line

* Closing and focusing floating preview (nvim)

* Renamed variable of preview window id

* autocmd events for open/close floats

* Closing of floating preview & lightlinefix (vim8.1)

* Added doubletap functionality to preview
2019-06-25 11:04:52 -07:00
mattn
e0f832443b Merge pull request #387 from dhakimian/fix-ref-jump
Fix cursor positioning when jumping to next/prev reference
2019-06-18 02:55:30 +09:00
mattn
69f31d5bf2 Use fnameescape() (#404)
Close #167
2019-06-12 07:18:03 -07:00
Ruslan Kiyanchuk
8891d93dc3 Fix check for signs support in Neovim (#402)
Fixes #322
2019-06-11 13:46:53 -07:00
Daniel Hakimian
19090fecae Update the jumplist when jumping between references
The previous jump method (using G) set a jump, but cursor() doesn't, so
we manually update the jumplist before moving the cursor so as to not
take away previously existing functionality (the ability to use <C-O> to
undo a jump)
2019-05-22 10:30:06 -07:00
Daniel Hakimian
0d1af5afc2 Use cursor() instead of exec 2019-05-22 09:00:38 -07:00
Daniel Hakimian
f75914d991 Fix cursor positioning when jumping to next/prev reference
On tab-indented lines, (or any line where column number and virtual
column number are different) `|` puts the cursor on the nth virtual
column, not the nth character of the line. This caused the
Lsp{Next,Previous}Reference commands to place the cursor on the wrong
column on tab-indented lines.
2019-05-21 09:15:20 -07:00
tsufeki
c1be742774 Add diagnostics highlighting via +textprop. (#375)
* Add diagnostics highlighting via +textprop.

* Use textprop 'combine' option, added in 8.1.1276

* Add textprop docs.

* Enable textprop highlights by default.
2019-05-17 03:02:38 -07:00
Martino Pilia
fe5057641c Highlight references to the symbol under cursor (#363)
* Highlight references to the symbol under cursor

Use the `textDocument/documentHighlight` method to retrieve references
to the symbol under the cursor, and highlight them with matchaddpos().
Add the commands `LscPreviusReference` and `LscNextReference` to
navigate between references within the buffer.

Adaption from the implementation of "Highlight references" in vim-lsc:
https://github.com/natebosch/vim-lsc/blob/5b587b0c/autoload/lsc/cursor.vim

* Fixups

+ Lapsus: `while` statement where it should be `if`.
+ Fix alignment in docs.

* Update LICENSE-THIRD-PARTY
2019-04-21 13:39:26 -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
Jason Cheatham
6608aad006 Clear message when leaving diagnostic line (#351) 2019-04-05 10:31:26 -07:00
Jason Cheatham
b20f79c8e0 Add support for nvim highlights (#352) 2019-03-23 10:01:17 -07:00
Prabir Shrestha
622b429a8c Merge pull request #318 from mikoto2000/support_for_completion_item_text_edit
Support textEdit on omni completion
2019-03-23 09:46:28 -07:00
mikoto2000
e5f54f9b38 Fix called function name mismatch. 2019-03-18 21:08:49 +09:00
grainrigi
3e28b8fb1e Use correct highlight group name (fix #340) (#343) 2019-03-16 11:14:21 -07:00
Prabir Shrestha
e3f69339ef Merge pull request #336 from hauleth/support-nvim-virtual_text
Support NeoVim virtual text
2019-03-07 12:25:48 -08:00
Łukasz Niemier
51d7746515 nvim_buf_set_virtual_text line number is 0 indexed 2019-03-07 20:46:53 +01:00
Łukasz Niemier
cedacac6fc Support NeoVim virtual text
Currently it uses similar interface to one provided by the signs
feature.

Close #214
2019-03-07 20:05:28 +01: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
2c7c747933 Fix lint (vint) error 2019-03-04 09:18:35 +13: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
mikoto2000
e195378260 Moved TextEdit process to utils. 2019-02-23 18:10:33 +09:00
Prabir Shrestha
b71d35cc0a Merge pull request #294 from prabirshrestha/redo-diagnostics
Redo diagnostics
2019-02-22 00:36:11 -08: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
bc7485361a Check &hidden for split window
Fixes #307
2019-02-20 01:11:05 +09:00
mattn
62c2f94acc Merge pull request #283 from prabirshrestha/format-range-sync
Add format-range-sync
2019-02-14 23:06:44 +09:00
Yasuhiro Matsumoto
c16ec24e7f Set position to start renaming 2019-02-12 19:10:07 +09:00
Yasuhiro Matsumoto
d1058060bf Merge branch 'master' into rename-prepare 2019-02-12 16:27:55 +09:00
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