https://github.com/Shougo/ddc-source-lsp
lsp source for ddc.vim
https://github.com/Shougo/ddc-source-lsp
ddc-source ddc-vim
Last synced: 4 months ago
JSON representation
lsp source for ddc.vim
- Host: GitHub
- URL: https://github.com/Shougo/ddc-source-lsp
- Owner: Shougo
- License: other
- Created: 2021-08-06T10:51:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-15T05:14:05.000Z (10 months ago)
- Last Synced: 2024-05-02T00:30:46.148Z (10 months ago)
- Topics: ddc-source, ddc-vim
- Language: TypeScript
- Homepage:
- Size: 224 KB
- Stars: 64
- Watchers: 6
- Forks: 18
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ddc-source-lsp
lsp completion for ddc.vim
## Required
### denops.vim
https://github.com/vim-denops/denops.vim
### ddc.vim
https://github.com/Shougo/ddc.vim
### LSP client
Supported LSP clients are "nvim-lsp", "vim-lsp" and "lspoints"
https://github.com/prabirshrestha/vim-lsp
https://github.com/kuuote/lspoints
## Configuration
To take advantage of all the features, you need to set client_capabilities.
```lua
local capabilities = require("ddc_source_lsp").make_client_capabilities()
require("lspconfig").denols.setup({
capabilities = capabilities,
})
``````vim
call ddc#custom#patch_global('sources', ['lsp'])
call ddc#custom#patch_global('sourceOptions', #{
\ lsp: #{
\ mark: 'lsp',
\ forceCompletionPattern: '\.\w*|:\w*|->\w*',
\ },
\ })call ddc#custom#patch_global('sourceParams', #{
\ lsp: #{
\ snippetEngine: denops#callback#register({
\ body -> vsnip#anonymous(body)
\ }),
\ enableResolveItem: v:true,
\ enableAdditionalTextEdit: v:true,
\ }
\ })
```## Original code
It based on [cmp-core-example](https://github.com/hrsh7th/cmp-core-example).