// Path: core/ts.core/src/ts/client/CommandNames.java
// public enum CommandNames implements ISupportable {
// 
// 	Open("open"), 
// 	Close("close"), 
// 	Change("change"), 
// 	NavBar("navbar"), 
// 	Completions("completions"), 
// 	CompletionEntryDetails("completionEntryDetails"), 
// 	Reload("reload"), 
// 	Definition("definition"), 
// 	SignatureHelp("signatureHelp"), 
// 	QuickInfo("quickinfo"), 
// 	Geterr("geterr"),
// 	GeterrForProject("geterrForProject"),
// 	Format("format"), 
// 	References("references"), 
// 	Occurrences("occurrences"), 
// 	Configure("configure"),
// 	ProjectInfo("projectInfo"),
// 	Rename("rename"),
// 	NavTo("navto"),
// 
// 	// 2.0.0
// 	SemanticDiagnosticsSync("semanticDiagnosticsSync", "2.0.0"), 
// 	SyntacticDiagnosticsSync("syntacticDiagnosticsSync", "2.0.0"), 
// 	
// 	// 2.0.5
// 	CompileOnSaveAffectedFileList("compileOnSaveAffectedFileList", "2.0.5"),
// 	CompileOnSaveEmitFile("compileOnSaveEmitFile", "2.0.5"),
// 	
// 	// 2.0.6
// 	NavTree("navtree", "2.0.6"),
// 	DocCommentTemplate("docCommentTemplate", "2.0.6"),
// 	
// 	// 2.1.0
// 	Implementation("implementation", "2.1.0"),
// 	GetSupportedCodeFixes("getSupportedCodeFixes", "2.1.0"),
// 	GetCodeFixes("getCodeFixes", "2.1.0"),
// 
// 	// 2.4.0
// 	GetApplicableRefactors("getApplicableRefactors", "2.4.0"),
//     GetEditsForRefactor("getEditsForRefactor", "2.4.0"),
// 	
// 	OpenExternalProject("openExternalProject");
//     
// 	private final String name;
// 	private final String sinceVersion;
// 
// 	private CommandNames(String name) {
// 		this(name, null);
// 	}
// 
// 	private CommandNames(String name, String sinceVersion) {
// 		this.name = name;
// 		this.sinceVersion = sinceVersion;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	/**
// 	 * Return true if the tsserver command support the given version and false
// 	 * otherwise.
// 	 * 
// 	 * @param version
// 	 * @return true if the tsserver command support the given version and false
// 	 *         otherwise.
// 	 */
// 	public boolean canSupport(String version) {
// 		return VersionHelper.canSupport(version, sinceVersion);
// 	}
// 
// }


import java.util.ArrayList;
import java.util.List;
import com.google.gson.JsonObject;
import ts.client.CommandNames;
import ts.client.diagnostics.DiagnosticEvent;

/**
 *  Copyright (c) 2015-2017 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */
package ts.internal.client.protocol;




/**
 * Geterr request; value of command field is "geterr". Wait for delay
 * milliseconds and then, if during the wait no change or reload messages have
 * arrived for the first file in the files list, get the syntactic errors for
 * the file, field requests, and then get the semantic errors for the file.
 * Repeat with a smaller delay for each subsequent file on the files list. Best
 * practice for an editor is to send a file list containing each file that is
 * currently visible, in most-recently-used order.
 * 
 * @see https://github.com/Microsoft/TypeScript/blob/master/src/server/protocol.ts
 */
public class GeterrRequest extends Request<GeterrRequestArgs> implements IRequestEventable<DiagnosticEvent> {

	private final transient List<DiagnosticEvent> events;

