Skip to content

Commit

Permalink
Update API baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
amcasey committed Mar 21, 2018
1 parent 39b61cc commit dd2ae43
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ namespace ts.server {
hrtime: process.hrtime,
logger,
canUseEvents,
suppressProjectEvents,
suppressDiagnosticEvents,
globalPlugins: options.globalPlugins,
pluginProbeLocations: options.pluginProbeLocations,
allowLocalPluginLoads: options.allowLocalPluginLoads
Expand Down Expand Up @@ -951,7 +951,7 @@ namespace ts.server {
const useSingleInferredProject = hasArgument("--useSingleInferredProject");
const useInferredProjectPerProjectRoot = hasArgument("--useInferredProjectPerProjectRoot");
const disableAutomaticTypingAcquisition = hasArgument("--disableAutomaticTypingAcquisition");
const suppressProjectEvents = hasArgument("--suppressProjectEvents");
const suppressDiagnosticEvents = hasArgument("--suppressDiagnosticEvents");
const telemetryEnabled = hasArgument(Arguments.EnableTelemetry);

const options: IoSessionOptions = {
Expand Down
23 changes: 9 additions & 14 deletions src/server/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ namespace ts.server {
canUseEvents: boolean;
eventHandler?: ProjectServiceEventHandler;
/** Has no effect if eventHandler is also specified. */
suppressProjectEvents?: boolean;
suppressDiagnosticEvents?: boolean;
throttleWaitMilliseconds?: number;

globalPlugins?: ReadonlyArray<string>;
Expand All @@ -320,7 +320,7 @@ namespace ts.server {
protected logger: Logger;

protected canUseEvents: boolean;
private suppressProjectEvents?: boolean;
private suppressDiagnosticEvents?: boolean;
private eventHandler: ProjectServiceEventHandler;

constructor(opts: SessionOptions) {
Expand All @@ -331,7 +331,7 @@ namespace ts.server {
this.hrtime = opts.hrtime;
this.logger = opts.logger;
this.canUseEvents = opts.canUseEvents;
this.suppressProjectEvents = opts.suppressProjectEvents;
this.suppressDiagnosticEvents = opts.suppressDiagnosticEvents;

const { throttleWaitMilliseconds } = opts;

Expand Down Expand Up @@ -371,14 +371,11 @@ namespace ts.server {
private defaultEventHandler(event: ProjectServiceEvent) {
switch (event.eventName) {
case ProjectsUpdatedInBackgroundEvent:
if (this.suppressProjectEvents) {
return;
}
const { openFiles } = event.data;
this.projectsUpdatedInBackgroundEvent(openFiles);
break;
case ConfigFileDiagEvent:
if (this.suppressProjectEvents) {
if (this.suppressDiagnosticEvents) {
return;
}
const { triggerFile, configFileName: configFile, diagnostics } = event.data;
Expand All @@ -390,9 +387,6 @@ namespace ts.server {
}, "configFileDiag");
break;
case ProjectLanguageServiceStateEvent: {
if (this.suppressProjectEvents) {
return;
}
const eventName: protocol.ProjectLanguageServiceStateEventName = "projectLanguageServiceState";
this.event<protocol.ProjectLanguageServiceStateEventBody>({
projectName: event.data.project.getProjectName(),
Expand All @@ -414,11 +408,12 @@ namespace ts.server {
private projectsUpdatedInBackgroundEvent(openFiles: string[]): void {
this.projectService.logger.info(`got projects updated in background, updating diagnostics for ${openFiles}`);
if (openFiles.length) {
const checkList = this.createCheckList(openFiles);

// For now only queue error checking for open files. We can change this to include non open files as well
this.errorCheck.startNew(next => this.updateErrorCheck(next, checkList, 100, /*requireOpen*/ true));
if (!this.suppressDiagnosticEvents) {
const checkList = this.createCheckList(openFiles);

// For now only queue error checking for open files. We can change this to include non open files as well
this.errorCheck.startNew(next => this.updateErrorCheck(next, checkList, 100, /*requireOpen*/ true));
}

// Send project changed event
this.event<protocol.ProjectsUpdatedInBackgroundEventBody>({
Expand Down
3 changes: 3 additions & 0 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7255,6 +7255,8 @@ declare namespace ts.server {
*/
canUseEvents: boolean;
eventHandler?: ProjectServiceEventHandler;
/** Has no effect if eventHandler is also specified. */
suppressDiagnosticEvents?: boolean;
throttleWaitMilliseconds?: number;
globalPlugins?: ReadonlyArray<string>;
pluginProbeLocations?: ReadonlyArray<string>;
Expand All @@ -7273,6 +7275,7 @@ declare namespace ts.server {
private hrtime;
protected logger: Logger;
protected canUseEvents: boolean;
private suppressDiagnosticEvents?;
private eventHandler;
constructor(opts: SessionOptions);
private sendRequestCompletedEvent;
Expand Down

0 comments on commit dd2ae43

Please sign in to comment.