Skip to content

Commit

Permalink
Format the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Shougo committed Jun 28, 2023
1 parent 0fc77f8 commit be1bce2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 15 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ddc-source-nvim-lsp

nvim-lsp completion for ddc.vim
"nvim-lsp" completion for ddc.vim

## Required

Expand All @@ -21,12 +21,17 @@ call ddc#custom#patch_global('sources', ['nvim-lsp'])
call ddc#custom#patch_global('sourceOptions', #{
\ nvim-lsp: #{
\ mark: 'lsp',
\ forceCompletionPattern: '\.\w*|:\w*|->\w*' },
\ forceCompletionPattern: '\.\w*|:\w*|->\w*'
\ },
\ })
" Use Customized labels
call ddc#custom#patch_global('sourceParams', #{
\ nvim-lsp: #{ kindLabels: #{ Class: 'c' } },
\ nvim-lsp: #{
\ kindLabels: #{
\ Class: 'c',
\ },
\ },
\ })
```

Expand Down
28 changes: 16 additions & 12 deletions doc/ddc-source-nvim-lsp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,21 @@ Please install both "ddc.vim" and "denops.vim".
https://github.com/Shougo/ddc.vim
https://github.com/vim-denops/denops.vim

We recommend using "pum.vim" and "ddc-ui-pum".
You must use neovim with "nvim-lsp" configuration.

We recommend using "pum.vim" and "ddc-ui-pum" to enable some features.

https://github.com/Shougo/pum.vim
https://github.com/Shougo/ddc-ui-pum

You will also need a snippet plugin that can expand snippets in LSP format.
You also need a snippet plugin if you want to expand snippets in LSP
format.
e.g.
https://github.com/hrsh7th/vim-vsnip
https://github.com/SirVer/ultisnips
https://github.com/L3MON4D3/LuaSnip
https://github.com/dcampos/nvim-snippy

You must use neovim with nvim-lsp configuration.

If you want to read the documentation for items, please use
"denops-popup-preview.vim".

Expand All @@ -51,7 +52,8 @@ EXAMPLES *ddc-source-nvim-lsp-examples*

To take advantage of all the features, you need to set client_capabilities.
>lua
local capabilities = require("ddc_nvim_lsp").make_client_capabilities()
local capabilities = require(
"ddc_nvim_lsp").make_client_capabilities()
require("lspconfig").denols.setup({
capabilities = capabilities,
})
Expand All @@ -62,15 +64,16 @@ To take advantage of all the features, you need to set client_capabilities.
call ddc#custom#patch_global('sourceOptions', #{
\ nvim-lsp: #{
\ mark: 'lsp',
\ forceCompletionPattern: '\.\w*|:\w*|->\w*' },
\ })
\ forceCompletionPattern: '\.\w*|:\w*|->\w*',
\ },
\ })

" Register snippet engine (vim-vsnip)
call ddc#custom#patch_global('sourceParams', #{
\ nvim-lsp: #{
\ snippetEngine: denops#callback#register({
\ body -> vsnip#anonymous(body) }),
\ body -> vsnip#anonymous(body)
\ }),
\ }
\ })
<
Expand All @@ -84,7 +87,7 @@ snippetEngine (string)
another plugin to expand it. Register with
denops#callback#register and specify its id in this param.

NOTE: If not registered, snippet items will be filtered.
NOTE: If it is not registered, snippet items will be filtered.
>vim
" https://github.com/hrsh7th/vim-vsnip
denops#callback#register({ body -> vsnip#anonymous(body) })
Expand All @@ -105,7 +108,7 @@ snippetEngine (string)

*ddc-source-nvim-lsp-param-enableResolveItem*
enableResolveItem (boolean)
Enable completionItem/resolve
Enable LSP's "completionItem/resolve" feature.

NOTE: "pum.vim" and "ddc-ui-pum" are required.
https://github.com/Shougo/pum.vim
Expand All @@ -115,12 +118,13 @@ enableResolveItem (boolean)

*ddc-source-nvim-lsp-param-enableAdditionalTextEdit*
enableAdditionalTextEdit (boolean)
Enables supplementary editing apart from the cursor. For
Enable supplementary editing apart from the cursor. For
instance, it allows the auto-import of the
typescript-language-server, as well as macro-expansion via
rust-analyzer.
To use this feature,
|ddc-source-nvim-lsp-param-enableResolveItem| must be v:true.
|ddc-source-nvim-lsp-param-enableResolveItem| must be
|v:true|.

Default: v:false

Expand Down

0 comments on commit be1bce2

Please sign in to comment.