147 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
Satoru Kitaguchi
2be2b07b53 Support lsp_document_symbol_detail option (#1482)
* Support `lsp_document_symbol_detail` option

to show details

* fixup! Support `lsp_document_symbol_detail` option
2023-08-04 18:58:33 -07:00
Ryuichiroh
3244bed522 Add option to disable float of diagnostic error when insert mode (#1417) 2023-01-15 18:57:42 +09:00
Ryuichiroh
c4bae1f79b Allow adjustable options of prop_add() for virtual text (#1412)
Co-authored-by: ryicoh <ryicoh@gmail.com>
2023-01-05 00:36:44 +09:00
Piotr Usewicz
be675ffca2 Add GUI menus (#1402)
* Add GUI menus

This change adds some basic GUI menu and right-click popup.

* Update lsp.vim
2022-12-20 09:33:51 -08:00
yuilib
9a00d5aba4 Allow specifying max width for floating windows (#1336) 2022-12-20 09:32:37 -08:00
Prabir Shrestha
5c1df0cf12 Prefer native lsp api when in vim. (#1362)
* add g:lsp_experimental_native_lsp flag to enable native vim lsp client

* send request and correctly call on_notification

* add support for native client in lsp#client#send_notification

* Add native lsp client support for lsp#client#send_response

* add native notification support

* add support for native stop job

* handle error response for document_formatting.vim and code_action.vim

* add missing return for code action

* fix indent

* undo code action error

* check for a:response to be of type dict as stderr will send string

* use out_cb and err_cb instead of channel callback

* bump has_native_client version check to 8.2.4780 which fixes LSP parsing messages when partial data is received

* rename g:lsp_experimental_native_lsp to g:lsp_use_native_client

* fix s:native_err_cb

* pass env

* disable lsp_use_native_client

* add lsp#utils#has_native_lsp_client()

* clean up log

* handle requests from server

* fix lint issues

* update docs
2022-12-19 19:44:45 -08:00
Björn Steinbrink
ed2c818b1e Add support for virtual text diagnostics in Vim9 (#1358)
* Fix virtual-text link in lsp_inlay_hints_enabled docs
* Add support for virtual text diagnostics in Vim9
2022-12-19 19:23:29 -08:00
hrsh7th
9baef1f1cc Add an option to fixup vim popup with conceal problems (#1376)
* Fix vim's popup and conceals

* Add lsp_preview_fixup_conceal

* Fix CI
2022-12-03 11:42:53 +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
mattn
4d8a27513d Inlay hint (#1347)
* inlay hint

* implement inlayHints

* implement inlayHints

* update doc

* fix

* fix

* separate highlights

* update/clear

* use callbag

* remove from doc

* disable default

* update doc

* check version

* check label array

* call prop_remove()

* use lsp#utils#range#get_range()

* add comma

* add lsp_inlay_hints_mode

* own highlight

* update doc

* fix style check

* rename

lsp#utils#_has_virtual_text to lsp#utils#_has_nvim_virtual_text
lsp#utils#_has_vim9textprops to lsp#utils#_has_vim_virtual_text

* update doc

* fix version

* remove all
2022-08-25 02:02:42 +09:00
frankplow
68c018eb1a Semantic Tokens Support (#1275)
* initial naive implementation of semanticTokens

* fix race condition when starting new lsp server

* fix error when closing and re-opening a buffer

* support nvim highlighting

* provide tokenTypes and tokenModifiers client capabilities

* move semantic.vim to autoload/lsp/internal

* refactor semantic tokens to use a callbag

* remove scope tree functions

* refactor decoding of semanticTokens responses

* improve semantic tokens nvim support

* add support for multi-byte characters

* update semantic tokens on TextChangedP

* don't apply semantic highlighting to large files

* replace semantic_highlight server key with custom highlight groups

* rename g:lsp_large_buffer_threshold to g:lsp_max_buffer_size

* fix typo: correct LpEvents to LspEvents

* update semantic highlighting documentation

* change has('popupwin') to exists('autoload/lsp/internal/semantic.vimTextChangedP')

* correct lsp_max_buffer_size usage

* add LspSemanticHighlightGroups helper command

* use explicit scope and reorganise decode_tokens

* use robust comparison + single quoted strings in s:init_highlight

* update semantic highlighting on VimEnter

* support semanticTokens/full/delta requests

* request semanticTokens/full on BufNewFile or BufReadPost

* perform full semantic updates on lsp_buffer_enabled

* support SemanticTokensDelta response to textDocument/semanticTokens/full/delta request

* decide between full or delta semanticTokens request based on state

* use prop_add_list to add semantic tokens

* sort semanticTokens edits before applying

* update semantic.vim to conform to google style guide

* update default semantic highlight groups to better match usage

* fix parsing of SemanticTokensOptions

* mention g:lsp_semantic_enabled in vim-lsp-semantic docs

* document g:lsp_semantic_delay

* add support for semantic token modifiers

* sort semantic tokens modifiers alphabetically

* correctly report semantic tokens capabilities
2022-06-30 20:11:47 -07:00
Prabir Shrestha
3d0fc4072b Add initial support for workspace folders (#1265)
* add g:lsp_experimental_workspace_folders

* send client capabilities for workspaceFolders if g:lsp_experimental_workspace_folders is enabled

* fix g:lsp_experimental_workspace_folders missing s

* send workspaceFolders if workspaceFolder capability is defined via client

* add local copy add opened workspace folders

* Add support for workspace folders

* document Workspace folders

* add indent

* fix doc indent
2022-02-12 12:28:43 -08:00
Prabir Shrestha
10bbcb1142 use new floating window api for hover (#1078)
* use new floating window api for hover

* rename type to ui

* fix lint issues

* add support for --ui=float|preview for LspHover

* add g:lsp_hover_ui

* always show below the cursor

* close on move

* fix when using empty g:lsp_hover_ui

* add hover preview support

* apply markdown for preview

* show top if available

* fix col position when far right

* silent deletebufline

* fix indent

* remove language

* set language

* fix normalize

* don't close if curpos hasn't changed

* if hover window is foused close

* add border

* add double tap support for floating LspHover window and lsp-hover-close plug

* fix indent

* fix lint issue

* fix grammar

* *ed

* remove echom register

* fix indent

* add lsp-hover-float and lsp-hover-preview plug
2021-12-17 15:04:04 -08:00
mattn
ee38eb1bc6 Support untitled buffer (#1152)
* Support untitled buffer

* Enable opt out

* Add documentation

* Add documentation

* Use correct buffer names

* Wipeout file contents
2021-09-27 18:22:58 +09:00
vimuxx
f3bde658ab E119: Not enough arguments for function: lsp#ui#vim#call_hierarchy_incoming (#1182) 2021-06-06 23:21:27 -07:00
Daisuke Suzuki
541ed984b1 Add LspAddTreeCallHierarchyIncoming (#1139) 2021-05-31 13:41:41 -07:00
Linda_pp
800c878209 Support show message notification by handling window/showMessage response (#1120)
* support window/showMessage

* describe g:lsp_show_message_log_level in documentation

* add tests for window/showMessage support

Co-authored-by: mattn <mattn.jp@gmail.com>
2021-03-28 21:58:20 +09:00
obcat
7d7ded98dd Silence plug mappings (#1125) 2021-03-28 21:52:25 +09:00
Josh Stone
a31d2aa1f1 Use -wrap=0 in *-nowrap plug mappings (#1121)
Using `--nowrap` doesn't work, but the related commands document that
you should use `-wrap=0`, which does work in the mappings too.

Co-authored-by: mattn <mattn.jp@gmail.com>
2021-03-28 13:37:19 +09:00
Prabir Shrestha
24533c28ae add lsp_signature_help_delay to allow users to configure and default to 200 (#1106) 2021-03-15 22:47:30 -07:00
Prabir Shrestha
eb237a2ced [WIP] add codeaction sign support (#1085)
* add codeaction sign support

* add hl LspCodeActionText

* add docs

* add support for multiple servers

* only set signs if buffer exists
2021-03-06 10:56:44 -08:00
Prabir Shrestha
a78536ad74 refactor LspHover (#1063)
* use callbag for hover
2021-02-22 04:35:01 -08:00
Prabir Shrestha
cacfc79eb4 completion/resolve support for documentation and use the new floating window (#1052)
* doc

* floating window with completion/resolve

* add comments

* use _split_by_eol

* copy event

* fix dupe

* Fix size/markdown/detail

* - Improve for exceptional case
- Fix code style
- Support detail only case

* Add lsp_float_opened/lsp_float_closed

* remove old documentation code

* update documenation and change flags to use g:lsp_completion_documentation

Co-authored-by: hrsh7th <hrsh7th@gmail.com>
2021-01-23 09:11:27 -08:00
Prabir Shrestha
51a566c878 default to using quickpick for codelens (#1053) 2021-01-18 09:54:59 -08: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
Prabir Shrestha
3ed0e7aa31 Workspace symbol search using quickpick (#1035) 2021-01-09 22:14:07 -08:00
Prabir Shrestha
e699b0fcb6 add LspDocumentSymbolSearch using quickpick (#1029) 2021-01-09 12:14:26 -08:00
Prabir Shrestha
89135264c2 embed quickpick.vim and add experimental quickpick support for codelens (#1019) 2021-01-05 05:26:54 +00:00
Prabir Shrestha
62ef9585a1 remove CodeLensSync (#1011) 2021-01-02 23:12:09 -08:00
Prabir Shrestha
268341fe60 Diagnostics refactor movements (#1004) 2021-01-02 13:59:31 -08:00
Prabir Shrestha
efd07d859e Revamp diagnostics highlights (#995) 2020-12-31 23:13:19 -08:00
Prabir Shrestha
5743ae2110 Diagnostics signs revamp (#994) 2020-12-31 01:23:26 -08:00
Prabir Shrestha
1489cf8295 Revamp diagnostics virtual text (#990) 2020-12-30 14:49:44 -08:00
Prabir Shrestha
6bb6069f94 Diagnostics for all buffers (#982)
* render diagnostics in loclist and fix args paser
* document --buffers flag for LspDocumentDiagnostics
* do not show diagnostics if it is disabled for buffer
* remove old code and fix plug mapping for lsp-document-diagnostics
* add unit tests for document diagnostics command
2020-12-27 22:44:18 -08:00
micchy326
630015f8f5 fix LspNextReference (#976) 2020-12-26 10:29:54 -08:00
Prabir Shrestha
0c4e149ac5 add window.workDoneProgress client capability (#970) 2020-12-24 01:32:55 -08:00
Prabir Shrestha
f9c8184c74 Rename to highlight_references to document_highlight to match lsp (#968)
* rename highlight_references to document_highlight
* add dynamicRegistration to false for documentHighlight client capabilities
2020-12-24 00:12:45 -08: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
Prabir Shrestha
24c743c057 remove dupe config 2020-12-11 20:47:38 -08:00
Trevor Stone
e1adf0f84e Fix lsp-type-hierarchy plug mapping and a typo. (#934)
Fixes #933.
2020-11-20 01:28:21 +00:00
Subhaditya Nath
45babeb947 Improved neovim floating windows, and misc. other improvements (#921) 2020-11-15 01:37:01 +09:00
Sean Dewar
32b52c9316 Add missing arg for <Plug>(lsp-workspace-symbol) (#925) 2020-11-04 11:09:57 +09:00
William Boman
fdb69ab913 populate location list with all modified changes in a WorkspaceEdit (#555) 2020-10-23 19:41:32 -07: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
51eb1f6676 add support for window/showMessageRequest (#919)
* show message request
* materialize so doesn't throw error and add message to input list
* fix lint issues and rename flag to lsp_show_message_request_enabled
* use action and fix filter
* document g:lsp_show_message_request_enabled
2020-10-18 08:46:03 -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
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