Refresh master with initial release/0.24 snapshot (#332)

* Initial port of release/0.24 source code

* Fix additional headers

* Fix a typo in launch.json
This commit is contained in:
Karl Burtram
2017-12-15 15:38:57 -08:00
committed by GitHub
parent 271b3a0b82
commit 6ad0df0e3e
7118 changed files with 107999 additions and 56466 deletions

View File

@@ -5,9 +5,8 @@
'use strict';
import { IJSONSchema } from 'vs/base/common/jsonSchema';
import platform = require('vs/platform/registry/common/platform');
import { EventEmitter } from 'vs/base/common/eventEmitter';
import { IDisposable } from 'vs/base/common/lifecycle';
import * as platform from 'vs/platform/registry/common/platform';
import Event, { Emitter } from 'vs/base/common/event';
export const Extensions = {
JSONContribution: 'base.contributions.json'
@@ -19,6 +18,8 @@ export interface ISchemaContributions {
export interface IJSONContributionRegistry {
readonly onDidChangeSchema: Event<string>;
/**
* Register a schema to the registry.
*/
@@ -28,12 +29,6 @@ export interface IJSONContributionRegistry {
* Get all schemas
*/
getSchemaContributions(): ISchemaContributions;
/**
* Adds a change listener
*/
addRegistryChangedListener(callback: (e: IJSONContributionRegistryEvent) => void): IDisposable;
}
export interface IJSONContributionRegistryEvent {
@@ -50,21 +45,19 @@ function normalizeId(id: string) {
class JSONContributionRegistry implements IJSONContributionRegistry {
private schemasById: { [id: string]: IJSONSchema };
private eventEmitter: EventEmitter;
private _onDidChangeSchema: Emitter<string> = new Emitter<string>();
readonly onDidChangeSchema: Event<string> = this._onDidChangeSchema.event;
constructor() {
this.schemasById = {};
this.eventEmitter = new EventEmitter();
}
public addRegistryChangedListener(callback: (e: IJSONContributionRegistryEvent) => void): IDisposable {
return this.eventEmitter.addListener('registryChanged', callback);
}
public registerSchema(uri: string, unresolvedSchemaContent: IJSONSchema): void {
this.schemasById[normalizeId(uri)] = unresolvedSchemaContent;
this.eventEmitter.emit('registryChanged', {});
this._onDidChangeSchema.fire(uri);
}
public getSchemaContributions(): ISchemaContributions {

View File

@@ -39,10 +39,10 @@ export class JSONValidationExtensionPoint {
constructor() {
configurationExtPoint.setHandler((extensions) => {
for (var i = 0; i < extensions.length; i++) {
var extensionValue = <IJSONValidationExtensionPoint[]>extensions[i].value;
var collector = extensions[i].collector;
var extensionPath = extensions[i].description.extensionFolderPath;
for (let i = 0; i < extensions.length; i++) {
const extensionValue = <IJSONValidationExtensionPoint[]>extensions[i].value;
const collector = extensions[i].collector;
const extensionPath = extensions[i].description.extensionFolderPath;
if (!extensionValue || !Array.isArray(extensionValue)) {
collector.error(nls.localize('invalid.jsonValidation', "'configuration.jsonValidation' must be a array"));