Skip to content

Fix code action alignment - #855

Open
jclsn wants to merge 1 commit into
yegappan:mainfrom
jclsn:fix/code-action-alignment
Open

jclsn wants to merge 1 commit into
yegappan:mainfrom
jclsn:fix/code-action-alignment

Conversation

@jclsn

@jclsn jclsn commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

📌 Summary

Actions without a kind still need the separator to keep the server column aligned with the actions that have one. The previous implementation in #802 left it out, so the server tag of a kind-less action started one column too early.


🔍 Related Issues


🧪 What This PR Improves

When a menu mixes actions with and without a kind, the rows without one are missing the space between the kind column and the server tag, while the padding still reserves the kind column. The server column ends up misaligned by one character:

With this change all server tags start in the same column. Rows that have a kind are rendered exactly as before.


🛠️ Changes Made

  • Add the separator before the server tag whenever the menu has a kind column (longest.kind > 0), not only when the action itself has a kind.
  • New test case with an action without a kind next to a [quickfix] action and server names of different widths

🧪 Testing

  • Test_CodeActionMenuMetadata passes with the fix, including all existing layouts (short, kind, full-kind, server, kind-and-server, full-kind-and-server).

📦 Breaking Changes

Does this PR introduce any breaking changes?

  • Yes
  • No

📚 Documentation

Does this PR require documentation updates?

  • Yes
  • No

✔️ Checklist

  • I have tested this with a minimal Vim9script configuratio
  • I have run the plugin against the relevant LSP server(s).
  • I have updated documentation if needed.
  • I have followed the project's coding style and conventions.
  • I have added tests or examples where appropriate.

Actions without a kind still need the separator to keep the server
column aligned with the actions that have one.
@jclsn

jclsn commented Oct 19, 2026

Copy link
Copy Markdown
Contributor Author

I don't understand why the unit test is failing.

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.

1 participant