json-schema

Json Schema enhancements for Atom

OmniSharp

43,839

53

0.1.15

MIT

GitHub

This package provides the following services:

This package consumes the following services:

Json Schema

Adds support for JSON Schema in Atom.

Whats it do

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.

Extentions

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.

Npm support

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

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...).

Make your own schema provider

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;
}

Then in your package.json add...

"jsonschema.provider": {
  "versions": {
    "0.1.0": "consumeProvider"
  }
}

TODO