Skip to content

Conversation

blyoa
Copy link
Contributor

@blyoa blyoa commented Sep 28, 2025

After commit 504bc8e, nvim_buf_set_extmark has been used for decoration as the successor to nvim_buf_add_highlight, but some comments were not updated accordingly.

This Pull Request synchronizes the comments with the implementation.

Summary by CodeRabbit

  • Documentation
    • Updated inline docs to align with the current Neovim buffer decoration API, clarifying how decorations are applied and removed.
    • Improves accuracy and reduces confusion when reading editor-related documentation.
    • No functional changes; existing behavior and workflows remain the same.
    • No action required from users; this is a documentation-only refresh for clarity and future maintainability.

Copy link

coderabbitai bot commented Sep 28, 2025

Walkthrough

Updated documentation comments in buffer/decoration.ts to reference Neovim’s nvim_buf_set_extmark and nvim_buf_clear_namespace APIs instead of nvim_buf_add_highlight. No functional code or API surface changes. (<=50 words)

Changes

Cohort / File(s) Summary
Docs: Neovim API comment updates
buffer/decoration.ts
Updated documentation comments: decorate now references nvim_buf_set_extmark; undecorate now references nvim_buf_clear_namespace. No code or logic changes.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

I twitch my whiskers, jot a note—
Extmarks sail my carrot boat.
Comments changed, the code stays true,
Clearer APIs in view.
Thump! Approved—now off I hop. 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly describes the main intent of the changeset—bringing code comments into alignment with the implementation—and directly reflects the update of documentation references in the decorate and undecorate functions.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2328ee8 and e9ff669.

📒 Files selected for processing (1)
  • buffer/decoration.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • buffer/decoration.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d8a57f0 and 2328ee8.

📒 Files selected for processing (1)
  • buffer/decoration.ts (2 hunks)

Comment on lines 125 to 126
* It uses `prop_add` in Vim and `nvim_buf_set_extmark` in Neovim to decorate the
* buffer.
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the undecorate comment to match the implementation.

undecorate calls vimFn.prop_remove and nvimFn.nvim_buf_clear_namespace, not prop_add/nvim_buf_set_extmark, so the updated comment is still inaccurate. Please align it with the actual APIs being used.

- * It uses `prop_add` in Vim and `nvim_buf_set_extmark` in Neovim to decorate the
- * buffer.
+ * It uses `prop_remove` in Vim and `nvim_buf_clear_namespace` in Neovim to
+ * remove decorations.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
* It uses `prop_add` in Vim and `nvim_buf_set_extmark` in Neovim to decorate the
* buffer.
* It uses `prop_remove` in Vim and `nvim_buf_clear_namespace` in Neovim to
* remove decorations.
🤖 Prompt for AI Agents
In buffer/decoration.ts around lines 125 to 126, the comment for `undecorate` is
incorrect: it references `prop_add` and `nvim_buf_set_extmark` but the
implementation calls `vimFn.prop_remove` and `nvimFn.nvim_buf_clear_namespace`.
Update the comment to accurately describe that `undecorate` removes properties
via `prop_remove` in Vim and clears decorations by calling
`nvim_buf_clear_namespace` in Neovim (mentioning namespace/ids as appropriate),
so the comment matches the actual APIs used.

@blyoa blyoa force-pushed the sync-comments-with-implementation branch from 2328ee8 to e9ff669 Compare September 28, 2025 12:47
@lambdalisue
Copy link
Member

Thanks. I'll fix CI failure later so merge.

@lambdalisue lambdalisue merged commit 9d814ea into vim-denops:main Sep 28, 2025
2 of 8 checks passed
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