Commit Graph

777 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
jiz4oh
42d223c266 Fix disappeared kind (#1485) 2023-08-15 13:48:30 +09: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
Colin Cheng
e74bd3c986 Fix ':LspStopServer' not working when enable native lsp client support (#1473)
When set `let g:lsp_use_native_client = 1` to enable native lsp client support,
if call `:LspStopServer` to stop the lsp server, the server stopped but the
status still show it as `running` by `:LspStatus`, this patch try to fix
this issue.
2023-05-15 10:16:45 -07:00
Milly
8351fd3cea Close float window on InsertEnter or BufLeave (#1459)
* Close float window on InsertEnter or BufLeave
* Ignore vint in dynamically executed augroups
2023-05-15 10:16:03 -07:00
Piotr Usewicz
6017a30e8a Enable scrollbar in popup window (#1469)
LspHover can show a lot of text sometimes. Enabling the scrollbar ensures it can be scrolled via mouse, for example.

Tested locally.

Closes https://github.com/prabirshrestha/vim-lsp/issues/1457
2023-05-04 13:09:52 -07:00
Colin Cheng
507565f281 fix eat of typing char after completion done (#1468)
When using typescript-language-server, in content `Math.ab|`, if you type
`<C-X><C-o>` for omni completion, it will be completed with `s`. Then, the
content will become `Math.abs|`. If you continue typing `(`, the `(` will
be removed. Also, if type `<CR>`, a new line will be added, resulting in
`Math.abs|s\nMath.ab`. This patch attempts to fix this issue.
2023-04-27 23:21:05 +09:00
Gabriel Barta
6703edafe6 Improve performance placing signs and virtual text (#1455)
Since the functions don't change the linecount, call
getbufinfo(...).linecount once rather than many times.
2023-04-05 21:35:58 -07:00
Illia Bobyr
44608334f9 Allow workspace_config to be a function (#1400)
It is sometimes useful to generate `workspace_config` using a callback.
For example, if the produced config needs to include some information
from the actual workspace.
2023-04-03 17:16:42 -07:00
Kebin Liu
e82e73a5eb Escape path before findfile or finddir (#1444) 2023-03-09 17:25:54 +09:00
Yutao Yuan
80cd62f8f2 Support sync option in vim8 native client (#1425)
`additionalTextEdits` was not working with native client because it uses
`'sync': 1` which was not handled by the code. This PR gets it working.
2023-03-03 21:03:33 -08:00
Coelacanthus
65628c3b0a fix inlay hint list separator (#1438)
fix #1430 

It lead wrong format.
2023-02-05 22:00:48 -08:00
Yutao Yuan
a5e06b7761 Make the CompleteDone backspace check more robust (#1426)
When checking for backspace in `CompleteDone` event, also look at the
line number. If the line number changed, the user probably pressed
something like `<CR>` and not backspace.
2023-01-28 01:19:11 +09:00
Ryuichiroh
e0111e199d Place multi-line highlights every lines (#1422)
* Place multi-line highlights every lines

* Update autoload/lsp/internal/diagnostics/highlights.vim

Co-authored-by: mattn <mattn.jp@gmail.com>

Co-authored-by: mattn <mattn.jp@gmail.com>
2023-01-23 08:04:56 +09:00
Ryuichiroh
3244bed522 Add option to disable float of diagnostic error when insert mode (#1417) 2023-01-15 18:57:42 +09:00
Björn Steinbrink
500987604d Fix flicker on document highlighting with vim 9.0.0993 (#1397)
Since v9.0.0993 vim performs a full redraw when removing text property
types, which causes flickering because vim-lsp currently removes and
re-adds the property type every time the highlight is updated. To avoid
that, we can just check if the property type already exists on the
given buffer, and only add it if it doesn't exist yet.
2023-01-06 16:12:17 -08: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
Marcin Szamotulski
3f6e23f3d8 Use prop_remove before adding virtual text (#1411) 2022-12-28 11:33:51 -08:00
Gabriel Linder
59e108e974 Workaround for float position. (#1405)
Signed-off-by: Gabriel Linder <gabriel@numberly.com>

Signed-off-by: Gabriel Linder <gabriel@numberly.com>
2022-12-20 09:48:16 -08:00
yuilib
9a00d5aba4 Allow specifying max width for floating windows (#1336) 2022-12-20 09:32:37 -08:00
mattn
52240c3cd7 @ should not be escaped (#1403)
* @ should not be escaped

* fix order
2022-12-20 16:22:00 +09: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
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
mattn
f453d6cb02 workaround for float position (#1392) 2022-12-03 16:47:46 +09: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
hrsh7th
e42203b4f0 Support all of rename response formats (#1387) 2022-11-10 09:23:37 +09:00
Prabir Shrestha
c0325a8b44 add performance for check health (#1383) 2022-11-04 20:37:10 -07:00
David Briscoe
0c8fda7921 Print workspace_config with :verbose LspStatus (#1279)
* Make verbose LspStatus show workspace config

Need the trailing echo to ensure the next lsp server is on a new line.

* Use pretty printing if available

* checkhealth: Print server status and config

Add initial checkhealth support.
See https://github.com/rhysd/vim-healthcheck

Lists server status, advice for failure, and lists workspace config to
help debug issues or understand server state. Doesn't do much error
detecting.

* checkhealth: Print each server config as a section

checkhealth doesn't allow a lot of formatting (no indentation), so it's
hard to make the config output readable. Output each server as a
separate section instead of one giant config block to make the start of
each server easier to see.
2022-10-29 10:43:57 -07:00
Takayuki Tsukitani
9d4dbf7e68 move symbol into workspace (#1382) 2022-10-24 18:47:35 -07:00
Takayuki Tsukitani
a85b71bfc8 Fix default supported capabilities (#1379)
* add missing supported capabilities

* sort alphabetically

* set `dynamicRegistration` to `v:false` for adding capabilities

* add `prepareSupportDefaultBehavior` to `rename` capability
2022-10-19 18:26:32 +09:00
Lie Ryan
2bb97d2938 Replace references to pylsp with pyls (#1378)
The palantir pyls repository is no longer maintained, the documentation
should not lead user down the path of configuring this dead end project.
pylps is the actively maintained sucessor project forked from pyls.
2022-10-16 20:30:19 -07: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
frankplow
08f0583c0c Semantic tokens performance improvements (#1342)
* improve clear_highlights performance and robustness

* improve semantic tokens performance by removing regexes

* cache semantic tokens legend

* reduce copying of batched highlights

* add defaults for 3.17 semantic token types

Co-authored-by: Prabir Shrestha <mail@prabir.me>
2022-10-10 23:05:43 -07:00
Stephan T
23728ad8c5 Fix loss of reference highlights on buffer change (#1355)
Co-authored-by: Prabir Shrestha <mail@prabir.me>
2022-10-09 12:34:49 -07:00
miyuki
d45273a95c Fix Checks for the presence of a dict's key 'linecount' (#1365) 2022-10-09 12:30:03 -07:00
Björn Steinbrink
218fc2a8a2 Fix signs for diagnostics that are reported one line past the end (#1360)
Some language servers report unexpected EOF errors on the line that's
actually one past the last line of the file. Be a bit more accomodating
and just show them on the last line of the buffer instead.
2022-09-25 09:12:29 -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
Radek Simko
e5d2d3f744 fix reporting of typeHierarchy capability (#1350) 2022-08-20 11:32:46 -07:00
yuilib
309e9e5c81 Fix floating window on neovim (#1346) 2022-08-02 22:48:23 -07:00
hrsh7th
eb542a379f Correct overlapped text even if using filterText (#1341) 2022-07-22 11:51:32 +09:00
hrsh7th
771755300a Implemented word correction in cases where startcol was corrected by … (#1340)
* Implemented word correction in cases where startcol was corrected by TextEdit.range.start.character

* Don't touch abbr

* Don't use `..`

* relax get_server_info

* Improve for deno lsp item

* Fix start character

* minimal `insertReplaceTextEdit` suppoort.

* Change to filter logic similar to asyncomplete-lsp.vim

* Improve word creation

* relax lsp#utils#text_edit#get_range

* Add start_character for test case
2022-07-22 11:19:16 +09:00
yuilib
9a510cd419 Fix completion documentation floating window to show even when there is not enough space (#1334) 2022-07-17 02:40:21 +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
fungus
74e458bc9c add new preview window id api (#1323)
* add new preview window id api
resolves #1281

* add alias for getpreviewwinid()

* add documentation
2022-06-17 22:32:24 -07:00
hrsh7th
9458f6e2d4 Fix invalid mode when to expand completion item (#1319)
Co-authored-by: hrsh7th <>
2022-05-27 12:18:39 +09:00
mattn
013625b3b1 fix queue (#1316) 2022-05-23 10:17:33 +09:00
mattn
1e1a0981a7 check server_name (#1315) 2022-05-23 02:01:33 +09:00
hrsh7th
c075e157fc Improve diagnostics float implementation (#1296)
Co-authored-by: hrsh7th <>
Co-authored-by: mattn <mattn.jp@gmail.com>
2022-04-21 10:55:53 +09:00