Skip to content

Commit 48ab793

Browse files
lambdalisueclaude
andcommitted
Remove deprecated expr_string module
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]>
1 parent ac2df57 commit 48ab793

File tree

8 files changed

+2
-818
lines changed

8 files changed

+2
-818
lines changed

deno.jsonc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"./helper": "./helper/mod.ts",
2020
"./helper/echo": "./helper/echo.ts",
2121
"./helper/execute": "./helper/execute.ts",
22-
"./helper/expr_string": "./helper/expr_string.ts",
2322
"./helper/getbufinfo": "./helper/getbufinfo.ts",
2423
"./helper/input": "./helper/input.ts",
2524
"./helper/keymap": "./helper/keymap.ts",
@@ -81,7 +80,6 @@
8180
"jsr:@denops/std/helper": "./helper/mod.ts",
8281
"jsr:@denops/std/helper/echo": "./helper/echo.ts",
8382
"jsr:@denops/std/helper/execute": "./helper/execute.ts",
84-
"jsr:@denops/std/helper/expr_string": "./helper/expr_string.ts",
8583
"jsr:@denops/std/helper/input": "./helper/input.ts",
8684
"jsr:@denops/std/helper/keymap": "./helper/keymap.ts",
8785
"jsr:@denops/std/helper/load": "./helper/load.ts",

eval/stringify.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { isRecord } from "@core/unknownutil/is/record";
1515
import { isString } from "@core/unknownutil/is/string";
1616
import { isSymbol } from "@core/unknownutil/is/symbol";
1717
import { isUndefined } from "@core/unknownutil/is/undefined";
18-
import { isExprString } from "../helper/expr_string.ts";
1918
import {
2019
isVimEvaluatable,
2120
type VimEvaluatable,
@@ -80,17 +79,11 @@ export function stringify(value: unknown): string {
8079
if (isVimEvaluatable(value)) {
8180
return toVimExpression(value);
8281
}
83-
if (isExprString(value)) {
84-
return `"${value.replaceAll('"', '\\"')}"`;
85-
}
8682
if (isCustomJsonable(value)) {
8783
value = value.toJSON(key);
8884
if (isVimEvaluatable(value)) {
8985
return toVimExpression(value);
9086
}
91-
if (isExprString(value)) {
92-
return `"${value.replaceAll('"', '\\"')}"`;
93-
}
9487
}
9588
if (isNullish(value) || isFunction(value) || isSymbol(value)) {
9689
return "v:null";

eval/stringify_test.ts

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { test } from "@denops/test";
44
import { expr } from "./expression.ts";
55
import { rawString } from "./string.ts";
66
import { type VimEvaluatable, vimExpressionOf } from "./vim_evaluatable.ts";
7-
import { exprQuote } from "../helper/expr_string.ts";
87

98
import { stringify } from "./stringify.ts";
109

@@ -88,10 +87,6 @@ Deno.test("stringify()", async (t) => {
8887
const actual = stringify(rawString`\<Cmd>call Foo("bar")\<CR>`);
8988
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
9089
});
91-
await t.step("stringify ExprString to Vim's expr-string", () => {
92-
const actual = stringify(exprQuote`\<Cmd>call Foo("bar")\<CR>`);
93-
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
94-
});
9590
await t.step("stringify array to Vim's list", () => {
9691
const actual = stringify(["foo", 42, null, undefined]);
9792
assertEquals(actual, "['foo',42,v:null,v:null]");
@@ -173,13 +168,6 @@ Deno.test("stringify()", async (t) => {
173168
const actual = stringify(x);
174169
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
175170
});
176-
await t.step("stringify ExprString that returns from `toJSON`", () => {
177-
const x = {
178-
toJSON: () => exprQuote`\<Cmd>call Foo("bar")\<CR>`,
179-
};
180-
const actual = stringify(x);
181-
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
182-
});
183171
await t.step("stringify object that has `toJSON` method", () => {
184172
const actual = stringify({
185173
foo: 42,

helper/expr_string.ts

Lines changed: 0 additions & 285 deletions
This file was deleted.

0 commit comments

Comments
 (0)