Skip to content

Commit b8d93e8

Browse files
feat: add stubs for blink.cmp source registration
## Details Will do the equivalent of adding the markdown source to `blink.cmp` once the `add_source_provider` API is released. Currently it is not so just print a warning to any users that attempt to use it before this release. Leave the `blink.cmp` integration instructions unchanged until (likely next) release of `blink.cmp`.
1 parent 9721ffe commit b8d93e8

File tree

9 files changed

+40
-2
lines changed

9 files changed

+40
-2
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
## Pre-release
44

5+
### Features
6+
7+
- enabled flag for link footnote [#362](https://github.com/MeanderingProgrammer/render-markdown.nvim/pull/362)
8+
[9721ffe](https://github.com/MeanderingProgrammer/render-markdown.nvim/commit/9721ffe230ec90e49c49ee33b5ca44c3fc689214)
9+
10+
### Collaborator Shoutouts
11+
12+
- @water-sucks
13+
514
## 8.1.1 (2025-03-09)
615

716
### Bug Fixes

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,8 @@ require('render-markdown').setup({
277277
clear = function() end,
278278
},
279279
completions = {
280+
-- Settings for blink.cmp completions source
281+
blink = { enabled = false },
280282
-- Settings for coq_nvim completions source
281283
coq = { enabled = false },
282284
-- Settings for in-process language server completions

doc/render-markdown.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
*render-markdown.txt* For 0.10.0 Last change: 2025 March 16
1+
*render-markdown.txt* For 0.10.0 Last change: 2025 March 18
22

33
==============================================================================
44
Table of Contents *render-markdown-table-of-contents*
@@ -342,6 +342,8 @@ Default Configuration ~
342342
clear = function() end,
343343
},
344344
completions = {
345+
-- Settings for blink.cmp completions source
346+
blink = { enabled = false },
345347
-- Settings for coq_nvim completions source
346348
coq = { enabled = false },
347349
-- Settings for in-process language server completions

lua/render-markdown/health.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ local state = require('render-markdown.state')
55
local M = {}
66

77
---@private
8-
M.version = '8.1.3'
8+
M.version = '8.1.4'
99

1010
function M.check()
1111
M.start('version')

lua/render-markdown/init.lua

+3
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ local M = {}
3030
---@field enabled? boolean
3131

3232
---@class (exact) render.md.UserCompletions
33+
---@field blink? render.md.UserCompletion
3334
---@field coq? render.md.UserCompletion
3435
---@field lsp? render.md.UserCompletion
3536

@@ -429,6 +430,8 @@ M.default_config = {
429430
clear = function() end,
430431
},
431432
completions = {
433+
-- Settings for blink.cmp completions source
434+
blink = { enabled = false },
432435
-- Settings for coq_nvim completions source
433436
coq = { enabled = false },
434437
-- Settings for in-process language server completions

lua/render-markdown/integ/blink.lua

+16
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,20 @@ function Source:get_completions(context, callback)
3838
end
3939
end
4040

41+
---@class render.md.integ.Blink
42+
---@field private registered boolean
43+
local M = {
44+
registered = false,
45+
}
46+
47+
---Should only be called from manager on initial buffer attach
48+
function Source.setup()
49+
if M.registered then
50+
return
51+
end
52+
M.registered = true
53+
-- TODO(blink.cmp): need add_source_provider to be released
54+
vim.notify('render-markdown.nvim blink.cmp source registeration requires add_source_provider', 3)
55+
end
56+
4157
return Source

lua/render-markdown/manager.lua

+2
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ function M.attach(buf)
8989
state.on.attach({ buf = buf })
9090
if state.completions.lsp.enabled then
9191
require('render-markdown.integ.lsp').setup()
92+
elseif state.completions.blink.enabled then
93+
require('render-markdown.integ.blink').setup()
9294
elseif state.completions.coq.enabled then
9395
require('render-markdown.integ.coq').setup()
9496
else

lua/render-markdown/state.lua

+3
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,9 @@ function M.validate()
343343
end)
344344
:nested('completions', function(completions)
345345
completions
346+
:nested('blink', function(coq)
347+
coq:type('enabled', 'boolean'):check()
348+
end)
346349
:nested('coq', function(coq)
347350
coq:type('enabled', 'boolean'):check()
348351
end)

lua/render-markdown/types.lua

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
---@field enabled boolean
55

66
---@class (exact) render.md.Completions
7+
---@field blink render.md.Completion
78
---@field coq render.md.Completion
89
---@field lsp render.md.Completion
910

0 commit comments

Comments
 (0)