From b216d4c4a40a1ece49f57d6f7dd1f1b8a48234d8 Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Sun, 23 Feb 2025 17:38:35 +0200 Subject: [PATCH 1/2] chore: bump @tui-sandbox/library to 9.5.0 --- .../cypress/support/tui-sandbox.ts | 2 +- integration-tests/package.json | 2 +- pnpm-lock.yaml | 30 +++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/integration-tests/cypress/support/tui-sandbox.ts b/integration-tests/cypress/support/tui-sandbox.ts index 596a044..37480e7 100644 --- a/integration-tests/cypress/support/tui-sandbox.ts +++ b/integration-tests/cypress/support/tui-sandbox.ts @@ -69,7 +69,7 @@ export type NeovimContext = { /** Arguments for starting the neovim server. They are built based on your test * environment in a type safe manner. */ -type MyStartNeovimServerArguments = OverrideProperties< +export type MyStartNeovimServerArguments = OverrideProperties< StartNeovimGenericArguments, { filename?: diff --git a/integration-tests/package.json b/integration-tests/package.json index c5831eb..e84eef7 100644 --- a/integration-tests/package.json +++ b/integration-tests/package.json @@ -18,7 +18,7 @@ }, "devDependencies": { "@eslint/js": "9.21.0", - "@tui-sandbox/library": "9.3.0", + "@tui-sandbox/library": "9.5.0", "@types/node": "22.13.5", "@types/tinycolor2": "1.4.6", "concurrently": "9.1.2", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1e02b12..faf59a3 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -43,8 +43,8 @@ importers: specifier: 9.21.0 version: 9.21.0 '@tui-sandbox/library': - specifier: 9.3.0 - version: 9.3.0(cypress@13.17.0)(prettier@3.5.2)(type-fest@4.35.0)(typescript@5.7.3) + specifier: 9.5.0 + version: 9.5.0(cypress@13.17.0)(prettier@3.5.2)(type-fest@4.35.0)(typescript@5.7.3) '@types/node': specifier: 22.13.5 version: 22.13.5 @@ -362,19 +362,19 @@ packages: '@tootallnate/quickjs-emscripten@0.23.0': resolution: {integrity: sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==} - '@trpc/client@11.0.0-rc.795': - resolution: {integrity: sha512-t4KCvYr/jI5pmdD0zO5cukarVLN58g1PwV5Lsm5WJyR4TZuIUqIyQZVSm7uM2abBabOSv39P8myK9nFc5yPFdg==} + '@trpc/client@11.0.0-rc.798': + resolution: {integrity: sha512-CSR7s2LTftP4V++sEw5lxREp3iopGpWM4Wo3/hlJA9VUF1jZSmndHoGGaIbuTEzhG7YB0TNaWai13mKUjh5T5Q==} peerDependencies: - '@trpc/server': 11.0.0-rc.795+394b0f5cc + '@trpc/server': 11.0.0-rc.798+5cf2f3e17 typescript: '>=5.7.2' - '@trpc/server@11.0.0-rc.795': - resolution: {integrity: sha512-rJ5TdCGN4cOb7eSf3zXbWqGMA1XZabtmBOojbNiru2ZujuHGJDmWyKzv/GI2a/j/C/VhUmVU6NRKeLFg3NVERA==} + '@trpc/server@11.0.0-rc.798': + resolution: {integrity: sha512-s1OSQNvjELQIZ6+UBqm3OcsYLPcln9T58H9QeGWtb6hgMlpULQ9f0Ui+nka695E6N/AN7VUmTAaDOFp+ioNJuQ==} peerDependencies: typescript: '>=5.7.2' - '@tui-sandbox/library@9.3.0': - resolution: {integrity: sha512-x4Rt+teXVQUq0yLKi0Z1mWCoyDaEiK2xpQbd9X+UshYBWue41SXkhLRJQaUC/y7aE6tHQ1CJudgEWcQKeEWYKQ==} + '@tui-sandbox/library@9.5.0': + resolution: {integrity: sha512-v0r+pYhv/ce2TrDkwRJn4DaHKbsPBQRp2/MVjHoS6CsAEfUOK/Ru8o2+sa1JhrSA145Q4jDGCMgyr/Aj2VscDw==} hasBin: true peerDependencies: cypress: ^13 || ^14 @@ -2687,20 +2687,20 @@ snapshots: '@tootallnate/quickjs-emscripten@0.23.0': {} - '@trpc/client@11.0.0-rc.795(@trpc/server@11.0.0-rc.795(typescript@5.7.3))(typescript@5.7.3)': + '@trpc/client@11.0.0-rc.798(@trpc/server@11.0.0-rc.798(typescript@5.7.3))(typescript@5.7.3)': dependencies: - '@trpc/server': 11.0.0-rc.795(typescript@5.7.3) + '@trpc/server': 11.0.0-rc.798(typescript@5.7.3) typescript: 5.7.3 - '@trpc/server@11.0.0-rc.795(typescript@5.7.3)': + '@trpc/server@11.0.0-rc.798(typescript@5.7.3)': dependencies: typescript: 5.7.3 - '@tui-sandbox/library@9.3.0(cypress@13.17.0)(prettier@3.5.2)(type-fest@4.35.0)(typescript@5.7.3)': + '@tui-sandbox/library@9.5.0(cypress@13.17.0)(prettier@3.5.2)(type-fest@4.35.0)(typescript@5.7.3)': dependencies: '@catppuccin/palette': 1.7.1 - '@trpc/client': 11.0.0-rc.795(@trpc/server@11.0.0-rc.795(typescript@5.7.3))(typescript@5.7.3) - '@trpc/server': 11.0.0-rc.795(typescript@5.7.3) + '@trpc/client': 11.0.0-rc.798(@trpc/server@11.0.0-rc.798(typescript@5.7.3))(typescript@5.7.3) + '@trpc/server': 11.0.0-rc.798(typescript@5.7.3) '@xterm/addon-attach': 0.11.0(@xterm/xterm@5.5.0) '@xterm/addon-fit': 0.10.0(@xterm/xterm@5.5.0) '@xterm/xterm': 5.5.0 From d0292cedcbe6e4d158db6c548144f3f23f73c0b5 Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Sun, 23 Feb 2025 17:41:43 +0200 Subject: [PATCH 2/2] perf: remove unused context size from ripgrep command The context was previously used to get the context around the search. Getting the context has since been optimized to be done lazily when the completion item is selected. Currently the rg context option is unused in the command, so this might reduce the amount of json parsing the plugin has to do. --- .../backends/ripgrep/ripgrep_command.lua | 11 +++++------ spec/blink-ripgrep/get_command_spec.lua | 4 ---- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/lua/blink-ripgrep/backends/ripgrep/ripgrep_command.lua b/lua/blink-ripgrep/backends/ripgrep/ripgrep_command.lua index a068de6..ba3ca69 100644 --- a/lua/blink-ripgrep/backends/ripgrep/ripgrep_command.lua +++ b/lua/blink-ripgrep/backends/ripgrep/ripgrep_command.lua @@ -14,7 +14,6 @@ function RipgrepCommand.get_command(prefix, options) "rg", "--no-config", "--json", - "--context=" .. options.context_size, "--word-regexp", "--max-filesize=" .. options.max_filesize, options.search_casing, @@ -54,17 +53,17 @@ function RipgrepCommand:debugify_for_shell() -- print the command to :messages for hacky debugging, but don't show it -- in the ui so that it doesn't interrupt the user's work local debug_cmd = vim.deepcopy(self.command) - assert(#debug_cmd >= 10) + assert(#debug_cmd >= 9) -- The pattern is not compatible with shell syntax, so escape it -- separately. The user should be able to copy paste it into their posix -- compatible terminal. - local pattern = debug_cmd[9] + local pattern = debug_cmd[8] assert(pattern) - debug_cmd[9] = "'" .. pattern .. "'" + debug_cmd[8] = "'" .. pattern .. "'" - assert(debug_cmd[10]) - debug_cmd[10] = vim.fn.fnameescape(debug_cmd[10]) + assert(debug_cmd[9]) + debug_cmd[9] = vim.fn.fnameescape(debug_cmd[9]) local things = table.concat(debug_cmd, " ") vim.api.nvim_exec2("echomsg " .. vim.fn.string(things), {}) diff --git a/spec/blink-ripgrep/get_command_spec.lua b/spec/blink-ripgrep/get_command_spec.lua index 71589b3..af29c10 100644 --- a/spec/blink-ripgrep/get_command_spec.lua +++ b/spec/blink-ripgrep/get_command_spec.lua @@ -24,7 +24,6 @@ describe("get_command", function() "rg", "--no-config", "--json", - "--context=5", "--word-regexp", "--max-filesize=1M", "--ignore-case", @@ -46,7 +45,6 @@ describe("get_command", function() "rg", "--no-config", "--json", - "--context=9", "--word-regexp", "--max-filesize=1M", "--ignore-case", @@ -66,7 +64,6 @@ describe("get_command", function() "rg", "--no-config", "--json", - "--context=5", "--word-regexp", "--max-filesize=2M", "--ignore-case", @@ -86,7 +83,6 @@ describe("get_command", function() "rg", "--no-config", "--json", - "--context=5", "--word-regexp", "--max-filesize=1M", "--smart-case",