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

[feat] Allow disabling in certain contexts, e.g. comments #310

Open
fnune opened this issue Feb 28, 2024 · 0 comments
Open

[feat] Allow disabling in certain contexts, e.g. comments #310

fnune opened this issue Feb 28, 2024 · 0 comments

Comments

@fnune
Copy link
Contributor

fnune commented Feb 28, 2024

image

In the screenshot above, I am writing a comment on my React component. lsp_signature is showing up because I'm within a JSX element and that's a function call. This is good, but could lsp_signature offer a way to disable itself in certain contexts?

For example, nvim-cmp can be configured like so:

    cmp.setup({
      enabled = function()
        local context = require("cmp.config.context")
        local is_prompt = vim.api.nvim_buf_get_option(0, "buftype") == "prompt"
        local is_comment = context.in_treesitter_capture("comment") or context.in_syntax_group("Comment")
        return not (is_prompt or is_comment)
      end,
    })

It would be nice to have a similar API in lsp_signature.

Thank you for your wonderful plugin 🙇

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

1 participant