Commit Graph

225 Commits

Author SHA1 Message Date
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
mattn
e090d84150 Merge pull request #273 from prabirshrestha/fix-race
Fix race while switching buffer
2019-01-29 15:14:57 +09:00
Yasuhiro Matsumoto
afcbbc5781 Fix race while switching buffer 2019-01-29 14:13:29 +09:00
bmtsstl
c54048bf4f Fix expr 2019-01-29 11:46:17 +09:00
bmtsstl
24e6341523 Fix sending empty changes when deleting text 2019-01-29 09:16:45 +09:00
Yasuhiro Matsumoto
56fb2b7f47 Do not call send_event_queue 2019-01-19 23:12:37 +09:00
Yasuhiro Matsumoto
af9233a218 Fix no event queue 2019-01-19 23:08:41 +09:00
Yasuhiro Matsumoto
f6b1140a33 Disable event queue in default 2019-01-19 20:29:17 +09:00
Yasuhiro Matsumoto
2d6ecfdaa6 Use empty() 2019-01-16 15:16:31 +09:00
Yasuhiro Matsumoto
b4b91f7d0a Fix diff
Return empty array when not changes
2019-01-16 15:07:02 +09:00
Yasuhiro Matsumoto
45967fcf6e Check the buffer exists 2019-01-16 02:16:38 +09:00
Yasuhiro Matsumoto
8bfbaf9e57 Add TextChangedP 2019-01-16 02:11:44 +09:00
Yasuhiro Matsumoto
b27c956a4f Cosmetic changes 2019-01-16 02:09:26 +09:00
Yasuhiro Matsumoto
edbc9097b7 Update with current content 2019-01-16 00:51:32 +09:00
Yasuhiro Matsumoto
9a603f8a15 Merge branch 'master' into fix-235 2019-01-16 00:44:29 +09:00