blink.cmp icon indicating copy to clipboard operation
blink.cmp copied to clipboard

In Svelte, some symbol prefixes fail to trigger autocompletion, such as the rune symbol $.

Open BingCoke opened this issue 7 months ago • 6 comments

Make sure you have done the following

  • [x] Updated to the latest version of blink.cmp
  • [x] Searched for existing issues and documentation (try <C-k> on https://cmp.saghen.dev)

Bug Description

When I type the $ symbol, no auto-completion options appear. However, when I use the "Show" shortcut, I can see that the relevant rune completions are available normally.

Image Image

The same issue occurs with the component's bind: property—when I type bind:, no auto-completion suggestions appear. Even using the "Show" shortcut doesn't trigger any completions. Only after typing the first character of a bindable property do I get the expected suggestions.

type bind: cannot get Image

use "show" shortcut cannot get useful completions

Image

Only after typing t (the first character of a bindable property) do I get useful suggestions—but even then, not all available completions appear. For example, form is also a bindable property, but it doesn't show up in the suggestions.

Image

Although it's still usable, the experience isn't ideal. For example, it's very difficult to check all bindable properties of a component—especially when dealing with third-party components where we can't know in advance whether a property supports binding.

Relevant configuration

require("blink.cmp").setup({
	snippets = { preset = "luasnip" },
	sources = {
		default = { "lsp", "path", "snippets" },
		providers = {},
	},
	completion = {
		documentation = {
			auto_show = true,
			auto_show_delay_ms = 50,
			window = {
				border = "rounded",
			},
		},
		keyword = { range = "full" },
		trigger = {
			show_on_blocked_trigger_characters = { " ", "\n", "\t", "$", ":" },
		},
		accept = { auto_brackets = { enabled = false } },
		--ghost_text = { enabled = true },
	},
})

neovim version

nvim --version (base) NVIM v0.11.1 Build type: Release LuaJIT 2.1.1744318430 Run "nvim -V1 -v" for more info

blink.cmp version

    version 1.3.0         tag     v1.3.0         branch  main         commit  54cbaac

BingCoke avatar May 15 '25 07:05 BingCoke

The name of show_on_blocked_trigger_characters can be confusing, but you should read the docs for it (either on the type or :h blink-cmp-config-reference). It sets the trigger characters to block so you'll want to remove the options you set. Wrt the LSP returning the wrong items on bind:, there's not much we can do about that, it's up to your LSP

saghen avatar May 15 '25 15:05 saghen

The name of show_on_blocked_trigger_characters can be confusing, but you should read the docs for it (either on the type or :h blink-cmp-config-reference). It sets the trigger characters to block so you'll want to remove the options you set. Wrt the LSP returning the wrong items on bind:, there's not much we can do about that, it's up to your LSP

When I delete the show_on_blocked_trigger_characters configuration item, the $ symbol will no longer have any completions.

	completion = {
					keyword = { range = "full" },
					trigger = {
					},
     }
Image

BingCoke avatar May 16 '25 01:05 BingCoke

Hi! @Saghen I found that there are still more issues. In Svelte, some symbol prefixes can prevent the triggering of autocompletion. For example, in the expression of an if statement, using the ! symbol also fails to trigger autocompletion. However, when using nvim-cmp, symbols like $ and ! can still trigger autocompletion. This means it’s not an issue with the LSP, but rather some behaviors of blink.cmp that are causing differences in the way autocompletion is triggered. Image

BingCoke avatar Jun 25 '25 02:06 BingCoke

I am not very experienced yet with neovim or this plugin but I did want to chime in that I have been experiencing this too while testing this plugin as a replacement for nvim-cmp. Like @BingCoke says, with nvim-cmp these symbols can still trigger autocompletion.

zpfallon avatar Jun 26 '25 23:06 zpfallon

This does not seem to be an issue with the LSP, trying the same with Code-OSS (v1.104.2), works as expected. nvim.cmp is also able to handle it gracefully. With the same svelte LSP, i.e https://github.com/sveltejs/language-tools

Crysthamus avatar Oct 08 '25 01:10 Crysthamus

@Saghen Hello—sorry to bother you. Is there any plan to address this issue? It’s critical for the day-to-day Svelte coding experience. As others have already pointed out, it’s definitely not an LSP problem: neither nvim.cmp nor VS Code exhibits the same behavior. That leaves me having to fall back to nvim.cmp, but I’d really love to stay with blink.cmp. If you could offer any guidance I’d be extremely grateful.

BingCoke avatar Oct 13 '25 00:10 BingCoke