Skip to content

refactor(cmdline): improve option completion #1924

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

Merged
merged 1 commit into from
Jun 17, 2025
Merged

Conversation

soifou
Copy link
Collaborator

@soifou soifou commented Jun 17, 2025

  • Option info is now cached on first lookup instead of fetched every time.
  • Shortname is shown in the label description for options.
  • Fixed accepting option references (like echo &shiftwidth) in completions.

@soifou soifou force-pushed the refactor/cmdline-option branch 2 times, most recently from bc65ba6 to ab8f62a Compare June 17, 2025 17:32
Copy link
Owner

@Saghen Saghen left a comment

Choose a reason for hiding this comment

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

LGTM

@soifou
Copy link
Collaborator Author

soifou commented Jun 17, 2025

I don't like this condition but only all fail while retrieving the provided options. And I'm not fund either by using pcall to guard against eventually an unhandled case... thought?

@Saghen
Copy link
Owner

Saghen commented Jun 17, 2025

I'm not opposed to the guard, but would be good to document why that's the case

@soifou
Copy link
Collaborator Author

soifou commented Jun 17, 2025

Ok I'll add a note.

Also did a quick bench between vim.opt[name].get() and vim.api.nvim_get_option_info2 and the tradeoff is negligeable.

- Option info is now cached on first lookup instead of fetched every time.
- Shortname is shown in the label description for options.
- Fixed accepting option references (like `echo &shiftwidth`) in completions.
@soifou soifou force-pushed the refactor/cmdline-option branch from ab8f62a to 9c3078f Compare June 17, 2025 17:56
@soifou soifou merged commit 5976d08 into main Jun 17, 2025
6 checks passed
@soifou soifou deleted the refactor/cmdline-option branch June 17, 2025 18:07
@soifou
Copy link
Collaborator Author

soifou commented Jun 17, 2025

Merged, thanks for the quick review!

@soifou
Copy link
Collaborator Author

soifou commented Jun 17, 2025

Side note: I just realized that the refactor commits do not appear in the changelog. Is this intentional? If so, I'll keep it in mind.

@Saghen
Copy link
Owner

Saghen commented Jun 17, 2025

Ah yeah, that's a side effect of using the conventional changelog. I ought to document (or automate really) how I do releases but basically I do:

NEW_VERSION=v1.4.1
git tag $NEW_VERSION -s -m $NEW_VERSION

nix-shell -p nodePackages_latest.conventional-changelog-cli # could grab via npx/bunx instead
conventional-changelog -o CHANGELOG.md --release-count 0 -p conventionalcommits

# Open the CHANGELOG.md and grab the latest release, discard the changes in git and paste the new release
# Update flake.nix

git tag -d $NEW_VERSION
git commit -m "chore: bump version to $NEW_VERSION"
git tag $NEW_VERSION -s -m $NEW_VERSION

# Update docs website
cd doc
npm run build:releas
bunx wrangler pages deploy .vitepress/dist --project-name=blink-cmp --branch=main

# Wait for CI to finish and copy from CHANGELOG.md to release notes

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.

2 participants