Commit Graph

120 Commits

Author SHA1 Message Date
Satoru Kitaguchi
7233bb2ec0 Add LspAddTreeReferences (#1484) 2023-09-08 22:25:51 -07:00
Illia Bobyr
aa93b2a570 LspStopServer: Stop all and stop specific (#1491)
It is convenient to be able to stop all LSP servers, regardless of the
currently active buffer.

Also, it seems confusing that when a server name is specified, it is
only stopped if it is also one handling the current buffer type.  I
would imagine it is quite rare to have more than one server handing a
specific buffer type.  And if one explicitly specified a name, it seems
reasonable to stop this particular server, regardless of the currently
active buffer.
2023-09-08 21:17:24 -07:00
Marcin Szamotulski
0a8d2dfaed Prepare call hierarchy (#1388)
The response ought to be a list, although haskell language server
replies with a null at times.

Co-authored-by: Prabir Shrestha <mail@prabir.me>
2022-12-03 09:50:56 -08:00
hrsh7th
e42203b4f0 Support all of rename response formats (#1387) 2022-11-10 09:23:37 +09:00
Björn Steinbrink
06f2c12604 Add an option to use a popup menu for code actions (#1361)
For code actions, some people might find it more convenient to use a
popup menu that shows up at the cursor position, instead of using the
quickpick window at the bottom of the screen.
2022-10-15 12:33:37 -07:00
Daisuke Suzuki
541ed984b1 Add LspAddTreeCallHierarchyIncoming (#1139) 2021-05-31 13:41:41 -07:00
Daisuke Suzuki
56124b0104 Always show the kind and name in CallHierarchy (#1128)
Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2021-04-02 22:23:39 +09:00
Linda_pp
b8e75ef927 Fix making location list from call hierarchy items (#1113)
* fix making location list from call hierarchy items (fix #1112)
* use kind and name when detail is not available on handling call hierarchy item
2021-03-21 11:48:11 -07:00
Daisuke Suzuki
17180038a8 add support for call hierarchy (#1046)
* add support for call hierarchy

* no need to use a timer

https://github.com/prabirshrestha/vim-lsp/pull/1046#discussion_r559003701

* add commands to README.md
2021-01-17 18:44:25 -08:00
obcat
58dc3b183c Add title to Lsp(Document|Workspace)Symbol quickfix window (#936)
Co-authored-by: mattn <mattn.jp@gmail.com>
2021-01-05 13:11:18 +09:00
Linda_pp
748a8e3aea Improve error message at unsupported feature (#1001) 2021-01-03 01:58:03 +09:00
Prabir Shrestha
b316729ef5 use callbag to implement document format with timeout (#956)
* use callbag to implement document format with timeout

* document lsp#stream() with example

* send message to stream when using lsp#_new_command

* use -- for args parsing and add g:lsp_document_format_sync_timeout

* throw string exception

* use new func for <plug>(lsp-document-format)

* document g:lsp_format_sync_timeout

* rename to document_formatting

* add document_range_formatting.vim

* remove formatting from ui/vim.vim

* document :LspDocumentRangeFormatSync

* add LspDocumentFormatSync example in README.md
2020-12-22 22:08:32 -08:00
David Briscoe
d821bd8e18 Allow LspWorkspaceSymbol query on cmdline (#742)
Allow users to specify their query on the cmdline so they have easier
access to registers and vim-editing methods (especially with ctrl-f to
enter cmdline-window).
2020-10-18 09:16:32 -07:00
Prabir Shrestha
9abaa02ad8 refactor type_hierarchy to different file (#916)
* refactor type_hierarchy to different file
* fix not supported
2020-10-17 10:32:49 -07:00
Prabir Shrestha
32fae1f0e9 use allowlist and blocklist instead (#847)
* use allowlist and blocklist instead
* add lsp#get_allowed_servers()
2020-06-26 16:13:09 -07:00
Kebin Liu
17a7d92ed0 Changed Quickfix list behaviour (#752)
* Changed Quickfix list behaviour

At this before, lsp commands will clean current Quickfix list and create
a new one. This will cause some trouble, e.g.: when we have search result
in Quickfix list, but if we do :LspDefinition jump to symbol definition, the Quickfix list will
be empty.

Now, let :Lsp* commands just replace Quickfix list when the results need
to display on Quickfix list

* using empty then create instead replace
2020-06-09 23:03:01 -07:00
Lucio Andrés Illanes Albornoz
2dc493318c Fix peeking of files w/ spaces in pathnames. (#813) 2020-06-09 22:55:57 -07:00
Daisuke Suzuki
18f2e922f7 Add support for code lens (#831) 2020-06-09 22:45:20 -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
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
6e78f35aad ESC to cancel workspace/symbol (#717) 2020-02-15 01:03:42 +09: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
mattn
d35d297447 LspWorkspaceSymbol should redraw prompt (#708) 2020-02-08 23:41:56 +09:00
mattn
2f1ce88a83 Add missing function (#667)
Fixes #666
2020-01-11 11:53:22 -08: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
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
b02345d223 added lsp#utils#location#_lsp_to_vim_list (#647)
* added lsp#utils#location#_lsp_to_vim_list
* check of response.result
* remove lsp#ui#vim#utils#locations_to_loc_list
* refactor to use s:open_location
* use lsp#utils#is_file_uri
2020-01-01 16:10:33 -08:00
Prabir Shrestha
3aba91cf71 remove lsp#utils#to_col in favor of lsp#utils#position#_lsp_to_vim (#645)
* refactor to use lsp#utils#position#_lsp_to_vim
* remove lsp#utils#to_col in favor of lsp#utils#position#_lsp_to_vim
* fix doc
2020-01-01 13:33:36 -08:00
Prabir Shrestha
c35a328774 refactor LspTypeHierarchy (#643)
* add lsp#utils#buffer#_open_lsp_location(location)
add lsp#utils#position#lsp_to_vim(expr, position)
add visual selection when using _open_lsp_location
update tagstack when opening hierarchy item
* move to location.vim
* use normal!
* rename to lsp#utils#position#_lsp_to_vim
* update bufnr to the latest buffer
2019-12-31 22:37:14 -08:00
Prabir Shrestha
8c5ee44eee lsp#utils#tagstack#_update (#642) 2019-12-31 19:25:37 -08:00
Prabir Shrestha
67caa411c8 add initial support for type hierarchy (#641) 2019-12-31 17:12:55 -08:00
hrsh7th
a79e1614a8 Add only parameter for code action request (#607) 2019-12-23 10:05:11 -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
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
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
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
d7e644c2a7 Nicer syntax highlighting for hover (#441)
* Implement syntax highlighting for hover

* Fix signatureHelp
2019-09-08 11:26:22 -07: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
mattn
b1ed3dd843 Redraw message if async (#489) 2019-09-07 15:34:32 -07:00
Daisuke Suzuki
0534c79053 fix local variables 2019-08-17 21:50:51 +09:00
Daisuke Suzuki
6ee6e16aa5 refactor 2019-08-17 21:45:56 +09:00
Daisuke Suzuki
301d39bfd4 carve out
https://github.com/prabirshrestha/vim-lsp/pull/449#issuecomment-522219226
2019-08-17 21:45:26 +09:00
Daisuke Suzuki
8ab9f6f055 set bufnr 2019-07-26 09:45:18 +09:00
Daisuke Suzuki
d6e88604c9 clear unnecessary items 2019-07-26 09:45:08 +09: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
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
mattn
69f31d5bf2 Use fnameescape() (#404)
Close #167
2019-06-12 07:18:03 -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
mikoto2000
e5f54f9b38 Fix called function name mismatch. 2019-03-18 21:08:49 +09:00