Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
"./helper": "./helper/mod.ts",
"./helper/echo": "./helper/echo.ts",
"./helper/execute": "./helper/execute.ts",
"./helper/expr_string": "./helper/expr_string.ts",
"./helper/getbufinfo": "./helper/getbufinfo.ts",
"./helper/input": "./helper/input.ts",
"./helper/keymap": "./helper/keymap.ts",
Expand Down Expand Up @@ -81,7 +80,6 @@
"jsr:@denops/std/helper": "./helper/mod.ts",
"jsr:@denops/std/helper/echo": "./helper/echo.ts",
"jsr:@denops/std/helper/execute": "./helper/execute.ts",
"jsr:@denops/std/helper/expr_string": "./helper/expr_string.ts",
"jsr:@denops/std/helper/input": "./helper/input.ts",
"jsr:@denops/std/helper/keymap": "./helper/keymap.ts",
"jsr:@denops/std/helper/load": "./helper/load.ts",
Expand Down
7 changes: 0 additions & 7 deletions eval/stringify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import { isRecord } from "@core/unknownutil/is/record";
import { isString } from "@core/unknownutil/is/string";
import { isSymbol } from "@core/unknownutil/is/symbol";
import { isUndefined } from "@core/unknownutil/is/undefined";
import { isExprString } from "../helper/expr_string.ts";
import {
isVimEvaluatable,
type VimEvaluatable,
Expand Down Expand Up @@ -80,17 +79,11 @@ export function stringify(value: unknown): string {
if (isVimEvaluatable(value)) {
return toVimExpression(value);
}
if (isExprString(value)) {
return `"${value.replaceAll('"', '\\"')}"`;
}
if (isCustomJsonable(value)) {
value = value.toJSON(key);
if (isVimEvaluatable(value)) {
return toVimExpression(value);
}
if (isExprString(value)) {
return `"${value.replaceAll('"', '\\"')}"`;
}
}
if (isNullish(value) || isFunction(value) || isSymbol(value)) {
return "v:null";
Expand Down
12 changes: 0 additions & 12 deletions eval/stringify_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { test } from "@denops/test";
import { expr } from "./expression.ts";
import { rawString } from "./string.ts";
import { type VimEvaluatable, vimExpressionOf } from "./vim_evaluatable.ts";
import { exprQuote } from "../helper/expr_string.ts";

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

Expand Down Expand Up @@ -88,10 +87,6 @@ Deno.test("stringify()", async (t) => {
const actual = stringify(rawString`\<Cmd>call Foo("bar")\<CR>`);
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
});
await t.step("stringify ExprString to Vim's expr-string", () => {
const actual = stringify(exprQuote`\<Cmd>call Foo("bar")\<CR>`);
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
});
await t.step("stringify array to Vim's list", () => {
const actual = stringify(["foo", 42, null, undefined]);
assertEquals(actual, "['foo',42,v:null,v:null]");
Expand Down Expand Up @@ -173,13 +168,6 @@ Deno.test("stringify()", async (t) => {
const actual = stringify(x);
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
});
await t.step("stringify ExprString that returns from `toJSON`", () => {
const x = {
toJSON: () => exprQuote`\<Cmd>call Foo("bar")\<CR>`,
};
const actual = stringify(x);
assertEquals(actual, '"\\<Cmd>call Foo(\\"bar\\")\\<CR>"');
});
await t.step("stringify object that has `toJSON` method", () => {
const actual = stringify({
foo: 42,
Expand Down
285 changes: 0 additions & 285 deletions helper/expr_string.ts

This file was deleted.

Loading
Loading