Git Product home page Git Product logo

Comments (6)

Shougo avatar Shougo commented on June 15, 2024

Minimal vimrc.

set nocompatible

set runtimepath+=~/work/denops.vim
set runtimepath+=~/work/ddc.vim
set runtimepath+=~/work/ddc-filter-matcher_head
set runtimepath+=~/work/ddc-filter-sorter_rank
set runtimepath+=~/work/ddc-ui-native
set runtimepath+=~/work/ddc-source-nvim-lsp
set runtimepath+=~/src/nvim-lspconfig

lua << EOF
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true

local lspconfig = require'lspconfig'
lspconfig.gopls.setup{capabilities = capabilities}
EOF

call ddc#custom#patch_global(
      \ 'sources', ['nvim-lsp']
      \ )
call ddc#custom#patch_global('ui', 'native')
call ddc#custom#patch_global('sourceOptions', {
      \ '_': {
      \   'matchers': ['matcher_head'],
      \   'sorters': ['sorter_rank'],
      \ },
      \ 'nvim-lsp': {
      \   'mark': 'lsp',
      \   'forceCompletionPattern': '\.\w*|:\w*|->\w*',
      \  },
      \ })

call ddc#enable()

from ddc-source-lsp.

Shougo avatar Shougo commented on June 15, 2024

Hi. I have tested it and empty items.
(I don't reproduce your error)

It is from capabilities.textDocument.completion.completionItem.snippetSupport = true.
gopls returns snippet items and it is filtered.
Because you don't set snippetEngine param.

{
  label: "fmt",
  textEdit: { range: { end: [Object], start: [Object] }, newText: "fmt" },
  filterText: "fmt",
  preselect: true,
  sortText: "00000",
  kind: 9,
  detail: '"fmt"',
  documentation: { kind: "markdown", value: "" },
  insertTextFormat: 2
},

insertTextFormat: 2 means snippet.

from ddc-source-lsp.

uga-rosa avatar uga-rosa commented on June 15, 2024

First of all, the basic premise is that a major renovation has recently taken place; please re-read the doc.

And to solve this case1, register snippetEngine (:h ddc-source-nvim-lsp-param-snippetEngine).
gopls returns all candidates as a snippet if snippet=true. So, if the snippetEngine is not registered, they will be filtered. If you don't want to use the snippet plugin, one solution is to change capabilities.

local capabilities = require('ddc_nvim_lsp').make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = false

from ddc-source-lsp.

Shougo avatar Shougo commented on June 15, 2024

error messages in :messages

I think the error message is from older commit.
It is bug and it is already fixed. So the items are filtered.

from ddc-source-lsp.

Shougo avatar Shougo commented on June 15, 2024

I have updated FAQ.

from ddc-source-lsp.

Shougo avatar Shougo commented on June 15, 2024

The issue is improved. Please update.

from ddc-source-lsp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.