Visual Studio Code provides out of the box support for JSON files, including features like validation and auto-completion. To enhance your experience with the ida-plugin.json
file, you can use a JSON schema that defines the structure and constraints of the file.
Here’s how to set it up:
- Download the JSON schema file for
ida-plugin-schema.json
from the my gist. - Save the schema file in a directory where you keep your project files, for example,
~/Documents/schemas/ida-plugin-schema.json
. - Open your Visual Studio Code settings json.schemas and click on “Edit in settings.json”.
- Add the following configuration to your
~/Library/Application Support/Code/User/settings.json
file:
"json.schemas": [
{
"fileMatch": [
"**/ida-plugin.json",
],
"url": "/Users/<username>/Documents/schemas/ida-plugin-schema.json"
}
],
- Make sure to adjust the
url
path to point to where you saved the schema file. - Save the settings file.
From now on, when you open the ida-plugin.json
file in Visual Studio Code, it will automatically validate against the schema and provide auto-completion for the fields defined in the schema.
This setup will help you ensure that your ida-plugin.json
file adheres to the documentation and make it easier to develop IDA Pro plugins.
As an alternative, you can reference the schema directly in your settings.json
file:
"json.schemas": [
{
"fileMatch": [
"**/ida-plugin.json",
],
"url": "https://gist.githubusercontent.com/milankovo/a1ee7254053e384735010d1da9d91bcc/raw/d1dec1ba08c7c42e13f4ee3a9fcf23951b34e895/ida-plugin.schema.json"
}
],
But that is not very privacy friendly and will not work if you are offline. So I recommend downloading the schema file and using the local path as described above.
Warning: Don’t look at the regular expression for idaVersions, it was automatically generated from the semver grammar and might induce you a headache.