Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Mar 15, 2024
Merged

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

merged 1 commit into from
Mar 15, 2024

Conversation

girishji
Copy link
Contributor

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

pylsp was not displaying documentation from lsp server.
this fixes the problem

M  autoload/lsp/completion.vim
@yegappan yegappan merged commit f5adbd1 into yegappan:main Mar 15, 2024
2 checks passed
@girishji
Copy link
Contributor Author

Thanks!

Copy link
Contributor

@Shane-XB-Qian Shane-XB-Qian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am not going to raise another PR, please try to refine it by yourself. thanks.

@@ -641,7 +641,7 @@ export def BufferInit(lspserver: dict<any>, bnr: number, ftype: string)
return
endif

if !opt.lspOptions.autoComplete && !LspOmniComplEnabled(ftype)
if !opt.lspOptions.autoComplete && !LspOmniComplEnabled(ftype) && !opt.lspOptions.omniComplete
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tho not sure your problem, but the code logic seems wrong:

  • when lspOptions.omniComplete was true,
  • but server.omnicompl was false,
  • then it should be still no omni compl there.
    a.k.a when auto compl was false too, then that judgement should be return still.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a.k.a when auto compl was false too, then that judgement should be return still. it already like its next comment said.

Comment on lines 645 to 646
# LSP auto/omni completion support is not enabled for this buffer
return
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and this comment.

@girishji
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Contributor

#426 (comment)
#428 (comment)

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

@girishji
Copy link
Contributor Author

#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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants