JSON file structure for Snippets Extension #255
Replies: 1 comment 3 replies
-
These docs should help https://code.visualstudio.com/docs/editor/userdefinedsnippets |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been working on a snippets extension that would provide snippets/suggestions based on looking up data stored in three large JSON files included in the extension directory. I have been successful getting it to work at a basic level however there is a serious delay when the lookup trigger is typed in addition to also be sometimes searching even when the prompt isnt provided which makes me think Ive got my JSON files structured incorrectly. Hoping that someone could confirm this is the correct or proper way to organize my snippets or point out where I went wrong with it.
Each JSON object in the files are structured like this:
Obviously, comas separating each object with unique data to match the thousands of fields in each JSON file. Where I am getting confused by how the Snippets guide explains organizing these JSON files, and it is definitely a misunderstanding on my part, is which data pieces are the ones that should trigger the lookup to be triggered? Does the name of the Snippet (In this case "1426") what should trigger the lookup or should that only happen when they would begin to type the prefix information? There are a lot of objects in my files that have identical prefix or Snippet names for the first part of their values and are only unique by the last character in their name or prefix/description, how do I either restrict the number of options that are returned to the user or increase how much information is required to be typed before the object is returned as an option?
I feel like there is possibly a better way to organize this to make it more manageable to use with my projects and I am curious to hear what suggestions others have to help me fix what I am doing wrong!
Beta Was this translation helpful? Give feedback.
All reactions