Autocomplete for json array(intellisense?)
Hello,
I would like to know if it's possible to autocomplete json array with strings based on another global variable or a file.
Example:
let myArray = ["First", "Second", "Third"];
My JSON would have an array:
{
"myArray": [];/*When I try to add a string here it
should show me all possibile things I can put
(based on my variable above if possible),
so it would show "First", "Second", "Third".
Pressing ctrl + space might expand it as well.*/
}
Perhaps it might detect that I am trying to add a string by starting with quotation mark, which is fine to me.
The reason for that is to make it easier with filling my json file with data, so I don't have to look up all possible options I can choose.
Please sign in to leave a comment.
No, you can't expect getting completion based on unrelated global variables.
But you can define your own JSON schemas - code completion in JSON is based on schemas (if any); a custom schema must meet the JSON schema standards and must be located under the project root
Thanks, I will look into it.