yegappan / lsp

Language Server Protocol (LSP) plugin for Vim9
MIT License
458 stars 49 forks source link

bug: 'Lazy doc' completion broken for omnifunc #475

Closed girishji closed 5 months ago

girishji commented 5 months ago

pylsp was not displaying documentation from lsp server. this fixes the problem. user does not have to enable omnicomplete for each file type when main option omniComplete is already enabled.

M autoload/lsp/completion.vim

girishji commented 5 months ago

Thanks!

girishji commented 5 months ago

You can refactor any way you want as long as we have these when opt.lspOptions.omniComplete==true

  if lspserver.completionLazyDoc
    # resolve additional documentation for a selected item
    acmds->add({bufnr: bnr,
                event: 'CompleteChanged',
                group: 'LSPBufferAutocmds',
                cmd: 'LspResolve()'})
  endif

  acmds->add({bufnr: bnr,
          event: 'CompleteChanged',
          group: 'LSPBufferAutocmds',
          cmd: 'LspSetPopupFileType()'})

  # Execute LSP server initiated text edits after completion
  acmds->add({bufnr: bnr,
          event: 'CompleteDone',
          group: 'LSPBufferAutocmds',
          cmd: $'LspCompleteDone({bnr})'})
Shane-XB-Qian commented 5 months ago

You can refactor any way you want as long as we have these when opt.lspOptions.omniComplete==true

i am not interesting, if you can confirm there no outage to set those completion settings when it should return, then please just re-word that comment, otherwise please try to fix your issue by "another" way.

Shane-XB-Qian commented 5 months ago

https://github.com/yegappan/lsp/pull/426#discussion_r1432741825 https://github.com/yegappan/lsp/pull/428#issuecomment-1868244111

BTW: i still remember last time you modified that kind.

girishji commented 5 months ago

#426 (comment) #428 (comment)

BTW: i still remember last time you modified that kind.

kind was the correct modification. If LSP server sends you an unexpected response, LSP client should deal with it gracefully. This is not open to debate.

Shane-XB-Qian commented 5 months ago

kind was the correct modification. If LSP server sends you an unexpected response, LSP client should deal with it gracefully. This is not open to debate.

there is a spec, and the kind value is 1~25 only, client no duty to handle all broken from some server. wish you were reducing the possibilities of adding odd or wrong code here.