Skip to content

[idea] LSP code-action availability indicator ("lightbulb") in the sign column #314

Description

@stanfish06

What

lua/config/lsp.lua binds <leader>la to vim.lsp.buf.code_action, but there is no visual cue anywhere in the config that a code action is actually available at the cursor — the only way to find out is to invoke it speculatively and see if a menu appears (or nothing happens).

Where

  • lua/config/lsp.lua<leader>la keymap for vim.lsp.buf.code_action, no availability signal
  • lua/config/options.luavim.opt.signcolumn = "yes" already reserves a sign column that could host the indicator

Why it matters

This is distinct from the existing "LSP code lens toggle" idea (codeLens and codeAction are different LSP capabilities/requests) and distinct from tiny-inline-diagnostic.nvim (which surfaces diagnostics, not actions). Right now code actions are entirely undiscoverable without guessing.

Recommended action

Add a CursorHold/CursorHoldI autocmd that fires a silent textDocument/codeAction request; if the response is non-empty, set an extmark/sign in the already-reserved sign column (clearing it on cursor move or when the response is empty). This is a small, self-contained addition — no new plugin needed, just an autocmd plus the existing LSP client already wired up in lsp.lua.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions