]> Sergey Matveev's repositories - vim-lsp.git/log
vim-lsp.git
10 months agoAuto import is not working with typescript language server. Fixes #367.
Yegappan Lakshmanan [Sat, 29 Jul 2023 01:01:49 +0000 (18:01 -0700)]
Auto import is not working with typescript language server.  Fixes #367.

10 months agoMove the code for displaying the current diag in the status line to diag.vim
Yegappan Lakshmanan [Fri, 28 Jul 2023 15:31:23 +0000 (08:31 -0700)]
Move the code for displaying the current diag in the status line to diag.vim

10 months agoUpdate help text
Yegappan Lakshmanan [Fri, 28 Jul 2023 14:56:50 +0000 (07:56 -0700)]
Update help text

10 months agoAdd option to enalbe/disable omni-completion
Yegappan Lakshmanan [Fri, 28 Jul 2023 04:32:00 +0000 (21:32 -0700)]
Add option to enalbe/disable omni-completion

10 months agoSkip displaying inlay hints if it is disabled for a language server
Yegappan Lakshmanan [Thu, 27 Jul 2023 14:08:37 +0000 (07:08 -0700)]
Skip displaying inlay hints if it is disabled for a language server

10 months agoWhen signature help is disabled for a lsp server, don't map the trigger characters...
Yegappan Lakshmanan [Wed, 26 Jul 2023 15:14:20 +0000 (08:14 -0700)]
When signature help is disabled for a lsp server, don't map the trigger characters.  Update the help text to use the space character (32)

10 months agoMerge pull request #365 from rcasta74/md_parser
Yegappan Lakshmanan [Wed, 26 Jul 2023 13:54:16 +0000 (06:54 -0700)]
Merge pull request #365 from rcasta74/md_parser

Markdown parser fix for contents with multibyte characters

10 months agoMarkdown parser: add tests for line breaks
Roberto Castagnola [Wed, 26 Jul 2023 12:49:39 +0000 (14:49 +0200)]
Markdown parser: add tests for line breaks

10 months agoMarkdown parser: fix SplitLine with multibyte characters
Roberto Castagnola [Wed, 26 Jul 2023 12:49:05 +0000 (14:49 +0200)]
Markdown parser: fix SplitLine with multibyte characters

10 months agoMarkdown parser: strip leading and trailing whitespaces in heading
Roberto Castagnola [Wed, 26 Jul 2023 12:47:48 +0000 (14:47 +0200)]
Markdown parser: strip leading and trailing whitespaces in heading

10 months agoFix test failure
Yegappan Lakshmanan [Wed, 26 Jul 2023 05:33:48 +0000 (22:33 -0700)]
Fix test failure

10 months agoAdd markdown parser tests
Yegappan Lakshmanan [Wed, 26 Jul 2023 05:30:30 +0000 (22:30 -0700)]
Add markdown parser tests

10 months agoNewline character is not removed from the completion info popup menu text
Yegappan Lakshmanan [Mon, 24 Jul 2023 16:59:40 +0000 (09:59 -0700)]
Newline character is not removed from the completion info popup menu text

10 months agoMerge pull request #363 from rcasta74/md_parser
Yegappan Lakshmanan [Mon, 24 Jul 2023 16:27:37 +0000 (09:27 -0700)]
Merge pull request #363 from rcasta74/md_parser

Fix markdown parser

10 months agoFix markdown parser
Roberto Castagnola [Mon, 24 Jul 2023 16:05:22 +0000 (18:05 +0200)]
Fix markdown parser

10 months agoMerge pull request #362 from rcasta74/md_parser
Yegappan Lakshmanan [Mon, 24 Jul 2023 14:24:48 +0000 (07:24 -0700)]
Merge pull request #362 from rcasta74/md_parser

Markdown parser enhancement

10 months agoHandle soft/hard line breaks in markdown parser
Roberto Castagnola [Mon, 24 Jul 2023 13:24:02 +0000 (15:24 +0200)]
Handle soft/hard line breaks in markdown parser

