Commit Graph

86 Commits

Author SHA1 Message Date
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
Cody Buell
a943fe558d Add ability to set unique hi for virtual text (#811)
Have virtual text default to vim-lsp defaults for each severity sign,
follow any set or link for a user defined Lsp*Text highlight group, but
allow for unique hi for Lsp*Virtual.

Updated documentation to reflect changes.  Fixed typo in README.md.
2020-05-08 21:37:30 -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
Timur Celik
e475e0a407 Add example for g:lsp_get_vim_completion_item (#797)
I added an example because there are some pitfalls if one is not fluent
in vimscript:
- using call() instead of :call
- passing a:item and varargs correctly
- variable name for FuncRef must be uppercase
- g:lsp_get_vim_completion_item must be a List

Co-authored-by: Prabir Shrestha <mail@prabir.me>
2020-05-02 18:32:23 -07:00
Tsuyoshi CHO
f1bc0a109e fix helptag : confilict vim-lsp-settings plugin's help (#807) 2020-04-29 17:16:15 -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
Mitin Arseny
5dd94c66f7 lsp_diagnostics_updated autocommand (#783)
* feat: lsp_diagnostics_updated autocommand

* docs: remove lightline.vim

* docs: generalize not only for status line
2020-04-10 20:38:28 -07:00
Tsuyoshi CHO
a5b027193d help: fix blacklist description (#756) 2020-03-15 21:05:58 -07:00
hrsh7th
39e127ff5d Fix duplicate helptag (#738) 2020-03-03 13:25:17 +09:00
hrsh7th
46308234a2 Implement register command (#735)
* Implemente register command

* Add server_name to command context

* Expose lsp_to_vim, vim_to_lsp API's as public
2020-03-03 13:09:41 +09:00
mattn
d9e471e142 Remove typed_pattern (#704)
* Remove typed_pattern

* Rename asyncomplete_refresh_pattern to vim_lsp_refresh_pattern

* Fix textEdit to clear inserted text

* Fix when startcol can not be found

* Find first item for refresh_pattenr

* Fix

* Update doc

* Trim empty spaces right

* Use space
2020-02-15 01:00:19 +09:00
Prabir Shrestha
fabb572f7e document vim-vsnip for snippets (#710) 2020-02-09 09:20:39 -08: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
Prabir Shrestha
e4422f660b add official link sto vim-lsp-settings instructions (#623) 2019-12-25 15:15:28 -08:00
FUJIWARA Takuya
380f92fcce Add :LspStopServer (#604)
* add :LspStopServer

* add :LspStatus to vim-lsp-contents
2019-12-17 21:41:51 -08:00
mattn
d85c6a5f87 Fix typo (#601) 2019-12-14 21:44:04 -08:00
mattn
f759e4dd0d Add lsp_buffer_enabled (#599)
* Add lsp_enabled

* Enable LSP on new file

* Rename to lsp_buffer_enabled

* Update doc

* Rename to on_lsp_buffer_enabled
2019-12-15 14:20:37 +09: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
thinca
d537a4370a Improve help (#588)
* Add : prefix for helptag of Ex commands

* Use function name for helptag of functions

Also adds signature of arguments.

* Apply code block highlights for codes

* Fix link errors

* Do not need link for Vim's options

* Fix some too long lines

* Add link

* Fix tabs
2019-12-03 23:43:13 +09:00
Prabir Shrestha
45d5bff9d7 add docs for g:lsp_log_file (#565)
* add docs for g:lsp_log_file

* reword
2019-11-16 16:47:45 -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
Christian Clason
550c7eb95a Allow custom server-specific symbol and completion item kind (#524)
* allow customization of symbol_kinds

* allow customization of completion_item_kinds

* make server name optional

* add docs

* slightly rearrange documentation

* Remove trailing whitespace
2019-10-03 14:29:50 +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
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
Thomas Faingnaert
d542bbc5a3 Document customization of popup window color (#415)
* Allow customizing popup window highlight group

* Add documentation

* Revert "Add documentation"

This reverts commit 41954eb959.

* Revert "Allow customizing popup window highlight group"

This reverts commit 625439bb1e.

* Add customization instructions to documentation
2019-06-29 12:28:37 -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
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
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
IceNature
fe2ec6e040 Search for multiple file/dir names in lsp#utils#find_nearest_parent_file_directory (#373)
* Search for multiple file/dir names in lsp#utils#find_nearest_parent_file_directory

* Add tests for lsp#utils#find_nearest_parent_file_directory

* Document lsp#utils#find_nearest_parent_file_directory
2019-05-12 22:33:38 -07:00
smhc
a80d617938 Documented g:lsp_diagnostics_echo_cursor (#380) 2019-05-12 19:54:03 -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