	public GeterrRequest(String[] files, int delay) {

// Path: core/ts.core/src/ts/client/CommandNames.java
// public enum CommandNames implements ISupportable {
// 
// 	Open("open"), 
// 	Close("close"), 
// 	Change("change"), 
// 	NavBar("navbar"), 
// 	Completions("completions"), 
// 	CompletionEntryDetails("completionEntryDetails"), 
// 	Reload("reload"), 
// 	Definition("definition"), 
// 	SignatureHelp("signatureHelp"), 
// 	QuickInfo("quickinfo"), 
// 	Geterr("geterr"),
// 	GeterrForProject("geterrForProject"),
// 	Format("format"), 
// 	References("references"), 
// 	Occurrences("occurrences"), 
// 	Configure("configure"),
// 	ProjectInfo("projectInfo"),
// 	Rename("rename"),
// 	NavTo("navto"),
// 
// 	// 2.0.0
// 	SemanticDiagnosticsSync("semanticDiagnosticsSync", "2.0.0"), 
// 	SyntacticDiagnosticsSync("syntacticDiagnosticsSync", "2.0.0"), 
// 	
// 	// 2.0.5
// 	CompileOnSaveAffectedFileList("compileOnSaveAffectedFileList", "2.0.5"),
// 	CompileOnSaveEmitFile("compileOnSaveEmitFile", "2.0.5"),
// 	
// 	// 2.0.6
// 	NavTree("navtree", "2.0.6"),
// 	DocCommentTemplate("docCommentTemplate", "2.0.6"),
// 	
// 	// 2.1.0
// 	Implementation("implementation", "2.1.0"),
// 	GetSupportedCodeFixes("getSupportedCodeFixes", "2.1.0"),
// 	GetCodeFixes("getCodeFixes", "2.1.0"),
// 
// 	// 2.4.0
// 	GetApplicableRefactors("getApplicableRefactors", "2.4.0"),
//     GetEditsForRefactor("getEditsForRefactor", "2.4.0"),
// 	
// 	OpenExternalProject("openExternalProject");
//     
// 	private final String name;
// 	private final String sinceVersion;
// 
// 	private CommandNames(String name) {
// 		this(name, null);
// 	}
// 
// 	private CommandNames(String name, String sinceVersion) {
// 		this.name = name;
// 		this.sinceVersion = sinceVersion;
// 	}
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	/**
// 	 * Return true if the tsserver command support the given version and false
// 	 * otherwise.
// 	 * 
// 	 * @param version
// 	 * @return true if the tsserver command support the given version and false
// 	 *         otherwise.
// 	 */
// 	public boolean canSupport(String version) {
// 		return VersionHelper.canSupport(version, sinceVersion);
// 	}
// 
// }


// Path: core/ts.core/src/ts/internal/client/protocol/GeterrRequest.java
import java.util.ArrayList;
import java.util.List;
import com.google.gson.JsonObject;
import ts.client.CommandNames;
import ts.client.diagnostics.DiagnosticEvent;

/**
 *  Copyright (c) 2015-2017 Angelo ZERR.
 *  All rights reserved. This program and the accompanying materials
 *  are made available under the terms of the Eclipse Public License v1.0
 *  which accompanies this distribution, and is available at
 *  http://www.eclipse.org/legal/epl-v10.html
 *
 *  Contributors:
 *  Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
 */
package ts.internal.client.protocol;




/**
 * Geterr request; value of command field is "geterr". Wait for delay
 * milliseconds and then, if during the wait no change or reload messages have
 * arrived for the first file in the files list, get the syntactic errors for
 * the file, field requests, and then get the semantic errors for the file.
 * Repeat with a smaller delay for each subsequent file on the files list. Best
 * practice for an editor is to send a file list containing each file that is
 * currently visible, in most-recently-used order.
 * 
 * @see https://github.com/Microsoft/TypeScript/blob/master/src/server/protocol.ts
 */
public class GeterrRequest extends Request<GeterrRequestArgs> implements IRequestEventable<DiagnosticEvent> {

	private final transient List<DiagnosticEvent> events;

	public GeterrRequest(String[] files, int delay) {

		super(CommandNames.Geterr.getName(), new GeterrRequestArgs(files, delay));
