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

[Feature Request] Trigger autocompletion for every character #1335

Open
igorlfs opened this issue Sep 13, 2024 · 1 comment
Open

[Feature Request] Trigger autocompletion for every character #1335

igorlfs opened this issue Sep 13, 2024 · 1 comment

Comments

@igorlfs
Copy link

igorlfs commented Sep 13, 2024

Problem Statement

Hello! I'm trying to incorporate nvim-dap's built-in autocompletion into my workflow. The documentation states that

Completion will then trigger automatically on any of the completion trigger
characters reported by the debug adapter, or on `.` if none are reported.

Using the debugpy adapter, it seems to fall back to trigger completion on ..
But IMO, a more natural approach would be to use every character instead.

Possible Solutions

An option to control the fallback characters for completion, which would allow using every character.

Considered Alternatives

There's a nvim-cmp source for dap, which I was trying to migrate from.

@mfussenegger
Copy link
Owner

A workaround could be to edit the completionTriggerCharacters of the session's capabilities.

E.g.:

  local dap = require("dap")
  dap.listeners.after.event_initialized["compl-triggers"] = function(session)
    local capabilities = session.capabilities
    if capabilities then
      capabilities.completionTriggerCharacters = {"a", "e", "i", "o", "u", "."}
    end
  end

Or you could setup your own completion trigger similar to :help compl-autocomplete

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

No branches or pull requests

2 participants