Skip to content

Conversation

lambdalisue
Copy link
Member

@lambdalisue lambdalisue commented Aug 24, 2025

Summary

  • Remove the deprecated helper/expr_string module and all its exports (ExprString, exprQuote, isExprString, useExprString)
  • Update dependent files to remove usage of deprecated APIs
  • Clean up test files and configuration

Background

The expr_string module was deprecated in favor of the eval module's rawString functionality. This PR completes the deprecation by removing all deprecated code.

Changes Made

  • Removed files:

    • helper/expr_string.ts (285 lines)
    • helper/expr_string_test.ts (493 lines)
  • Updated files:

    • helper/keymap.ts: Removed ExprString type support, now only supports string | RawString
    • helper/keymap_test.ts: Removed test cases using exprQuote
    • eval/stringify.ts: Removed isExprString checks
    • eval/stringify_test.ts: Removed test cases for ExprString serialization
    • helper/mod.ts: Removed export of expr_string module
    • deno.jsonc: Removed export entries for expr_string paths

Test Plan

  • Verify all existing tests pass after removal
  • Confirm no remaining references to deprecated APIs exist in codebase
  • Test that keymap functionality still works with string and RawString types
  • Validate stringify functionality works without ExprString support

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Breaking Changes
    • Removed the expression-string helper from the public API.
    • Stringification no longer treats expression-strings specially; all strings now serialize as Vim literal strings.
    • Key mapping inputs no longer accept expression-string values; use plain string or RawString instead.

Copy link

coderabbitai bot commented Aug 24, 2025

Walkthrough

Removed the ExprString feature and its public exposure: deleted helper/expr_string.ts and its tests, removed related exports/imports in deno.jsonc and helper/mod.ts, and eliminated ExprString handling from eval/stringify.ts and helper/keymap.ts along with corresponding tests.

Changes

Cohort / File(s) Summary of changes
Config export/import removal
deno.jsonc
Removed exports/imports mappings for ./helper/expr_string.ts ("./helper/expr_string": "./helper/expr_string.ts" and "jsr:@denops/std/helper/expr_string": "./helper/expr_string.ts").
Eval stringify adjustments
eval/stringify.ts, eval/stringify_test.ts
Removed isExprString import and branches; strings are now serialized as single-quoted Vim literal strings. Tests referencing exprQuote/ExprString were removed.
ExprString helper removal
helper/expr_string.ts, helper/expr_string_test.ts
Deleted the helper/expr_string.ts module (types and helpers: ExprString, exprQuote, isExprString, vimStringify, useExprString) and its comprehensive test file.
Keymap narrowing
helper/keymap.ts, helper/keymap_test.ts
Removed ExprString from Keys type and related runtime checks; tests using exprQuote were removed.
Helper re-exports cleanup
helper/mod.ts
Removed re-export of ./expr_string.ts.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Caller
  participant Stringify as stringify(value)
  Caller->>Stringify: value
  alt nullish / function / symbol
    Stringify-->>Caller: "v:null"/"function()"/"symbol()"
  else boolean / number
    Stringify-->>Caller: Vim literal (true/false/number)
  else string
    Note right of Stringify #ffeead: ExprString branch removed
    Stringify-->>Caller: Single-quoted Vim string (escape single-quotes)
  else array
    Stringify-->>Caller: [ ... ] serialized
  else object / toJSON
    Stringify-->>Caller: { ... } serialized
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • Shougo

Poem

I nibble through exports, neat and spry,
Expr-strings tucked, I twitch my eye.
Quotes aligned and keymaps lean,
Fewer paths where bugs convene.
A little hop — the code feels light. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ce12f2e and 48ab793.

📒 Files selected for processing (8)
  • deno.jsonc (0 hunks)
  • eval/stringify.ts (0 hunks)
  • eval/stringify_test.ts (0 hunks)
  • helper/expr_string.ts (0 hunks)
  • helper/expr_string_test.ts (0 hunks)
  • helper/keymap.ts (2 hunks)
  • helper/keymap_test.ts (0 hunks)
  • helper/mod.ts (0 hunks)
