Commit Graph

99 Commits

Author SHA1 Message Date
Prabir Shrestha
a9ac38e0f4 update callbag.vim to v0.3.0 and better handling of errors using materalize (#899)
* use materialize() for highlight references
* re-enable highlight references by default
* unlet s:Dispose()
* fix checking for isUndefined()
* update callbag to v0.3.0
* dispose if exists
2020-08-31 21:02:34 -07:00
Michito Maeda
1230ae8fa3 fix broken mappings (#898) 2020-08-30 23:44:54 -07:00
Prabir Shrestha
b7936876e5 disable highlight references by default due to #897 2020-08-31 05:01:50 +00:00
Prabir Shrestha
eb0e5fb885 use callbag for Highlight references (#891) 2020-08-30 11:11:51 -07:00
Thomas Faingnaert
a3673dde78 [WIP] Popup documentation (#507)
* Show documentation in Vim popup

* Use timer

* Reuse logic from output.vim

* Change default text

* Rename functions

* Refactor

* Use v:event

* Add comment

* Remove log

* Refactor

* Implement documentation in Neovim

* Cleanup Neovim popup

* Let Neovim float take all available space

* Extract get_size_info

* Reuse sizing logic from output.vim

* Fix Neovim positioning being reset

* Update autoload/lsp/ui/vim/documentation.vim

Co-Authored-By: Christian Clason <christian.clason@uni-due.de>

* Make vint happy

* Retrigger Travis CI

* add g:lsp_documentation_float flag

* fix lint issues

Co-authored-by: Christian Clason <christian.clason@uni-due.de>
Co-authored-by: Prabir Shrestha <mail@prabir.me>
2020-06-20 12:21:25 -07:00
Prabir Shrestha
e0cacffe54 optimize lsp#omni#get_vim_completion_items() (#835)
* optimize

* fix two omni tests

* fix omni tests
2020-06-13 02:11:02 -07:00
Daisuke Suzuki
18f2e922f7 Add support for code lens (#831) 2020-06-09 22:45:20 -07:00
John Schug
2ca2fe3854 Add support for the tagfunc option (#815)
* Add support for tagfunc option

* Consolidate various synchronous wait implementations

* Refactor to use lsp#utils#position#lsp_to_vim

Also marks get_symbol_text_from_kind as internal and fixes compatibility
with older vims.
2020-05-25 14:41:21 -07:00
Prabir Shrestha
8df76a63c0 [perf] add g:lsp_get_vim_completion_item_set_kind to enable or disable kind (#824)
* add g:lsp_get_vim_completion_item_set_kind to enable or disable kind
* enable lsp_get_vim_completion_item_set_kind for tests
2020-05-24 23:36:42 -07:00
Prabir Shrestha
3d0153bcf9 improve diff by using lua if available (#821)
* use lua if available for diff

* add docs

* sync with latest vim-lsc changes

* lazily init lua

* update vim to 8.2.0817

* update vim to 8.2.0817 for windows

* use vim 8.2.0814

* check for path 8.2.0775 before enabling lua

* use vim 8.2.0813 since it exists for both linux and windows

* update lua patch check

* optimize vimscript diff by using range

* fix lint issues
2020-05-24 13:03:32 -07:00
Eivy
c029ce1330 Jumping to diagnostics with command args '-nowrap' (#770)
* Add func 'lsp#utils#parse_command_options'

* Add wrap option to jumping to diagnostic

* Update doc

* Fix lint error

* Remove debug code
2020-05-02 18:41:55 -07:00
thinca
9a4f8de6be Add <mods> support for opening new window (#776)
* Commonalize some similar functions

* Add <mods> support for some commands

Supported commands:
- :LspDeclaration
- :LspDefinition
- :LspTypeDefinition
- :LspImplementation
2020-04-19 09:59:16 -07:00
Fujiwara Takuya
52539a54ae Show diagnostics in a floating window (#700)
* fix comment

* fix indent

* support diagnostics in a floating window

* doc: add g:lsp_diagnostics_float_{cursor,delay}

* fix vint errors except unused variables

* suppress vint unused variable errors

* lint: use robust operator
2020-02-10 01:44:05 +09:00
hrsh7th
70234feca4 Improve code action (#663)
* Improve code action

* Add LspCodeActionSync

* Fix miss argument

* Fix for the review

* Add utils and tests

* Remove unused function
2020-01-09 08:35:39 -08:00
Prabir Shrestha
730f1c40f0 disable semantic highlight by default (#656) 2020-01-05 09:37:14 -08:00
hrsh7th
f769a450b2 Fix CompleteDone (#637)
* Move some codes to completion.vim that related to handling CompleteDone.

* Add abort

* Fix test

* Add l: prefix to self vars

* Disable unused vars

* Restore position

* Support snippet simple case and vim-lsp-snippets

* Support g:lsp_text_edit_enabled

* Fix for v:null results

* Fix multi-byte chars

* Add document

* Fix for vim-lsp-snippets for now

* Prepare to future improvements

* More clalify line comment

* User get_user_data instead of extract_user_data

* Always use [''] pattern for accessing dictionary property

* Fix misspelling

* More strict check for completionProvider.resolveProvider

* Fix obj.key to obj['key']

* Store completed_item id to the user_data

* Fix omni tests

* Apply for the review
- Rename expand_text_simply -> simple_expand_text
- to_col -> _lsp_to_vim
- Rename user_data key

* Add example tests

* Add timeout to completionItem/resolve in completion.vim

* Fix timeout feature

* Add timeout log

* Fix documents
2020-01-02 01:08:34 -08:00
Prabir Shrestha
67caa411c8 add initial support for type hierarchy (#641) 2019-12-31 17:12:55 -08:00
Thomas Faingnaert
2f725fb4c3 Implement semantic highlighting (#464) 2019-12-26 10:08:30 -08:00
Vu Le
d3ce720d43 no text document did save delay by default (#629) 2019-12-26 10:03:32 -08:00
mattn
a38c46d591 Unlet exited in server (#605)
* Unlet exited in server

* LspStopServer can be specified with name
2019-12-18 16:34:44 +09:00
FUJIWARA Takuya
380f92fcce Add :LspStopServer (#604)
* add :LspStopServer

* add :LspStatus to vim-lsp-contents
2019-12-17 21:41:51 -08:00
mattn
0956e85875 Print color statuses (#602)
* Print color statuses

* Prefer single quoted strings
2019-12-16 18:37:38 -08:00
Shumpei Shiina
feefc53ea6 Jump to next/previous diagnostics other than error diagnostics (#587)
- add LspNextWarning, LspPreviousWarning commands to jump to warnings
- add LspNextDiagnostic, LspPreviousDiagnostic commands to jump to
  all kinds of diagnostics
2019-12-14 09:07:05 -08:00
Thomas Faingnaert
0e811a2874 Filter completions (#391)
* Filter completed items based on typed word

* Remove logs

* Only calculate typed_word once

* Revert "Only calculate typed_word once"

This reverts commit 161c7f460e.

* Revert "Remove logs"

This reverts commit 861c70fc7c.

* Revert "Filter completed items based on typed word"

This reverts commit c450e839b4.

* Reimplement filtering completion items

* Remove s:remove_typed_part

* Fix for NeoVim

* Use 'ignorecase' to filter items

* Allow configuration of filter

* Add documentation

* Add example for typed_pattern

* Change surrounding of `/$` to indicate it is a tag

* Add g:lsp_ignorecase

* Use filterText for filtering

* Add 'contains' filter

* Fix tests

* Avoid using regex

* Fix bug in 'contains' filter

* Use completion trigger chars for typed text

* Move copy

* Update documentation

* Use textEdit starting position

* Change default typed_pattern

* Update documentation

* Fix documentation

* Add note about narrowing down completions

* Fix tests

* Make filtering note clearer

* Remove duplicate text
2019-11-14 20:08:15 -08:00
Timur Celik
efff12608f Add lsp#formatexpr() (#528)
* Add <plug>(lsp-document-range-format)

This binding defines an operator and can be used with a motion. Because
s:document_format_range() did only format based on the visual selection
markers, a new type parameter was added to pass the selection type
according to 'opfunc'.

* Denote mapmode for plug mappings and add missing
2019-11-02 11:09:08 +01:00
Utkarsh Maheshwari
dd584dfcbf Add g:lsp_virtual_text_prefix option (#521)
This option allows prepending characters or text to the diagnostics
which are display as virtual text. It allows virtual text to be
differentiated from the code
2019-11-02 01:07:51 +01:00
Thomas Faingnaert
cc6074a624 Remove duplicate LspTypeDefinition (#531) 2019-10-03 17:10:15 +02:00
Thomas Faingnaert
d7e644c2a7 Nicer syntax highlighting for hover (#441)
* Implement syntax highlighting for hover

* Fix signatureHelp
2019-09-08 11:26:22 -07:00
Prabir Shrestha
5fafaa3d72 Disable highlight ref by default (#492)
* disable highlight references by default since it is executes request on every cursor change

* update higlight text

* fix doc
2019-09-08 11:10:36 -07:00
Thomas Faingnaert
698eccaff3 Implement folding (#445)
* Implement folding

* Allow disabling folding globally
2019-09-08 19:17:29 +02:00
mattn
ec3ba7457c Merge pull request #429 from smhc/signs_prio
Added g:lsp_signs_priority
2019-09-07 23:32:16 +09:00
mattn
96579bd0b3 Signature help (#479)
* Add signatureHelp

* Use <buffer>

* Check lsp_use_trigger_characters_for_signature_help

* Rename to lsp_signature_help_enabled

* Use InsertCharPre

* Add abort

* Check documentation exists
2019-08-31 13:08:56 -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
Thomas Faingnaert
1ab8e838ef Fix float sizing in Neovim (#468)
* Fix float sizing in Neovim

* Add g:lsp_preview_max_height
2019-08-17 18:20:16 +02:00
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
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
Thomas Faingnaert
ed304dbb8a Fix LspDocumentFormat not working as expected (#410)
* Add test

* Fix LspDocumentFormat adding newlines

* Fix manually pressing enter when formatting
2019-07-11 13:41:15 -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
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
Thomas Faingnaert
20f5b7541a UltiSnips integration (#306)
* Implement basic UltiSnips integration

* Fix already inserted text not being removed

* Fix incorrect whitespace when nesting snippets

* Fix tabstops not working in nested snippets

* Make functions abort on error

* Check if Vim has the user_data patch

* Add basic documentation

* Add explanation UltiSnips integration to README

* Use single quoted string in plugin/lsp.vim

* Allow plugins to override get_completion_item

* Remove UltiSnips specific code to set user_data

* Remove CompleteDone autocmd from omni.vim

* Revert "Add explanation UltiSnips integration to README"

This reverts commit ee12343cbf.

* Revert "Add basic documentation"

This reverts commit 979275bb4f.

* Allow changing supported capabilities

* Remove g:lsp_ultisnips_integration

* Mention snippets in READE and documentation

* Add documentation for new configuration options

* Pass server_info to get_capabilities

* Change configuration variables to be a List

This way, we don't need to start them with a capital letter.

* Add lsp_complete_done autocmd

* Add documentation of lsp_complete_done
2019-06-15 12:06:16 -07:00
Ruslan Kiyanchuk
8891d93dc3 Fix check for signs support in Neovim (#402)
Fixes #322
2019-06-11 13:46:53 -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
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
e8f3541741 Added has('patch-8.0.1493') check. 2019-03-20 05:20:15 +09: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