chrisgrieser / nvim-scissors

Automagical editing and creation of snippets.
MIT License
377 stars 4 forks source link

[Bug]: Not working after basic install #1

Closed Rizhiy closed 10 months ago

Rizhiy commented 10 months ago

Bug Description

Installed using Lazy, when trying to run any function getting the following error:

 E5108: Error executing lua: ...azy/nvim-scissors/lua/scissors/read-write-operations.lua:22: package.json could not be read
 stack traceback:
 ▸   [C]: in function 'assert'
 ▸   ...azy/nvim-scissors/lua/scissors/read-write-operations.lua:22: in function 'readAndParseJson'
 ▸   ...e/nvim/lazy/nvim-scissors/lua/scissors/vscode-format.lua:21: in function 'getSnippetFilesForFt'
 ▸   ...ocal/share/nvim/lazy/nvim-scissors/lua/scissors/init.lua:74: in function 'addNewSnippet'
 ▸   /home/rizhiy/.config/nvim/lua/plugins/cmp.lua:25: in function </home/rizhiy/.config/nvim/lua/plugins/cmp.lua:25>

Relevant Screenshot

No response

To Reproduce

Install it using lazy and try to execute using Lua

neovim version

NVIM v0.9.4
Build type: Release
LuaJIT 2.1.1692716794

Make sure you have done the following

chrisgrieser commented 10 months ago

As the error message says: it looks like you are missing a package.json specifying your snippet Information in your snippet directory, which is required for this plugin to work.

Rizhiy commented 10 months ago

I don't know how snippets work underneath, can't you create a standard one by default?

chrisgrieser commented 10 months ago

Hmm yeah, in that case it's about bootstrapping a vs code snippet dir, which would go into a similar direction as #2

FormalSnake commented 9 months ago

where can I get said package.json?

FormalSnake commented 9 months ago

rn I am using the one from your dot files

chrisgrieser commented 9 months ago

@FormalSnake I added the automatic bootstrapping of the package.json if none exists in your snippet file in the last few commits.

I'll also add a section explaining the requirements for the package.json to the readme momentarily.

FormalSnake commented 9 months ago

nice, thank you.

chrisgrieser commented 9 months ago

I added an FAQ showing the requirements for the VSCode-style snippet format: https://github.com/chrisgrieser/nvim-scissors#cookbook--faq