antonk52 / basics-language-server

Buffer, path, and snippet completions
MIT License
58 stars 0 forks source link

Bug: `snippets` not respecting the `prefix` of the VSCode snippet spec #4

Closed chrisgrieser closed 1 month ago

chrisgrieser commented 1 month ago

Given this snippet in a snippet file:

"foobar": {
  "body": "Hello World",
  "prefix": "barbaz"
},

basics_ls only suggests the snippet when typing foobar. However, the vscode snippet spec specifies that not the entry's key (in the example: foobar), but rather the entry's prefix value (in the example: barbaz) should be used as trigger word:

prefix defines one or more trigger words that display the snippet in IntelliSense. Substring matching is performed on prefixes, so in this case, "fc" could match "for-const".

This is also how all other snippet engines I have used in the past (nvim-snippets, luasnip) do work.

antonk52 commented 1 month ago

Thanks for the issue, I can look into why this fails to work later today/tomorrow

antonk52 commented 1 month ago

I've released a new version 1.0.2 which includes the fix and tests for it to make sure this does not happen in the future. This issue should be resolved now.