nvim-html-css icon indicating copy to clipboard operation
nvim-html-css copied to clipboard

feat: support mini.completion

Open 231tr0n opened this issue 10 months ago • 12 comments

Neovim version (nvim -v)

nvim nightly

Feature Description

Hi! Is it possible to support mini.completion as the completion plugin with nvim-html-css?

Use Case / Motivation

I use the mini.nvim suite of plugins and hence use mini.completion for completion along with mini.snippets for integration which works really well for me. Is there any chance this plugin can work with mini.completion?

Alternatives

None

Additional Information

N/A

231tr0n avatar Apr 05 '25 12:04 231tr0n

I have checked the src code of mini completion and here is what i have found, as I can see there is no support for extra sources, it's basically like builtin autocomplete with ability to define custom snippets.

Jezda1337 avatar Apr 05 '25 12:04 Jezda1337

I have checked the src code of mini completion and here is what i have found, as I can see there is no support for extra sources, it's basically like builtin autocomplete with ability to define custom snippets.

It supports a fallback for omnifunc, if a omnifunc implementation can be provided by this plugin, we can make use of it to get it working.

231tr0n avatar Apr 05 '25 15:04 231tr0n

@Jezda1337 another way to do this is to create ### an in memory lsp server which can serve completions like how mini.snippets or render-markdown.nvim plugins do this.

231tr0n avatar May 27 '25 07:05 231tr0n

@Jezda1337 another way to do this is to create ### an in memory lsp server which can serve completions like how mini.snippets or render-markdown.nvim plugins do this.

I like the idea of a simple, minimalist LSP server it shouldn't be too hard to implement. I just need some time to explore the topic. I'm currently very busy, but I hope to find some time over the next couple of weeks to look into it. Thanks for bringing up the idea!

Jezda1337 avatar May 27 '25 22:05 Jezda1337

@231tr0n I've added a basic LSP solution to the /dev branch. Could you give it a try? I've tested it with Neovim's built-in autocompletion, and it seems to be working fine.

Jezda1337 avatar Jun 01 '25 15:06 Jezda1337

@Jezda1337 I have called the setup method but the lsp seems to not be up for html files. Is this config correct?

	add({
		source = "Jezda1337/nvim-html-css",
		checkout = "dev",
		monitor = "dev",
	})
	require("html-css").setup({
		enable_on = { "html" },
		handlers = {
			definition = {
				bind = "gd",
			},
			hover = {
				bind = "K",
				wrap = true,
				border = "none",
				position = "cursor",
			},
		},
		documentation = {
			auto_show = true,
		},
		style_sheets = {},
	}

231tr0n avatar Jun 01 '25 15:06 231tr0n

sry i forgot to mention:

lsp = {
   enable = true,
},

this is in the same lvl as handlers, neable_on, style_sheet

Jezda1337 avatar Jun 01 '25 15:06 Jezda1337

@Jezda1337 It works now! Thank you for considering my request and implementing it!

231tr0n avatar Jun 01 '25 15:06 231tr0n

@231tr0n Sure, thanks for the suggestions. I'll keep this on the dev branch for now since it still needs more testing. Once I have time to properly test it, I'll go ahead and merge it into main. Hopefully, I can get to some thorough testing soon. Cheers!

Jezda1337 avatar Jun 01 '25 15:06 Jezda1337

@231tr0n Sure, thanks for the suggestions. I'll keep this on the dev branch for now since it still needs more testing. Once I have time to properly test it, I'll go ahead and merge it into main. Hopefully, I can get to some thorough testing soon. Cheers!

Yup will sit next week and integrate this properly into my mini.nvim config.

231tr0n avatar Jun 01 '25 15:06 231tr0n

@Jezda1337 will this be merged this weekend? I am planning on spending my time working on my neovim config and taught I will noicely integrate this as well.

231tr0n avatar Jun 06 '25 17:06 231tr0n

@231tr0n probably not this weekend, got a ton of stuff on over the next couple of weeks. I’ll try to get to it before the end of the month though

Jezda1337 avatar Jun 06 '25 17:06 Jezda1337