Commit Graph

139 Commits

Author SHA1 Message Date
itchyny
2526438c44 Register CursorMoved event only when required (#699) 2020-02-08 22:17:57 +09:00
mattn
bf8d206eca Cache signature_help_trigger_chars (#696)
* Cache signature_help_trigger_chars

* Move code to the part which updating init_results.

* Tweaking delay for signature help

* Disable warning of unused-variables
2020-01-31 00:31:53 +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
mattn
896abb2d69 Ignore cmdwin (#664)
* Ignore cmdwin

* Ignore / cmdwin
2020-01-09 08:07:29 -08:00
hrsh7th
fef60795ec Improve signature help with lexima.vim (#638)
* Improve signature help with lexima.vim

* Fix buffer change problem

* Display signature help after cursor jumped

* Fix event

* Add _ prefix for inner functions
2020-01-04 09:17:03 -08:00
prabirshrestha
6bb1252a9c show long of starting server 2020-01-04 09:12:12 -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
4468bbc2bd add lsp#_new_command() and lsp#_last_command() (#648)
* add lsp#_new_command() and lsp#_last_command()

* remove log

* fix rename
2020-01-01 18:18:55 -08:00
Prabir Shrestha
67caa411c8 add initial support for type hierarchy (#641) 2019-12-31 17:12:55 -08:00
Prabir Shrestha
7ccab31b79 default hierarchicalDocumentSymbolSupport to false for documentSymbol (#630) 2019-12-26 12:52:42 -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
mattn
0956e85875 Print color statuses (#602)
* Print color statuses

* Prefer single quoted strings
2019-12-16 18:37:38 -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
mattn
499794bb21 Set snippetSupport: false (#575) 2019-11-23 13:28:11 -08:00
hrsh7th
4d0ec0d698 Avoid wrong buffer open (#502) 2019-11-20 01:43:22 -08:00
hiroebe
6db5bd6c3b Add function to update workspace_config (#462) 2019-11-14 20:27:29 -08:00
Jack Guo
3349cdc443 Hotfix on_text_document_did_save() (#455) 2019-10-12 19:43:33 -07:00
Christian Clason
db2b675397 Allow for MarkupContent in completion info (#500)
* allow for MarkdownContent in completion info

* add check for correct type in MarkupContent

* also pass Markdown, and hope for the best

* d'oh!

* advertise plaintext preference in documentation

* fix documentationFormat

Co-Authored-By: Thomas Faingnaert <thomas.faingnaert@hotmail.com>
2019-10-03 16:17:40 +02:00
Christian Clason
906bd2eafe Use locationLink for definition preview (#498)
* use locationLink for definition preview

* remove cursor setting for location link

* make vint happy

* also advertise support for declaration, typeDefinition, implementation

* small refactor

* refactor to avoid code duplication

* restore lost check for file
2019-09-10 16:20:56 +02:00
Thomas Faingnaert
698eccaff3 Implement folding (#445)
* Implement folding

* Allow disabling folding globally
2019-09-08 19:17:29 +02:00
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
Jared Tiala
e6d4367db0 Add delay before didSave callback (#455) 2019-09-07 15:33:52 -07:00
Christian Clason
886dfda496 Announce support for Item and Symbol kinds (#485)
* announce support for Item and Symbol kinds

* generate list of kinds from dictionaries
2019-09-07 16:41:29 +02: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
hiroebe
6de0ccd6fb Fix lsp#disable() to disable all ui features (#437) 2019-07-18 13:53:02 -07:00
Thomas Faingnaert
1d48fc83e2 Implement workspace/configuration (#427) 2019-07-11 13:39:05 -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
Thomas Faingnaert
2176417264 Fix documentHighlight always being sent (#413) 2019-06-25 11:08:24 -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
itchyny
ab1a95c7ad fix No matching autocommands message on doautocmd User lsp_complete_done 2019-06-17 18:29:09 +09: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
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
Prabir Shrestha
a1778c8153 fix s:call_did_save fixes #354 2019-03-25 14:08:15 -07:00
Jason Cheatham
b20f79c8e0 Add support for nvim highlights (#352) 2019-03-23 10:01:17 -07:00
Tomasz Zurkowski
21713325d1 Remove trailing space in 'applyEdit ' field. (#344)
The 'applyEdit ' field inside initialize reqest (inside
capabilities.workspace) has trailing space which is incorrect and can
cause servers to ignore this capability.
2019-03-23 09:49:44 -07:00
Tomasz Zurkowski
c5c7bf0abc Do not include 'version' in didSave notification. (#345)
The LSP has TextDocumentIdentifier and VersionedTextDocumentIdentifier.
Currently vim-lsp uses Versioned one in didSave notification which is
incorrect. This change will correctly omit 'version' from didSave
notification but will keep including it in didChange notification.
2019-03-22 09:08:39 -07:00
Prabir Shrestha
8471d04c0f ignore terminal buftype (#342) 2019-03-21 14:01:47 -07: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
Yasuhiro Matsumoto
579dc32e8a initializationOptions is not passed 2019-03-03 00:23:10 +09:00
Yasuhiro Matsumoto
0bffe7f621 initialization_options is not passed
Fixes #326
2019-03-03 00:03:17 +09:00
Tomasz Zurkowski
fd769ee73d Populate required processId in InitializeParams. (#325)
According to LSP 3.0 specification, params in 'initialize' request is
required (it can be null, but it has to be specified). This change
populates the processId with PID of vim process.
2019-03-02 01:46:44 -08:00
Tomasz Zurkowski
6a12c01dbe Send initialized notification to the server. (#317)
According to 3.0 specification, client should send 'initialized'
notification after client received response to 'initialize' request.

https://microsoft.github.io/language-server-protocol/specification#initialized
2019-02-26 19:44:05 -08:00
mattn
8a8f213129 Initialization Options should be an option could be opt-out. (#323) 2019-02-26 19:42:40 -08:00
Bryan Forbes
e40175d972 If the user has "fixendofline" set, append a blank line to preserve the EOF newline (#302)
* If the user has "fixendofline" set, append a blank line to preserve the EOF newline
* Break utility function out into its own file and add tests
* Improve EOL detection based on docs and improve tests
2019-02-15 21:05:46 -08:00
Yasuhiro Matsumoto
937a1026a8 Fix order of argument for s:get_last_file_content() 2019-02-08 11:27:42 +09:00
Yasuhiro Matsumoto
0d87cf8402 Fix order of arguments in s:update_file_content 2019-02-08 10:40:46 +09:00