Skip to content

Commit

Permalink
Update LKG
Browse files Browse the repository at this point in the history
  • Loading branch information
mhegazy committed May 22, 2017
1 parent 6b64fee commit e2cc27b
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 4 deletions.
16 changes: 13 additions & 3 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -74779,6 +74779,11 @@ var ts;
return;
}
var searchPaths = [ts.combinePaths(host.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
if (this.projectService.allowLocalPluginLoads) {
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
searchPaths.unshift(local);
}
if (options.plugins) {
for (var _i = 0, _a = options.plugins; _i < _a.length; _i++) {
var pluginConfigEntry = _a[_i];
Expand Down Expand Up @@ -75163,6 +75168,7 @@ var ts;
this.eventHandler = opts.eventHandler;
this.globalPlugins = opts.globalPlugins || server.emptyArray;
this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray;
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
this.directoryWatchers = new DirectoryWatchers(this);
Expand Down Expand Up @@ -76743,7 +76749,8 @@ var ts;
throttleWaitMilliseconds: throttleWaitMilliseconds,
eventHandler: this.eventHandler,
globalPlugins: opts.globalPlugins,
pluginProbeLocations: opts.pluginProbeLocations
pluginProbeLocations: opts.pluginProbeLocations,
allowLocalPluginLoads: opts.allowLocalPluginLoads
};
this.projectService = new server.ProjectService(settings);
this.gcTimer = new server.GcTimer(this.host, 7000, this.logger);
Expand Down Expand Up @@ -78995,7 +79002,8 @@ var ts;
logger: logger,
canUseEvents: canUseEvents,
globalPlugins: options.globalPlugins,
pluginProbeLocations: options.pluginProbeLocations
pluginProbeLocations: options.pluginProbeLocations,
allowLocalPluginLoads: options.allowLocalPluginLoads
}) || this;
if (telemetryEnabled && typingsInstaller) {
typingsInstaller.setTelemetrySender(_this);
Expand Down Expand Up @@ -79269,6 +79277,7 @@ var ts;
var typingSafeListLocation = server.findArgument("--typingSafeListLocation");
var globalPlugins = (server.findArgument("--globalPlugins") || "").split(",");
var pluginProbeLocations = (server.findArgument("--pluginProbeLocations") || "").split(",");
var allowLocalPluginLoads = server.hasArgument("--allowLocalPluginLoads");
var useSingleInferredProject = server.hasArgument("--useSingleInferredProject");
var disableAutomaticTypingAcquisition = server.hasArgument("--disableAutomaticTypingAcquisition");
var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry);
Expand All @@ -79284,7 +79293,8 @@ var ts;
telemetryEnabled: telemetryEnabled,
logger: logger,
globalPlugins: globalPlugins,
pluginProbeLocations: pluginProbeLocations
pluginProbeLocations: pluginProbeLocations,
allowLocalPluginLoads: allowLocalPluginLoads
};
var ioSession = new IOSession(options);
process.on("uncaughtException", function (err) {
Expand Down
4 changes: 4 additions & 0 deletions lib/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ declare namespace ts {
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
interface Declaration extends Node {
_declarationBrand: any;
name?: DeclarationName;
}
interface NamedDeclaration extends Declaration {
name?: DeclarationName;
Expand Down Expand Up @@ -4470,6 +4471,7 @@ declare namespace ts.server {
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
allowLocalPluginLoads?: boolean;
}
class Session implements EventSender {
private readonly gcTimer;
Expand Down Expand Up @@ -5048,6 +5050,7 @@ declare namespace ts.server {
throttleWaitMilliseconds?: number;
globalPlugins?: string[];
pluginProbeLocations?: string[];
allowLocalPluginLoads?: boolean;
}
class ProjectService {
readonly typingsCache: TypingsCache;
Expand Down Expand Up @@ -5077,6 +5080,7 @@ declare namespace ts.server {
private readonly eventHandler?;
readonly globalPlugins: ReadonlyArray<string>;
readonly pluginProbeLocations: ReadonlyArray<string>;
readonly allowLocalPluginLoads: boolean;
constructor(opts: ProjectServiceOptions);
ensureInferredProjectsUpToDate_TestOnly(): void;
getCompilerOptionsForInferredProjects(): CompilerOptions;
Expand Down
9 changes: 8 additions & 1 deletion lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -73059,7 +73059,8 @@ var ts;
throttleWaitMilliseconds: throttleWaitMilliseconds,
eventHandler: this.eventHandler,
globalPlugins: opts.globalPlugins,
pluginProbeLocations: opts.pluginProbeLocations
pluginProbeLocations: opts.pluginProbeLocations,
allowLocalPluginLoads: opts.allowLocalPluginLoads
};
this.projectService = new server.ProjectService(settings);
this.gcTimer = new server.GcTimer(this.host, 7000, this.logger);
Expand Down Expand Up @@ -76584,6 +76585,11 @@ var ts;
return;
}
var searchPaths = [ts.combinePaths(host.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
if (this.projectService.allowLocalPluginLoads) {
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
searchPaths.unshift(local);
}
if (options.plugins) {
for (var _i = 0, _a = options.plugins; _i < _a.length; _i++) {
var pluginConfigEntry = _a[_i];
Expand Down Expand Up @@ -76968,6 +76974,7 @@ var ts;
this.eventHandler = opts.eventHandler;
this.globalPlugins = opts.globalPlugins || server.emptyArray;
this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray;
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
this.directoryWatchers = new DirectoryWatchers(this);
Expand Down
1 change: 1 addition & 0 deletions lib/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ declare namespace ts {
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
interface Declaration extends Node {
_declarationBrand: any;
name?: DeclarationName;
}
interface NamedDeclaration extends Declaration {
name?: DeclarationName;
Expand Down
1 change: 1 addition & 0 deletions lib/typescriptServices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,7 @@ declare namespace ts {
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
interface Declaration extends Node {
_declarationBrand: any;
name?: DeclarationName;
}
interface NamedDeclaration extends Declaration {
name?: DeclarationName;
Expand Down

0 comments on commit e2cc27b

Please sign in to comment.