10 months agoExpand tabs used to define block structure in markdown parser
Roberto Castagnola [Sun, 23 Jul 2023 08:19:20 +0000 (10:19 +0200)]
Expand tabs used to define block structure in markdown parser

10 months agoMerge pull request #361 from girishji/omnifunc
Yegappan Lakshmanan [Wed, 19 Jul 2023 14:29:59 +0000 (07:29 -0700)]
Merge pull request #361 from girishji/omnifunc

Omnifunc optimization and readiness indicator

10 months agoImproved doc
Girish Palya [Wed, 19 Jul 2023 13:47:24 +0000 (15:47 +0200)]
Improved doc

M  doc/lsp.txt

10 months agoImproved doc
Girish Palya [Wed, 19 Jul 2023 13:34:26 +0000 (15:34 +0200)]
Improved doc

M  doc/lsp.txt

10 months agoOptimize regex comparison in omnifunc
Girish Palya [Wed, 19 Jul 2023 13:21:07 +0000 (15:21 +0200)]
Optimize regex comparison in omnifunc

M  autoload/lsp/completion.vim

10 months agoAPI to find out if LSP server has replied
Girish Palya [Wed, 19 Jul 2023 00:22:16 +0000 (02:22 +0200)]
API to find out if LSP server has replied

Add a function to find out if LSP server has replied with completion
matches. This is needed in case of using external completion engines
that expect asynchronous callback. LSP client simply acts as a source
of completion items through omnifunc (g:LspOmniFunc). Before calling
the omnifunc the second time g:LspOmniCompletePending can be checked
to see if LSP server is ready to provide completion items.

M  autoload/lsp/completion.vim
M  doc/lsp.txt

10 months agoUpdate the client capabilities. Pass buffer number to autocmd handler functions...
Yegappan Lakshmanan [Tue, 18 Jul 2023 05:11:34 +0000 (22:11 -0700)]
Update the client capabilities.  Pass buffer number to autocmd handler functions.  Send pending file changes to the language server before updating inlay hints and highlights

10 months agoOptimize the diags handling code
Yegappan Lakshmanan [Tue, 18 Jul 2023 04:46:22 +0000 (21:46 -0700)]
Optimize the diags handling code

10 months agoMarkdown is not applied in the preview window. Fixes #359
Yegappan Lakshmanan [Sat, 15 Jul 2023 19:37:08 +0000 (12:37 -0700)]
Markdown is not applied in the preview window.  Fixes #359

10 months agoPass buffer number as the argument to the autocmd handlers
Yegappan Lakshmanan [Sat, 15 Jul 2023 15:16:09 +0000 (08:16 -0700)]
Pass buffer number as the argument to the autocmd handlers

10 months agoEnable line number in the symbol peek popup window
Yegappan Lakshmanan [Fri, 14 Jul 2023 03:32:18 +0000 (20:32 -0700)]
Enable line number in the symbol peek popup window

10 months agoDiagnostic balloon doesn't work properly
Yegappan Lakshmanan [Fri, 14 Jul 2023 02:54:46 +0000 (19:54 -0700)]
Diagnostic balloon doesn't work properly

10 months agoMerge pull request #358 from vimpostor/diagsbufreload
Yegappan Lakshmanan [Wed, 12 Jul 2023 04:09:19 +0000 (21:09 -0700)]
Merge pull request #358 from vimpostor/diagsbufreload

Respect autoHighlightDiags when reloading a buffer

10 months agoDo not rely on vim's locale in tests
Magnus Groß [Tue, 11 Jul 2023 17:40:38 +0000 (19:40 +0200)]
Do not rely on vim's locale in tests

The language of the user running the tests may be different, which means
that the error message may be different as it is translated.

Instead match only against the error code, which is safer.

10 months agoEnforce disabled autoHighlightDiags when aleSupport is set
Magnus Groß [Tue, 11 Jul 2023 17:01:35 +0000 (19:01 +0200)]
Enforce disabled autoHighlightDiags when aleSupport is set

When someone enables Ale support, it semantically implies disabling
automatic highlighting of diagnostics from this plugin.

Thus we can simplify later checks by automatically disabling
autoHighlightDiags.

