Skip to content

Commit

Permalink
refactor!: rename project to blink-ripgrep.nvim
Browse files Browse the repository at this point in the history
Issue
=====

It's confusing that this project has the same name as the original
project. This causes confusion and is not in anyone's best interest.

Solution
========

Rename the project to `blink-ripgrep.nvim`.
  • Loading branch information
mikavilpas committed Nov 5, 2024
1 parent 8e916fe commit 94ab08a
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# blink-cmp-rg.nvim
# blink-ripgrep.nvim

Ripgrep source for [blink.cmp](https://github.com/Saghen/blink.cmp).

Expand All @@ -9,7 +9,7 @@ Forked here (mikavilpas/blink.cmp) for my own use from
-- NOTE: you can skip the type annotations if you don't want to use them
--
---@module "lazy"
---@module "blink-cmp-rg"
---@module "blink-ripgrep"
---@type LazySpec
require("blink.cmp").setup({
sources = {
Expand All @@ -19,10 +19,10 @@ require("blink.cmp").setup({
providers = {
-- other sources
ripgrep = {
module = "blink-cmp-rg",
module = "blink-ripgrep",
name = "Ripgrep",
-- options below are optional, these are the default values
---@type blink-cmp-rg.Options
---@type blink-ripgrep.Options
opts = {
-- blink.cmp get prefix in a different way,
-- thus use `prefix_min_len` instead of `min_keyword_length`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---@diagnostic disable: lowercase-global
rockspec_format = "3.0"
package = "blink-cmp-rg.nvim"
package = "blink-ripgrep.nvim"
version = "scm-1"
source = {
url = "git+https://github.com/mikavilpas/blink-cmp-rg.nvim",
url = "git+https://github.com/mikavilpas/blink-ripgrep.nvim",
}
dependencies = {
-- Add runtime dependencies here
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/cypress/e2e/cmp-rg/health_spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ describe("the healthcheck", () => {
// wait until text on the start screen is visible
cy.contains("If you see this text, Neovim is ready!")

cy.typeIntoTerminal(":checkhealth blink-cmp-rg{enter}")
cy.contains("OK blink-cmp-rg")
cy.typeIntoTerminal(":checkhealth blink-ripgrep{enter}")
cy.contains("OK blink-ripgrep")
cy.contains("WARN").should("not.exist")
})
})
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blink-cmp-rg.nvim/integration-tests",
"name": "@blink-ripgrep.nvim/integration-tests",
"version": "0.0.0",
"private": true,
"type": "module",
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/test-environment/test-setup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
-- integration tests. It should be executed before running the tests.

---@module "lazy"
---@module "blink-cmp-rg"
---@module "blink-ripgrep"
---@module "catppuccin"

-- DO NOT change the paths and don't remove the colorscheme
Expand Down Expand Up @@ -58,9 +58,9 @@ local plugins = {
},
providers = {
ripgrep = {
module = "blink-cmp-rg",
module = "blink-ripgrep",
name = "Ripgrep",
---@type blink-cmp-rg.Options
---@type blink-ripgrep.Options
opts = {
--
},
Expand All @@ -81,7 +81,7 @@ local plugins = {
},
},
{
"https://github.com/niuiic/blink-cmp-rg.nvim",
"mikavilpas/blink-ripgrep.nvim",
-- for tests, always use the code from this repository
dir = "../..",
},
Expand Down
4 changes: 2 additions & 2 deletions lua/blink-cmp-rg/health.lua → lua/blink-ripgrep/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
-- https://github.com/neovim/neovim/blob/b7779c514632f8c7f791c92203a96d43fffa57c6/runtime/doc/pi_health.txt#L17
return {
check = function()
vim.health.start("blink-cmp-rg")
vim.health.start("blink-ripgrep")

if vim.fn.executable("rg") ~= 1 then
vim.health.warn("rg (ripgrep) not found on PATH")
end

vim.health.ok("blink-cmp-rg")
vim.health.ok("blink-ripgrep")
end,
}
10 changes: 5 additions & 5 deletions lua/blink-cmp-rg/init.lua → lua/blink-ripgrep/init.lua
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
---@module "blink.cmp"

---@class blink-cmp-rg.Options
---@class blink-ripgrep.Options
---@field prefix_min_len? number
---@field get_command? fun(context: blink.cmp.Context, prefix: string): string[]
---@field get_prefix? fun(context: blink.cmp.Context): string

---@class blink-cmp-rg.RgSource : blink.cmp.Source
---@class blink-ripgrep.RgSource : blink.cmp.Source
---@field prefix_min_len number
---@field get_command fun(context: blink.cmp.Context, prefix: string): string[]
---@field get_prefix fun(context: blink.cmp.Context): string
---@field get_completions? fun(self: blink.cmp.Source, context: blink.cmp.Context, callback: fun(response: blink.cmp.CompletionResponse | nil)): nil
local RgSource = {}

---@param opts blink-cmp-rg.Options
---@param opts blink-ripgrep.Options
function RgSource.new(opts)
opts = opts or {}

Expand Down Expand Up @@ -56,7 +56,7 @@ function RgSource:get_completions(context, resolve)
local lines = vim.split(result.stdout, "\n")
local cwd = vim.uv.cwd() or ""

local parsed = require("blink-cmp-rg.ripgrep_parser").parse(lines, cwd)
local parsed = require("blink-ripgrep.ripgrep_parser").parse(lines, cwd)

---@type table<string, blink.cmp.CompletionItem>
local items = {}
Expand All @@ -65,7 +65,7 @@ function RgSource:get_completions(context, resolve)
---@diagnostic disable-next-line: missing-fields
items[match.match.text] = {
documentation = table.concat(file.lines, "\n"),
source_id = "blink-cmp-rg",
source_id = "blink-ripgrep",
label = match.match.text .. " (rg)",
insertText = match.match.text,
}
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@blink-cmp-rg/monorepo",
"name": "@blink-ripgrep/monorepo",
"version": "1.0.0",
"private": true,
"license": "MIT",
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
local ripgrep_parser = require("blink-cmp-rg.ripgrep_parser")
local ripgrep_parser = require("blink-ripgrep.ripgrep_parser")
local assert = require("luassert")

describe("ripgrep_parser", function()
local ripgrep_output_lines =
vim.fn.readfile("spec/blink-cmp-rg/rg-output.jsonl")
vim.fn.readfile("spec/blink-ripgrep/rg-output.jsonl")

it("can parse according to the expected schema", function()
local result = ripgrep_parser.parse(ripgrep_output_lines, "/home/user")
Expand Down

0 comments on commit 94ab08a

Please sign in to comment.