Adds support for JSON Schema in Atom.
Using is-my-json-valid for schema validation, Json Schema warns the user if their json file doesn't match the commonly defined schema. Also using the defined Json Schema we can offer auto completion results for enum values.
Json Schema was built for use with OmniSharp. There is an extension point that lets you plug in custom intellisense providers. This is to help with tools like Npm or NuGet, where package.json and project.json both have their package references. This this extension point you can plug in calls off to the associated webservice / localcache / whatever you want.
As stated above, NPM support is added out of the box. Search is limited to starts with
(if anyone knows how to fuzzy search against skimdb log an issue!). We can add the package for you, as well as the latest version as values.
Bower support is planned, I still have to figure out the best way to find version numbers (or if its even possible since bower uses git...).
The schema interface is declared in typescript as follows:
interface IAutocompleteProvider {
fileMatchs: string[];
pathMatch: (path: string) => boolean;
getSuggestions: (options: IAutocompleteProviderOptions) => Promise<Suggestion[]>;
dispose(): void;
}
interface IAutocompleteProviderOptions {
editor: Atom.TextEditor;
bufferPosition: TextBuffer.Point; // the position of the cursor
prefix: string;
scopeDescriptor: { scopes: string[] };
activatedManually: boolean;
path: string;
}
dependencies
or dependencies.lodash
Then in your package.json
add...
"jsonschema.provider": {
"versions": {
"0.1.0": "consumeProvider"
}
}