10 months agoNever show diagnostics when they are disabled
Magnus Groß [Tue, 11 Jul 2023 16:56:19 +0000 (18:56 +0200)]
Never show diagnostics when they are disabled

A regression was introduced in 6e4ba228eaa0770470060d8d47a360bd05a04ee5
that causes diagnostics to be displayed on buffer reload, even when the
user disabled them.

Fix this by moving the option check directly to DiagsRefresh.

10 months agoAdd the ":LspDiag" command and add sub-commands for the various Lsp
Yegappan Lakshmanan [Tue, 11 Jul 2023 02:29:14 +0000 (19:29 -0700)]
Add the ":LspDiag" command and add sub-commands for the various Lsp
diagnostic functionality.  Update the test scripts to use the new set of
commands.  Add support for dynamically changing the value of the
diagnostic options.  Remove the ":LspDiagHighlightEnable" and the
":LspDiagHighlightDisable" commands (these are replaced by the ":LspDiag
highlight" command)

10 months agoDiags are not highlighted after a buffer is reloaded
Yegappan Lakshmanan [Sun, 9 Jul 2023 16:54:53 +0000 (09:54 -0700)]
Diags are not highlighted after a buffer is reloaded

11 months agoFix test failure
Yegappan Lakshmanan [Sat, 8 Jul 2023 02:46:02 +0000 (19:46 -0700)]
Fix test failure

11 months agoAdd support for enabling/disabling inlay hints
Yegappan Lakshmanan [Sat, 8 Jul 2023 02:33:58 +0000 (19:33 -0700)]
Add support for enabling/disabling inlay hints

11 months agoTest fail with older Vim versions
Yegappan Lakshmanan [Thu, 6 Jul 2023 14:54:31 +0000 (07:54 -0700)]
Test fail with older Vim versions

11 months agoError loading the plugin if OptionsSet() function is not used
Yegappan Lakshmanan [Thu, 6 Jul 2023 14:21:20 +0000 (07:21 -0700)]
Error loading the plugin if OptionsSet() function is not used

11 months agoIgnore unsupported pyright language server notifications. Fixes #355
Yegappan Lakshmanan [Tue, 4 Jul 2023 23:03:42 +0000 (16:03 -0700)]
Ignore unsupported pyright language server notifications.  Fixes #355

11 months agoAdd basic support for InsertReplaceEdit in completion reply. Fixes #354
Yegappan Lakshmanan [Tue, 4 Jul 2023 17:46:21 +0000 (10:46 -0700)]
Add basic support for InsertReplaceEdit in completion reply.  Fixes #354

11 months agoDict key access optimizations
Yegappan Lakshmanan [Tue, 4 Jul 2023 16:58:56 +0000 (09:58 -0700)]
Dict key access optimizations

11 months agoUse the current encoding for the completion popup menu. Fixes #352
Yegappan Lakshmanan [Tue, 4 Jul 2023 14:24:49 +0000 (07:24 -0700)]
Use the current encoding for the completion popup menu.  Fixes #352

11 months agoMinor optimizations
Yegappan Lakshmanan [Sat, 1 Jul 2023 04:50:31 +0000 (21:50 -0700)]
Minor optimizations

11 months agoWhen applying text edits and restoring eol, ignore empty lines. Optimize use of range...
Yegappan Lakshmanan [Sat, 1 Jul 2023 04:37:26 +0000 (21:37 -0700)]
When applying text edits and restoring eol, ignore empty lines. Optimize use of range Dict by using local variables

11 months agoDon't check the capabilities for language servers which are not ready. Update help...
Yegappan Lakshmanan [Fri, 30 Jun 2023 04:25:36 +0000 (21:25 -0700)]
Don't check the capabilities for language servers which are not ready.  Update help text

11 months agoAdd an option (showDiagWithSign) to enable/disable placing signs on lines with diagno...
Yegappan Lakshmanan [Thu, 29 Jun 2023 04:44:00 +0000 (21:44 -0700)]
Add an option (showDiagWithSign) to enable/disable placing signs on lines with diagnostics.  Add separate virtual text highlight groups for each type of diagnostic

11 months agoSelect the current symbol when opening the peek symbol popup menu. Open closed folds...
Yegappan Lakshmanan [Tue, 27 Jun 2023 04:11:48 +0000 (21:11 -0700)]
Select the current symbol when opening the peek symbol popup menu.  Open closed folds when jumping to a symbol location

11 months agoUse the FileType autocmd to start the LSP server for a buffer
Yegappan Lakshmanan [Sun, 25 Jun 2023 23:42:45 +0000 (16:42 -0700)]
Use the FileType autocmd to start the LSP server for a buffer

11 months agoWhen using multiple language servers, check for the server capabilities in more places
Yegappan Lakshmanan [Sun, 25 Jun 2023 21:03:51 +0000 (14:03 -0700)]
When using multiple language servers, check for the server capabilities in more places

11 months agoMerge pull request #347 from girishji/buffer-completion-timeout
Yegappan Lakshmanan [Sun, 25 Jun 2023 19:18:28 +0000 (12:18 -0700)]
Merge pull request #347 from girishji/buffer-completion-timeout

Make buffer completion responsive for large files

11 months agoOptimize dict lookup
Girish Palya [Sun, 25 Jun 2023 16:26:41 +0000 (18:26 +0200)]
Optimize dict lookup
Move dict lookup outside of for loop to avoid repetition.

M  autoload/lsp/completion.vim

11 months agoImproved
Girish Palya [Sun, 25 Jun 2023 13:41:17 +0000 (15:41 +0200)]
Improved

M  doc/lsp.txt

11 months agoMake buffer completion responsive for large files
Girish Palya [Sun, 25 Jun 2023 11:26:37 +0000 (13:26 +0200)]
Make buffer completion responsive for large files

Since buffer completion processes the current buffer everytime user
types something, it will degrade the experience for large files.

This change adds a timeout to buffer completor function. Processing
current buffer is cut short when timeout is exceeded. Setting
timeout to 0 will revert back to existing behaviour.

Default is set to 100 ms, good for scanning 6000 lines on M1 macbook.

It is possible to get fancy by scanning locality of cursor first
but such complication may not be worth the complexity.

Tested on >20k line files (I have to open these large C files
filled with hw specs occasionally).

M  autoload/lsp/completion.vim
M  autoload/lsp/options.vim
M  doc/lsp.txt

11 months agoMinor optimization
Yegappan Lakshmanan [Sat, 24 Jun 2023 18:27:45 +0000 (11:27 -0700)]
Minor optimization

11 months agoAdd support for displaying symbols in the current file in a popup menu
Yegappan Lakshmanan [Sat, 24 Jun 2023 18:08:01 +0000 (11:08 -0700)]
Add support for displaying symbols in the current file in a popup menu

11 months agoMove snippet related code to a separate file
Yegappan Lakshmanan [Sun, 18 Jun 2023 22:53:52 +0000 (15:53 -0700)]
Move snippet related code to a separate file

11 months agoSupport using a particular offset encoding in LSP messages
Yegappan Lakshmanan [Sun, 18 Jun 2023 15:24:27 +0000 (08:24 -0700)]
Support using a particular offset encoding in LSP messages

11 months agoSilence the messages when loading new buffers
Yegappan Lakshmanan [Sun, 18 Jun 2023 14:26:50 +0000 (07:26 -0700)]
Silence the messages when loading new buffers

11 months agoUpdate the check for the presence of a diags location list and update comments
Yegappan Lakshmanan [Sun, 18 Jun 2023 13:49:12 +0000 (06:49 -0700)]
Update the check for the presence of a diags location list and update comments

11 months agoDecode symbol location only when needed
Yegappan Lakshmanan [Sun, 18 Jun 2023 13:24:19 +0000 (06:24 -0700)]
Decode symbol location only when needed

11 months agoCursor not positioned correctly when jumping to a symbol in another file
Yegappan Lakshmanan [Sun, 18 Jun 2023 05:47:26 +0000 (22:47 -0700)]
Cursor not positioned correctly when jumping to a symbol in another file

11 months ago:LspSymbolSeach command doesn't support command modifiers. When only one symbol is...
Yegappan Lakshmanan [Sun, 18 Jun 2023 04:39:08 +0000 (21:39 -0700)]
:LspSymbolSeach command doesn't support command modifiers. When only one symbol is found, jump to it

11 months agoNot able to set language server trace level during initialization
Yegappan Lakshmanan [Sun, 18 Jun 2023 01:26:16 +0000 (18:26 -0700)]
Not able to set language server trace level during initialization

11 months agoAdd a function to get all the diagnostics in a buffer
Yegappan Lakshmanan [Sat, 17 Jun 2023 22:10:07 +0000 (15:10 -0700)]
Add a function to get all the diagnostics in a buffer

11 months agoUpdate diags location list when the diags for the buffer changes. Update comments
Yegappan Lakshmanan [Sat, 17 Jun 2023 21:42:39 +0000 (14:42 -0700)]
Update diags location list when the diags for the buffer changes. Update comments

11 months agoFix hover test failure
Yegappan Lakshmanan [Sat, 17 Jun 2023 17:56:23 +0000 (10:56 -0700)]
Fix hover test failure

11 months agoNot able to use :LspHover with 'keywordprg'
Yegappan Lakshmanan [Sat, 17 Jun 2023 17:50:20 +0000 (10:50 -0700)]
Not able to use :LspHover with 'keywordprg'

11 months agoMerge pull request #343 from Shane-XB-Qian/fix_test_conflict_failure
Yegappan Lakshmanan [Sat, 17 Jun 2023 13:21:57 +0000 (06:21 -0700)]
Merge pull request #343 from Shane-XB-Qian/fix_test_conflict_failure

fix: test conflict failure

11 months agofix: test conflict failure
shane.xb.qian [Sat, 17 Jun 2023 10:22:23 +0000 (18:22 +0800)]
fix: test conflict failure

11 months agoAdd support for UTF-8 and UTF-16 offset encoding
Yegappan Lakshmanan [Sat, 17 Jun 2023 01:55:26 +0000 (18:55 -0700)]
Add support for UTF-8 and UTF-16 offset encoding

11 months agoMerge pull request #340 from Shane-XB-Qian/fix_super_is_keyword
Yegappan Lakshmanan [Sat, 10 Jun 2023 19:24:16 +0000 (12:24 -0700)]
Merge pull request #340 from Shane-XB-Qian/fix_super_is_keyword

fix: 'super' is a keyword cannot use

11 months agofix: 'super' is a keyword cannot use
shane.xb.qian [Sat, 10 Jun 2023 18:19:35 +0000 (02:19 +0800)]
fix: 'super' is a keyword cannot use

11 months agoMerge pull request #334 from vimpostor/ale
Yegappan Lakshmanan [Fri, 9 Jun 2023 14:53:09 +0000 (07:53 -0700)]
Merge pull request #334 from vimpostor/ale

Implement Ale integration support

11 months agoMerge branch 'main' into ale
Yegappan Lakshmanan [Fri, 9 Jun 2023 14:43:08 +0000 (07:43 -0700)]
Merge branch 'main' into ale

12 months agoSome lines in the plugin help text exceed 79 characters
Yegappan Lakshmanan [Wed, 7 Jun 2023 15:36:34 +0000 (08:36 -0700)]
Some lines in the plugin help text exceed 79 characters

12 months agoMerge pull request #336 from Shane-XB-Qian/fix_util_getbufline_useless
Yegappan Lakshmanan [Tue, 6 Jun 2023 04:46:33 +0000 (21:46 -0700)]
Merge pull request #336 from Shane-XB-Qian/fix_util_getbufline_useless

fix: util.GetBufOneLine is a bit useless

12 months agoMerge pull request #335 from Shane-XB-Qian/fix_correct_test_fs_ignore
Yegappan Lakshmanan [Tue, 6 Jun 2023 04:43:04 +0000 (21:43 -0700)]
Merge pull request #335 from Shane-XB-Qian/fix_correct_test_fs_ignore

fix: correct test fs gitignore

12 months agoMerge pull request #337 from Shane-XB-Qian/fix_test_conflict_failure
Yegappan Lakshmanan [Tue, 6 Jun 2023 04:42:39 +0000 (21:42 -0700)]
Merge pull request #337 from Shane-XB-Qian/fix_test_conflict_failure

fix: test conflict failure

12 months agofix: test conflict failure
shane.xb.qian [Tue, 6 Jun 2023 04:21:57 +0000 (12:21 +0800)]
fix: test conflict failure

12 months agofix: util.GetBufOneLine is a bit useless
shane.xb.qian [Tue, 6 Jun 2023 03:59:20 +0000 (11:59 +0800)]
fix: util.GetBufOneLine is a bit useless

12 months agofix: correct test fs gitignore
shane.xb.qian [Tue, 6 Jun 2023 03:28:44 +0000 (11:28 +0800)]
fix: correct test fs gitignore

12 months agoFix test failure
Yegappan Lakshmanan [Tue, 6 Jun 2023 02:32:10 +0000 (19:32 -0700)]
Fix test failure

12 months agoFix test failures
Yegappan Lakshmanan [Tue, 6 Jun 2023 01:49:19 +0000 (18:49 -0700)]
Fix test failures

12 months agoProperly support multibyte characters with composing characters
Yegappan Lakshmanan [Mon, 5 Jun 2023 06:39:58 +0000 (23:39 -0700)]
Properly support multibyte characters with composing characters

12 months agoAdd Ale integration support
Magnus Groß [Fri, 2 Jun 2023 16:28:18 +0000 (18:28 +0200)]
Add Ale integration support

Ale [0] is a famous plugin to show linter warnings and diagnostics. It
already provides extensive functionality and configurability to display
those diagnostics.
In order to allow diagnostics from other plugins (e.g. LSP plugins) to
be shown together with those linter warnings, Ale has API so that those
diagnostics can be sent to Ale.

Ale will then display them as if they came from Ale itself. This is
useful for many reasons, e.g. this ensures a consistent look and allows
the location list for a window to be populated with all diagnostics,
regardless from which plugin they come.

There are other famous LSP plugins, that already integrate with Ale,
e.g. coc.nvim [1] allows this with "diagnostic.displayByAle".

This patch implements the same functionality by adding an "aleSupport"
option that is off by default. If the option is turned on, diagnostics
will be sent to Ale instead of being displayed by this plugin directly.

[0] https://github.com/dense-analysis/ale
[1] https://github.com/neoclide/coc.nvim

12 months agoUse getbufoneline() in GetLineByteFromPos
Magnus Groß [Fri, 2 Jun 2023 16:15:46 +0000 (18:15 +0200)]
Use getbufoneline() in GetLineByteFromPos

This makes this more robust and also decreases the indentation level.

12 months agoMerge pull request #332 from girishji/vim-vsnip-support
Yegappan Lakshmanan [Thu, 1 Jun 2023 15:29:35 +0000 (08:29 -0700)]
Merge pull request #332 from girishji/vim-vsnip-support

Add support for hrsh7th/vim-vsnip plugin

12 months agoUse string evaluation
Girish Palya [Thu, 1 Jun 2023 15:26:53 +0000 (17:26 +0200)]
Use string evaluation

M  autoload/lsp/completion.vim

12 months agoCorrection
Girish Palya [Thu, 1 Jun 2023 15:18:05 +0000 (17:18 +0200)]
Correction

M  autoload/lsp/completion.vim

12 months agoChange to '->' method call syntax
Girish Palya [Thu, 1 Jun 2023 15:12:14 +0000 (17:12 +0200)]
Change to '->' method call syntax

M  autoload/lsp/completion.vim

12 months agoMerge pull request #333 from girishji/buffer-compl
Yegappan Lakshmanan [Thu, 1 Jun 2023 14:34:33 +0000 (07:34 -0700)]
Merge pull request #333 from girishji/buffer-compl

Fix bug where buffer completion spams

12 months agoFix bug where buffer completion spams
Girish Palya [Thu, 1 Jun 2023 14:13:57 +0000 (16:13 +0200)]
Fix bug where buffer completion spams
Steps to reproduce:
- Enable buffer completion
- Search for 'xyz' where 'xy' has completions
- Backspace to remove 'z'
- You'll see all items from current buffer shown that are not related
  to 'xy'

M  autoload/lsp/completion.vim

12 months agoEnchance documentation
Girish Palya [Thu, 1 Jun 2023 09:53:42 +0000 (11:53 +0200)]
Enchance documentation

M  doc/lsp.txt

12 months agoEnhance documentation
Girish Palya [Thu, 1 Jun 2023 09:26:57 +0000 (11:26 +0200)]
Enhance documentation

M  doc/lsp.txt

12 months agoFix merge issue
Girish Palya [Thu, 1 Jun 2023 09:18:20 +0000 (11:18 +0200)]
Fix merge issue

M  autoload/lsp/completion.vim

12 months agoAdd support for hrsh7th/vim-vsnip snippets
Girish Palya [Thu, 1 Jun 2023 09:04:43 +0000 (11:04 +0200)]
Add support for hrsh7th/vim-vsnip snippets

Summary:

- Query vim-vsnip plugin for snippet completions and add the items
  to the completion list.
- Add a boolean flag to set vsnip completion option
- Update documentation
- Without this enhancement vsnip could only expand LSP provided
  snippets
- Inteface to vim-vsnip plugin is based on hrsh7th/cmp-vsnip

Following plugins need to be installed:

[required] hrsh7th/vim-vsnip
[required] hrsh7th/vim-vsnip-integ
[optional] rafamadriz/friendly-snippets

Options should be set as follows:

completionTextEdit: false,
snippetSupport: true,
vsnipSupport: true,
ultisnipsSupport: false,

Shortcoming:

Completion is not triggered for non-keyword characters like '#' (ex. #
before #if in C) even though vsnip is capable of such completion,
unless LSP server sets special characters as trigger characters. This
is not a major shortcoming since it will expand once a keyword
character is typed (say, #i in #if). To address this issue some code
reorganization is needed, and perhaps separation of completion
mechanism from the LSP client core.

User can define keymaps for Tab completion as follows:
(<Space> will expand the snippet)

def! g:LspCleverTab(): string
    return pumvisible() ? "\<c-n>" : vsnip#jumpable(1) ?
\ "\<Plug>(vsnip-jump-next)" : g:WhitespaceOnly() ?
\ "\<tab>" : "\<c-n>"
enddef
def! g:LspCleverSTab(): string
    return pumvisible() ? "\<c-p>" : vsnip#jumpable(-1) ?
\ "\<Plug>(vsnip-jump-prev)" : g:WhitespaceOnly() ?
\ "\<s-tab>" : "\<c-p>"
enddef
autocmd FileType java,c,cpp,python
            \| iunmap <silent> <tab>
            \| iunmap <silent> <s-tab>
            \| inoremap <expr> <tab> g:LspCleverTab()
            \| snoremap <expr> <tab> g:LspCleverTab()
            \| inoremap <expr> <S-Tab> g:LspCleverSTab()
            \| snoremap <expr> <S-Tab> g:LspCleverSTab()

M  autoload/lsp/completion.vim
M  autoload/lsp/options.vim
M  doc/lsp.txt

12 months agoFix test failure
Yegappan Lakshmanan [Thu, 1 Jun 2023 05:18:28 +0000 (22:18 -0700)]
Fix test failure

12 months agogetbufoneline() is supported only starting from Vim 9.0.0916
Yegappan Lakshmanan [Thu, 1 Jun 2023 05:03:45 +0000 (22:03 -0700)]
getbufoneline() is supported only starting from Vim 9.0.0916

12 months agoMerge pull request #331 from vimpostor/completepopup
Yegappan Lakshmanan [Thu, 1 Jun 2023 02:30:46 +0000 (19:30 -0700)]
Merge pull request #331 from vimpostor/completepopup

Fix completepopup colors