Skip to content

Commit e2cc27b

Browse files
committed
Update LKG
1 parent 6b64fee commit e2cc27b

File tree

5 files changed

+27
-4
lines changed

5 files changed

+27
-4
lines changed

lib/tsserver.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74779,6 +74779,11 @@ var ts;
7477974779
return;
7478074780
}
7478174781
var searchPaths = [ts.combinePaths(host.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
74782+
if (this.projectService.allowLocalPluginLoads) {
74783+
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
74784+
this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
74785+
searchPaths.unshift(local);
74786+
}
7478274787
if (options.plugins) {
7478374788
for (var _i = 0, _a = options.plugins; _i < _a.length; _i++) {
7478474789
var pluginConfigEntry = _a[_i];
@@ -75163,6 +75168,7 @@ var ts;
7516375168
this.eventHandler = opts.eventHandler;
7516475169
this.globalPlugins = opts.globalPlugins || server.emptyArray;
7516575170
this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray;
75171+
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
7516675172
ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
7516775173
this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
7516875174
this.directoryWatchers = new DirectoryWatchers(this);
@@ -76743,7 +76749,8 @@ var ts;
7674376749
throttleWaitMilliseconds: throttleWaitMilliseconds,
7674476750
eventHandler: this.eventHandler,
7674576751
globalPlugins: opts.globalPlugins,
76746-
pluginProbeLocations: opts.pluginProbeLocations
76752+
pluginProbeLocations: opts.pluginProbeLocations,
76753+
allowLocalPluginLoads: opts.allowLocalPluginLoads
7674776754
};
7674876755
this.projectService = new server.ProjectService(settings);
7674976756
this.gcTimer = new server.GcTimer(this.host, 7000, this.logger);
@@ -78995,7 +79002,8 @@ var ts;
7899579002
logger: logger,
7899679003
canUseEvents: canUseEvents,
7899779004
globalPlugins: options.globalPlugins,
78998-
pluginProbeLocations: options.pluginProbeLocations
79005+
pluginProbeLocations: options.pluginProbeLocations,
79006+
allowLocalPluginLoads: options.allowLocalPluginLoads
7899979007
}) || this;
7900079008
if (telemetryEnabled && typingsInstaller) {
7900179009
typingsInstaller.setTelemetrySender(_this);
@@ -79269,6 +79277,7 @@ var ts;
7926979277
var typingSafeListLocation = server.findArgument("--typingSafeListLocation");
7927079278
var globalPlugins = (server.findArgument("--globalPlugins") || "").split(",");
7927179279
var pluginProbeLocations = (server.findArgument("--pluginProbeLocations") || "").split(",");
79280+
var allowLocalPluginLoads = server.hasArgument("--allowLocalPluginLoads");
7927279281
var useSingleInferredProject = server.hasArgument("--useSingleInferredProject");
7927379282
var disableAutomaticTypingAcquisition = server.hasArgument("--disableAutomaticTypingAcquisition");
7927479283
var telemetryEnabled = server.hasArgument(server.Arguments.EnableTelemetry);
@@ -79284,7 +79293,8 @@ var ts;
7928479293
telemetryEnabled: telemetryEnabled,
7928579294
logger: logger,
7928679295
globalPlugins: globalPlugins,
79287-
pluginProbeLocations: pluginProbeLocations
79296+
pluginProbeLocations: pluginProbeLocations,
79297+
allowLocalPluginLoads: allowLocalPluginLoads
7928879298
};
7928979299
var ioSession = new IOSession(options);
7929079300
process.on("uncaughtException", function (err) {

lib/tsserverlibrary.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,7 @@ declare namespace ts {
482482
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
483483
interface Declaration extends Node {
484484
_declarationBrand: any;
485+
name?: DeclarationName;
485486
}
486487
interface NamedDeclaration extends Declaration {
487488
name?: DeclarationName;
@@ -4470,6 +4471,7 @@ declare namespace ts.server {
44704471
throttleWaitMilliseconds?: number;
44714472
globalPlugins?: string[];
44724473
pluginProbeLocations?: string[];
4474+
allowLocalPluginLoads?: boolean;
44734475
}
44744476
class Session implements EventSender {
44754477
private readonly gcTimer;
@@ -5048,6 +5050,7 @@ declare namespace ts.server {
50485050
throttleWaitMilliseconds?: number;
50495051
globalPlugins?: string[];
50505052
pluginProbeLocations?: string[];
5053+
allowLocalPluginLoads?: boolean;
50515054
}
50525055
class ProjectService {
50535056
readonly typingsCache: TypingsCache;
@@ -5077,6 +5080,7 @@ declare namespace ts.server {
50775080
private readonly eventHandler?;
50785081
readonly globalPlugins: ReadonlyArray<string>;
50795082
readonly pluginProbeLocations: ReadonlyArray<string>;
5083+
readonly allowLocalPluginLoads: boolean;
50805084
constructor(opts: ProjectServiceOptions);
50815085
ensureInferredProjectsUpToDate_TestOnly(): void;
50825086
getCompilerOptionsForInferredProjects(): CompilerOptions;

lib/tsserverlibrary.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73059,7 +73059,8 @@ var ts;
7305973059
throttleWaitMilliseconds: throttleWaitMilliseconds,
7306073060
eventHandler: this.eventHandler,
7306173061
globalPlugins: opts.globalPlugins,
73062-
pluginProbeLocations: opts.pluginProbeLocations
73062+
pluginProbeLocations: opts.pluginProbeLocations,
73063+
allowLocalPluginLoads: opts.allowLocalPluginLoads
7306373064
};
7306473065
this.projectService = new server.ProjectService(settings);
7306573066
this.gcTimer = new server.GcTimer(this.host, 7000, this.logger);
@@ -76584,6 +76585,11 @@ var ts;
7658476585
return;
7658576586
}
7658676587
var searchPaths = [ts.combinePaths(host.getExecutingFilePath(), "../../..")].concat(this.projectService.pluginProbeLocations);
76588+
if (this.projectService.allowLocalPluginLoads) {
76589+
var local = ts.getDirectoryPath(this.canonicalConfigFilePath);
76590+
this.projectService.logger.info("Local plugin loading enabled; adding " + local + " to search paths");
76591+
searchPaths.unshift(local);
76592+
}
7658776593
if (options.plugins) {
7658876594
for (var _i = 0, _a = options.plugins; _i < _a.length; _i++) {
7658976595
var pluginConfigEntry = _a[_i];
@@ -76968,6 +76974,7 @@ var ts;
7696876974
this.eventHandler = opts.eventHandler;
7696976975
this.globalPlugins = opts.globalPlugins || server.emptyArray;
7697076976
this.pluginProbeLocations = opts.pluginProbeLocations || server.emptyArray;
76977+
this.allowLocalPluginLoads = !!opts.allowLocalPluginLoads;
7697176978
ts.Debug.assert(!!this.host.createHash, "'ServerHost.createHash' is required for ProjectService");
7697276979
this.toCanonicalFileName = ts.createGetCanonicalFileName(this.host.useCaseSensitiveFileNames);
7697376980
this.directoryWatchers = new DirectoryWatchers(this);

lib/typescript.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ declare namespace ts {
491491
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
492492
interface Declaration extends Node {
493493
_declarationBrand: any;
494+
name?: DeclarationName;
494495
}
495496
interface NamedDeclaration extends Declaration {
496497
name?: DeclarationName;

lib/typescriptServices.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ declare namespace ts {
491491
type DeclarationName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | BindingPattern;
492492
interface Declaration extends Node {
493493
_declarationBrand: any;
494+
name?: DeclarationName;
494495
}
495496
interface NamedDeclaration extends Declaration {
496497
name?: DeclarationName;

0 commit comments

Comments
 (0)