VSCode - Implement Custom IntelliSense through Extension

144 Views Asked by At

I want to provide IntelliSense in VSCode based on a JSON file in the root folder of the project directory. The JSON file is at ./languages/english.json and is a key-value pair like below:

{
    "sidebar.title": "Hello",
    "sidebar.name": "John",
    "sidebar.surname": "Doe",
    "first.aaa": "Hello",
    "first.bbb": "Hi",
}

I want VSCode to suggest this JSON's keys whenever I'm writing in a function named i18n(). Something like this:

Intellisense

I figured the best way to write a VSCode extension of my own. I've created one before, but how can I implement this feature?

P.S. I know about the option of using snippet json files directly, however those have the limitation of not being dynamically populated.

* Simillarly asked by yansenlei on an issue on VSCode's repo #133001

0

There are 0 best solutions below