💤 Files with no reviewable changes (7)
  • deno.jsonc
  • eval/stringify_test.ts
  • helper/mod.ts
  • helper/keymap_test.ts
  • eval/stringify.ts
  • helper/expr_string.ts
  • helper/expr_string_test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • helper/keymap.ts
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch remove-deprecated-expr-string

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
helper/keymap.ts (1)

55-56: Typo in user-facing docs: “remaped” → “remapped”.

Minor, but visible in published docs/examples.

- *       // Send remaped keys.
+ *       // Send remapped keys.
🧹 Nitpick comments (1)
helper/keymap.ts (1)

22-26: Normalize remap when a Keys object is supplied (JS callers safety).

Today's code returns the object as-is. If a JS caller passes { keys: "...", remap: undefined }, it will behave as false at runtime, but normalizing makes the intent explicit and future-proof.

Apply this diff:

 function toKeys(keys: KeysSpecifier): Keys {
   if (isString(keys) || isRawString(keys)) {
     return { keys, remap: false };
   }
-  return keys;
+  // Normalize to ensure `remap` is a strict boolean for untyped JS callers
+  return { keys: keys.keys, remap: !!keys.remap };
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between d87b762 and ce12f2e.

📒 Files selected for processing (8)
  • deno.jsonc (0 hunks)
  • eval/stringify.ts (0 hunks)
  • eval/stringify_test.ts (0 hunks)
  • helper/expr_string.ts (0 hunks)
  • helper/expr_string_test.ts (0 hunks)
  • helper/keymap.ts (2 hunks)
  • helper/keymap_test.ts (0 hunks)
  • helper/mod.ts (0 hunks)
💤 Files with no reviewable changes (7)
  • helper/keymap_test.ts
  • deno.jsonc
  • helper/mod.ts
  • eval/stringify.ts
  • helper/expr_string_test.ts
  • eval/stringify_test.ts
  • helper/expr_string.ts
🧰 Additional context used
🧬 Code graph analysis (1)
helper/keymap.ts (1)
eval/string.ts (2)
  • RawString (38-38)
  • isRawString (126-132)
🔇 Additional comments (2)
helper/keymap.ts (2)

11-11: Dropped ExprString from public Keys type — aligned with the deprecation removal.

Type surface now matches the project direction (string | RawString only). Good cleanup.


10-13: Confirm and document breaking change for Keys export

I ran the provided rg search across the codebase and found no remaining internal references to ExprString, exprQuote, isExprString, useExprString, or the helper/expr_string module.

However, since you’ve narrowed a public export (Keys now only accepts string | RawString), this is a breaking change. Please:

  • Verify external impact: Confirm that no downstream or external consumers still pass ExprString (or use exprQuote) to any helper/keymap APIs.
  • Changelog & version bump: Document this change in your changelog/release notes and bump the package version accordingly.
  • Migration guidance: Add a short migration note, e.g.:

    Replace ExprString/exprQuote with RawString when calling helper/keymap APIs.

@lambdalisue lambdalisue mentioned this pull request Aug 24, 2025
17 tasks
Copy link

codecov bot commented Aug 24, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.83%. Comparing base (ac2df57) to head (48ab793).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #287      +/-   ##
==========================================
- Coverage   85.84%   85.83%   -0.02%     
==========================================
  Files          65       64       -1     
  Lines        3468     3296     -172     
  Branches      302      277      -25     
==========================================
- Hits         2977     2829     -148     
+ Misses        489      465      -24     
  Partials        2        2              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

The expr_string module and its associated types (ExprString, exprQuote,
isExprString, useExprString) have been deprecated in favor of the eval
module's rawString functionality. This commit removes all deprecated code
and updates dependent files to use the new API.

Changes:
- Remove helper/expr_string.ts and helper/expr_string_test.ts
- Update helper/keymap.ts to remove ExprString type support
- Update eval/stringify.ts to remove isExprString checks
- Remove related test cases from affected test files
- Remove exports from helper/mod.ts and deno.jsonc

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@lambdalisue lambdalisue force-pushed the remove-deprecated-expr-string branch from 6089d9a to 48ab793 Compare August 24, 2025 08:47
@lambdalisue lambdalisue merged commit 97ebc4d into main Aug 24, 2025
10 checks passed
@lambdalisue lambdalisue deleted the remove-deprecated-expr-string branch August 24, 2025 09:47
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